diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-08-06 16:21:49 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-08-06 17:14:06 -0400 |
| commit | d446fa485c2cb826e5619c0067ab19919dafa4e2 (patch) | |
| tree | 9e0e061e6815a31f75646df96c1a38f203d52a06 | |
| parent | a2eeb3110d951ae4e4967dd8ba0d85b0be0fb248 (diff) | |
Non-pervasive SelSub
| -rw-r--r-- | impl.bqn | 25 |
1 files changed, 13 insertions, 12 deletions
@@ -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 |
