aboutsummaryrefslogtreecommitdiff
path: root/src/r1.bqn
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-29 18:55:47 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-04-29 18:55:47 -0400
commitcebaf4fa85cd1a91c0324933bde4d4e986307016 (patch)
treed6cbef21a000427fa8ad89caa8962d395897d7e5 /src/r1.bqn
parent8d5ba9918b866950dc413ec119670393388db4a5 (diff)
Move limited ¨ from r1 to r0
Diffstat (limited to 'src/r1.bqn')
-rw-r--r--src/r1.bqn8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/r1.bqn b/src/r1.bqn
index 1df11c08..9351c986 100644
--- a/src/r1.bqn
+++ b/src/r1.bqn
@@ -15,6 +15,7 @@ Deshape ← IsArray◶{𝕩Fill⟨𝕩⟩}‿⥊
Pair ← {⟨𝕩⟩} ⊘ {⟨𝕨,𝕩⟩}
ToArray ← <⍟(1-IsArray)
Cell ← ↓⟜≢
+MatchS ← 1×´=¨
_qSearch ← {+´·×`𝕗(1-=)⌜<}
_glyphLookup_ ← {
@@ -42,9 +43,6 @@ _fold←{
𝕨 (0<≠)⊘1◶⟨Identity 𝕗˙, 𝔽´⟩ 𝕩
}
-¨ ← { d←⥊𝕩⋄(≢𝕩)⥊(⊑⟜(⥊𝕨)𝔽⊑⟜d)⌜↕≠d } # LIMITED to equal-shape array arguments
-MatchS ← 1×´=¨
-
_eachd←{
_d←{ # Equal ranks
p←≢𝕨
@@ -431,7 +429,7 @@ _takeDrop←{
_c ← { (×⟜𝕗⌜𝕨) +⌜ 𝕩 }
i←<0 ⋄ k←1 ⋄ UIk←{ i (k×𝕨)_c↩ k ↕⊸(𝕨_c)⍟(1-=⟜1) 𝕩 ⋄ k↩1 ⋄ ≠𝕩 }
doFil←0
- sh ← s Noop◶{k×↩𝕨⋄𝕨}‿(⊣ UIk {𝕩⋄doFil↩1}_inds)¨ 𝕨
+ sh ← (r↑s) Noop◶{k×↩𝕨⋄𝕨}‿(⊣ UIk {𝕩⋄doFil↩1}_inds)¨ 𝕨
(0<=i)◶(s⊸⥊)‿{
sh ∾↩ t ← r↓s
{i 𝕩_c↩ ↕𝕩}⍟(1-1⊸=) k×´t
@@ -482,7 +480,7 @@ Windows←{
"𝕨↕𝕩: Length of 𝕨 must be at most rank of 𝕩" ! r≤=𝕩
"𝕨↕𝕩: 𝕨 must consist of natural numbers" ! ×´Nat⌜𝕨
s←≢𝕩
- l←s(1+-)¨𝕨
+ l←(r↑s)(1+-)¨𝕨
"𝕨↕𝕩: Window length 𝕨 must be at most axis length plus one" ! ×´0⊸≤⌜l
k←1×´t←r↓s
str ← Reverse ×`⟨k⟩∾s⊏˜{𝕩⊸-⌜↕𝕩}r-1