From 3bcc47c9ac409ab5ed9c9c0eb4ad2ad15bf01d52 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 29 Apr 2021 20:08:16 -0400 Subject: =?UTF-8?q?Fix=20some=20fill=20issues=20in=20=E2=8E=89/=E2=9A=87,?= =?UTF-8?q?=20and=20special=20=CB=98=20implementation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/r1.bqn | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) (limited to 'src') diff --git a/src/r1.bqn b/src/r1.bqn index 9351c986..afc31ddc 100644 --- a/src/r1.bqn +++ b/src/r1.bqn @@ -261,6 +261,8 @@ IsPure ← {d←Decompose𝕩 ⋄ 2⊸≤◶⟨≤⟜0, 1×´·𝕊⌜1↓d˙⟩ _fillByPure_←{ 𝕘 (3≤Type∘⊣)◶⟨{𝕨Fill𝕏},{(𝕨HomFil𝕩)_fillBy_𝕨}⍟(IsPure⊣)⟩ 𝕗 } +_each ← {𝕨𝔽⌜⊘(𝔽_eachd)_fillByPure_𝔽○ToArray𝕩} +_table ← {𝕨𝔽⌜_fillByPure_𝔽○ToArray𝕩} StructErr←{𝕩} IsStructErr ← (3=Type)◶⟨0,StructErr˙⊸=⟩ @@ -488,7 +490,17 @@ Windows←{ }_fillBy_⊢⍟(0n←𝕨𝔾_ranks𝕩 ⋄ F←𝔽 _d←{ R←(𝕗+neg)_d - 𝕨(×⟜2⊸+´2 Reshape (neg∧𝕗≥0)∨(0⌈𝕗)≥Pair○≡)◶⟨R¨⋄R⟜𝕩⌜∘⊣⋄(𝕨R⊢)⌜∘⊢⋄F⟩𝕩 + 𝕨(×⟜2⊸+´2 Reshape (neg∧𝕗≥0)∨(0⌈𝕗)≥Pair○≡)◶⟨ + R _each, R⟜𝕩_table∘⊣, (𝕨R⊢)_table∘⊢, F + ⟩𝕩 } 𝕨 n _d 𝕩 } _rankOp_←{ k←𝕨(Pair○= (0≤⊢)◶⟨⌊⟜-,0⌈-⟩¨ 𝔾_ranks)𝕩 - Enc←{ - f←(↕𝕨)⊏≢𝕩 - c←1×´s←𝕨Cell𝕩⋄i←s⥊↕c - (f⥊((⥊𝕩)⊏˜i+c×⊢)⌜↕1×´f)˙_fillBy_{(<𝕩)⌜i} 𝕩 - } - Enc↩(>⟜0×1+≥⟜=)◶⟨<⊢,Enc,<⌜⊢⟩ - > ((0⊑k)Enc𝕨) 𝔽¨ ((1-˜≠)⊸⊑k)Enc𝕩 + Enc←(>⟜0×1+≥⟜=)◶⟨<⊢,EncCell,<_table⊢⟩ + > ((0⊑k)Enc𝕨) 𝔽_each ((1-˜≠)⊸⊑k)Enc𝕩 } +¨ ↩ _each ↑ ↩ Prefixes ⊘ Take ↓ ↩ Suffixes ⊘ Drop @@ -796,7 +805,7 @@ SwapInverse ← INF _lookup_ ⟨ '∨', (¬√∘¬)⊘(-˜÷1-⊣) '¬', IA∘0⊘(+-1˙) ⟩ -⌜ ↩ {𝕨𝔽⌜_fillByPure_𝔽○ToArray𝕩} +⌜ ↩ _table Mod1Inverse ← INF˙ _lookup_ ⟨ '˜', SwapInverse '¨', {𝕏⁼¨ ⊣·IX 0<≡∘⊢} -- cgit v1.2.3