aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-23 16:04:19 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-23 16:04:19 -0400
commitbec36db405779540487b9ed17c89edd9b92782c6 (patch)
treed6fcc2d1551df8a713d840d80b7dd219577a06bc /src
parent4083d53d1a008a4d187dd130eedc362f71a83d2b (diff)
Non-pervasive self-classify implementation
Diffstat (limited to 'src')
-rw-r--r--src/r.bqn15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/r.bqn b/src/r.bqn
index e4e85c30..c23e5f48 100644
--- a/src/r.bqn
+++ b/src/r.bqn
@@ -463,6 +463,14 @@ _onAxes_←{
}⟜ToArray
}
+PermInv ← 1¨⊸GroupOrd
+_self←{
+ "∊𝕩 or ⊐𝕩: 𝕩 must have rank at least 1" ! 1≤=𝕩
+ g←⍋𝕩
+ 0 Fill (PermInv g) ⊏ g 𝔽 0⊸<◶⟨1,-⟜1≢○(⊑⟜(g⊏<˘⍟(1<=)𝕩))⊢⟩⌜↕≠𝕩
+}
+SelfClas ← (PermInv∘⍋∘(Indices⊸⊏)˜⊏˜¯1+`⊢) _self
+
÷ ↩ ÷ _perv
⋆ ↩ ⋆ _perv
√ ← ⋆⟜(÷2) ⊘ (⋆⟜÷˜)
@@ -638,13 +646,6 @@ _search←{ # 0 for ∊˜, 1 for ⊐
⟩ ToArray𝕩
}
}
-PermInv ← 1¨⊸GroupOrd
-_self←{
- "∊𝕩 or ⊐𝕩: 𝕩 must have rank at least 1" ! 1≤=𝕩
- g←⍋𝕩
- 0 Fill (PermInv g) ⊏ g 𝔽 0⊸<◶⟨1,-⟜1≢○(⊑⟜(g⊏<˘⍟(1<=)𝕩))⊢⟩⌜↕≠𝕩
-}
-SelfClas ← (PermInv∘⍋∘/˜⊏˜1-˜+`∘⊢) _self
Find←{
r←=𝕨
"⍷𝕩: Rank of 𝕨 cannot exceed rank of 𝕩" ! r≤=𝕩