aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--impl.bqn25
1 files changed, 13 insertions, 12 deletions
diff --git a/impl.bqn b/impl.bqn
index 90d5f6fb..f0bdec87 100644
--- a/impl.bqn
+++ b/impl.bqn
@@ -136,6 +136,19 @@ _under_←{
≤ ↩ !∘0 ⊘ (≤ _perv)
identity ← (0⊑⟨!∘0⟩) {(0⊑𝕨){𝕗=𝕩}◶𝕩‿(1⊑𝕨)}´ ⟨+‿0,-‿0,×‿1,÷‿1,⋆‿1,√‿1,∧‿1,∨‿0,|‿0,⌊‿∞,⌈‿¯∞,<‿0,≤‿1,=‿1,≥‿1,>‿0,≠‿0⟩
+SelSub←{
+ ! IsArray 𝕨
+ ! 1×´⥊Int¨ 𝕨
+ l←≠𝕩
+ ! 1×´⥊ ((-l)⊸≤×l⊸>)¨ 𝕨
+ ((⊢+l×0>⊢)¨𝕨)(1==𝕩)◶{
+ c←1×´s←1 Cell 𝕩
+ 𝕨((⥊𝕩)⊑˜c⊸×⊸+)⌜s⥊↕c
+ }‿{
+ ⊑⟜𝕩¨𝕨
+ }𝕩
+}
+
#⌜
# LAYER 3: Remove other limits
@@ -226,18 +239,6 @@ _onAxes_←{
}
}
-SelSub←{
- ! IsArray 𝕨
- ! ∧´⥊Int¨ 𝕨
- ! ∧´⥊ 𝕨 (≥⟜-∧<) ≠𝕩
- 𝕨↩𝕨+(≠𝕩)×𝕨<0
- 𝕨(1≠=∘⊢)◶{
- ⊑⟜𝕩¨𝕨
- }‿{
- c←×´s←1 Cell 𝕩
- ⊑⟜(⥊𝕩)¨(c×𝕨)+⌜s⥊↕c
- }𝕩
-}
Select←ToArray⊸(SelSub _onAxes_ 1)
⊏ ← 0⊸Select ⊘ Select