From bec36db405779540487b9ed17c89edd9b92782c6 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 23 Apr 2021 16:04:19 -0400 Subject: Non-pervasive self-classify implementation --- src/r.bqn | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'src') 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≤=𝕩 -- cgit v1.2.3