From 2a4eb25fefeabb2d615694a32064a6e4b85749f4 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 20 May 2021 13:20:01 -0400 Subject: =?UTF-8?q?Lower-level=20implementation=20for=20/=E2=81=BC=20check?= =?UTF-8?q?ing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/r1.bqn | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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_ ⟨ -- cgit v1.2.3