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/pr.bqn | 2 +- src/r0.bqn | 2 ++ src/r1.bqn | 8 +++----- 3 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/pr.bqn b/src/pr.bqn index 560dd2b0..04b8a7fc 100755 --- a/src/pr.bqn +++ b/src/pr.bqn @@ -13,7 +13,7 @@ keep ← "!+-×÷⋆⌊=≤≢⥊⊑↕⌜`⊘⎊" chrext ← glyphs ∾¨ ((+´·∧`'_'=0‿¯1⊸⊏)¨def) ⊔ alias Typ ← chrext⊸((+`≠¨)∘⊣⍋∾⊸⊐) -in0‿out0 ← ⟨"∩⍝+-×⌊=≤≢⥊⊑↕⌜⊘", "⌊⌈|<>≠≥⊢⊣∾↑↓⊏˙˜´∘○⊸⟜◶⍟"⟩ +in0‿out0 ← ⟨"∩⍝+-×⌊=≤≢⥊⊑↕⌜⊘", "⌊⌈|<>≠≥⊢⊣∾↑↓⊏˙˜¨´∘○⊸⟜◶⍟"⟩ in2 ← alias∾keep out2 ← ∾glyphs in‿out ← rtt ⊑ ⟨in0,out0⟩‿⟨⍷in2∾out0,out2⟩‿⟨in2,out2⟩ diff --git a/src/r0.bqn b/src/r0.bqn index 8347f8bf..a7b7f4c4 100644 --- a/src/r0.bqn +++ b/src/r0.bqn @@ -30,6 +30,8 @@ Box ← {𝕩Fill⟨⟩⥊⟨𝕩⟩} ↑ ← {⊑⟜𝕩⌜↕𝕨} # LIMITED to number 𝕨 and list 𝕩 ↓ ← {(𝕨⊸+⊑𝕩˙)⌜↕(≠𝕩)-𝕨} # LIMITED to number 𝕨 and list 𝕩 +¨ ← { d←⥊𝕩⋄(≢𝕩)⥊(⊑⟜(⥊𝕨)𝔽⊑⟜d)⌜↕≠d } # LIMITED to equal-shape arrays + _fold0←{ l←≠𝕩 ⋄ F←𝔽 r←𝕨 {l↩l-1⋄l⊑𝕩}⊘⊣ 𝕩 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