aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-08-08 13:55:55 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-08-08 13:55:55 -0400
commita391024132bb9dbb1f89da1243d5631fa29d5593 (patch)
tree905266efee35f6971f0663b4b4149e215b85cc90 /src
parentb14a5f4ab8eb98fecbcd978f0715980edd112c7a (diff)
Move SelSub before pervasion now that scan bug is fixed
Diffstat (limited to 'src')
-rw-r--r--src/r.bqn26
1 files changed, 13 insertions, 13 deletions
diff --git a/src/r.bqn b/src/r.bqn
index 71b09e5b..21e281ec 100644
--- a/src/r.bqn
+++ b/src/r.bqn
@@ -102,6 +102,19 @@ Transpose←{
(c⥊↕m)(+⟜(m⊸×)⊑(⥊𝕩)˜)⌜↕l
}⍟(0<=)
+SelSub←{
+ ! IsArray 𝕨
+ ! 1×´⥊Int⌜ 𝕨
+ l←≠𝕩
+ ! 1×´⥊ ((-l)⊸≤×l⊸>)⌜ 𝕨
+ ((⊢+l×0>⊢)⌜𝕨)(1==𝕩)◶{
+ c←1×´s←1 Cell 𝕩
+ 𝕨((⥊𝕩)⊑˜c⊸×⊸+)⌜s⥊↕c
+ }‿{
+ ⊑⟜𝕩⌜𝕨
+ }𝕩
+}
+
_under_←{
i←↕l←1×´s←≢𝕩
v←⥊𝕨𝔽○𝔾𝕩
@@ -150,19 +163,6 @@ Merge←{
≤ ↩ !∘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
- }‿{
- ⊑⟜𝕩⌜𝕨
- }𝕩
-}
-
Deshape←IsArray◶{⟨𝕩⟩}‿⥊
Reshape←{
! 1≥=𝕨