From cebaf4fa85cd1a91c0324933bde4d4e986307016 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 29 Apr 2021 18:55:47 -0400 Subject: =?UTF-8?q?Move=20limited=20=C2=A8=20from=20r1=20to=20r0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/r1.bqn | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/r1.bqn') 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 -- cgit v1.2.3