aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-05-20 13:20:01 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-05-20 13:20:56 -0400
commit2a4eb25fefeabb2d615694a32064a6e4b85749f4 (patch)
treea2528b5ec610e218e161aa5fecf3c3b62a3685bf /src
parent71bdbdbe1c61628cdccb1623f46c63b62e49b961 (diff)
Lower-level implementation for /⁼ checking
Diffstat (limited to 'src')
-rw-r--r--src/r1.bqn8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/r1.bqn b/src/r1.bqn
index 58f40c5d..f925b06d 100644
--- a/src/r1.bqn
+++ b/src/r1.bqn
@@ -207,6 +207,12 @@ Indices←{
"/𝕩: 𝕩 must consist of natural numbers" ! 1×´Nat⌜𝕩
Ind 𝕩
}
+IndicesInv←{
+ IA 1==𝕩
+ IA 1×´Nat⌜𝕩
+ IX (0⊸≤)◶⟨1,1×´(⊢≤○(⊑⟜𝕩)1⊸+)⌜∘↕⟩-˜≠𝕩
+ GroupLen 𝕩
+}
SelfClas ← (PermInv∘⍋∘Rep˜⊏˜¯1+`⊢) _self
OccurrenceCount ← ↕∘≠⊸(⊣-¨·⌈`ר) _self
@@ -823,7 +829,7 @@ PrimInverse ← INF _lookup_ ⟨
'↕', ≢_invChk_↕ ⊘ (IA∘0) # Should trace edge and invChk
'⌽', ⌽ ⊘ (-⊸⌽)
'⍉', TransposeInv ⊘ ReorderAxesInv
- '/', {IA 1==𝕩⋄IA 1∧´Nat⌜𝕩⋄IX(1∧´¯1⊸↓≤1⊸↓)𝕩⋄GroupLen𝕩}⊘(IA∘0)
+ '/', IndicesInv ⊘ (IA∘0)
'⊔', GroupIndsInv ⊘ GroupInv
SwapInverse ← INF _lookup_ ⟨