diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-04-23 16:04:19 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2021-04-23 16:04:19 -0400 |
| commit | bec36db405779540487b9ed17c89edd9b92782c6 (patch) | |
| tree | d6fcc2d1551df8a713d840d80b7dd219577a06bc /src | |
| parent | 4083d53d1a008a4d187dd130eedc362f71a83d2b (diff) | |
Non-pervasive self-classify implementation
Diffstat (limited to 'src')
| -rw-r--r-- | src/r.bqn | 15 |
1 files changed, 8 insertions, 7 deletions
@@ -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≤=𝕩 |
