diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-04-30 21:04:30 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-04-30 21:04:30 -0400 |
| commit | 2e3fe35ec3ec07cb042eccbb221eec900d9ee39a (patch) | |
| tree | aa03bc4bb138bcdee08ae031a13b4b1eca045ff2 /src/r1.bqn | |
| parent | 15e361bb360bdda2941d92af5a82cba49b3fed48 (diff) | |
Rank-less Find implementation
Diffstat (limited to 'src/r1.bqn')
| -rw-r--r-- | src/r1.bqn | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -194,6 +194,14 @@ _selfβ{ 0 Fill (PermInv g) β g π½ 0βΈ<βΆβ¨1, -β1 CCβ(ββ(kβΈΓβg)) β’β©βββ π© } +Findβ{ + rβ=π¨ β dβ(=π©)-r + "β·π©: Rank of π¨ cannot exceed rank of π©" ! 0β€d + iβ<0 β jββ₯β(β1ΓΒ΄β’)dβsββ’π© + (β’π¨) { AβΓβπ©ββΈ(+β)ββ β i Aβ©π¨ β j Aβ©0β1+π©-π¨ }Β¨ dβs + 0 Fill (π¨ Match (β₯π©)βΛi+β<)β j +}βToArray + Indicesβ{ "/: Replication argument must have rank 1" ! 1==π© "/: Amounts to replicate must be natural numbers" ! 1ΓΒ΄Natβπ© @@ -694,13 +702,6 @@ GroupMβ{ β β GroupInds β GroupGen β β SelfClas β (1 _search) β β β’_self β (0 _searchΛ) -β β _rankOp_ - -Findβ{ - rβ=π¨ - "β·π©: Rank of π¨ cannot exceed rank of π©" ! rβ€=π© - 0 Fill π¨ β‘βr ((1+r-βΈββ’π©)ββ’π¨)βΈββr π© -}βToArray ProgressiveIndexOf β 0 Fill { cβ1-Λ=π¨ @@ -838,6 +839,7 @@ Mod2Inverse β INFΛ _lookup_ β¨ β β© First β Pick βΆ β© {π¨((π¨π½π©)βπ){π½}π©} # Same definition, new Pick β β _depthOp_ +β β _rankOp_ β₯ β© Deshape β Reshape β β >βPair _fillBy_ (β’βIF) β β Transpose β ReorderAxes |
