From a391024132bb9dbb1f89da1243d5631fa29d5593 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 8 Aug 2020 13:55:55 -0400 Subject: Move SelSub before pervasion now that scan bug is fixed --- src/r.bqn | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src') 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≥=𝕨 -- cgit v1.2.3