From 69dfc9072dea38f5bfb0cd1587599de8b8bb209f Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Sat, 1 Aug 2020 22:16:42 -0400 Subject: Fixes in impl.bqn --- impl.bqn | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'impl.bqn') diff --git a/impl.bqn b/impl.bqn index a5889def..1401e115 100644 --- a/impl.bqn +++ b/impl.bqn @@ -43,6 +43,7 @@ _eachd←{ (>○=)◶⟨𝔽_e⋄𝔽˜_e˜⟩ } +⌜ ↩ {𝔽⌜○ToArray} ¨ ↩ {(𝔽⌜)⊘(𝔽_eachd○ToArray)} _perv←{ # Pervasion @@ -80,7 +81,7 @@ Nat←IsArray◶⟨0⊸≤∧⌊⊸=,0⟩ Deshape←IsArray◶{⟨𝕩⟩}‿⥊ Reshape←{ ! 1≥=𝕨 - 𝕨↩⥊𝕨 + 𝕨↩Deshape 𝕨 ! ∧´Nat¨𝕨 l←×´𝕨 n←×´≢𝕩 @@ -121,7 +122,7 @@ Cell ← DropV⟜≢ Pair ← {⟨𝕩⟩} ⊘ {⟨𝕨,𝕩⟩} Merge←{ - c←≢⊑𝕩 + c←≢0⊑⥊𝕩 ! ∧´⥊(c≡≢)¨𝕩 𝕩⊑⟜⥊˜⌜c⥊↕×´c }⍟(0<≠∘⥊) @@ -132,7 +133,7 @@ _depthOp_←{ neg←0>n←𝕨𝔾_ranks𝕩 ⋄ F←𝔽 _d←{ R←(𝕗+neg)_d - 𝕨(2⥊(neg∧𝕗≥0)∨(0⌈𝕗)≥Pair○≡)◶(⟨R¨⋄R⟜𝕩¨∘⊣⟩≍⟨(𝕨R⊢)¨∘⊢⋄F⟩)𝕩 + 𝕨(×⟜2⊸+´2⥊(neg∧𝕗≥0)∨(0⌈𝕗)≥Pair○≡)◶(⟨R¨⋄R⟜𝕩¨∘⊣⋄(𝕨R⊢)¨∘⊢⋄F⟩)𝕩 } 𝕨 n _d 𝕩 } @@ -263,7 +264,7 @@ Join←{ d←≠0⊑⥊s ! ∧´⥊d=≠¨s ! d≥=𝕩 - l←(≢𝕩){(𝕩⊑⟜≢a⊑˜(j=𝕩)⊸×)¨↕𝕨}¨j←↕r←=a←𝕩 + l←(≢𝕩){(𝕩⊑⟜≢a Pick1˜(j=𝕩)⊸×)¨↕𝕨}¨j←↕r←=a←𝕩 ! (r↑¨s)≡C l i←C{p←+´¨↑𝕩⋄(↕0⊑⌽p)-𝕩/¯1↓p}¨l >i<¨⊸⊏¨l/𝕩 -- cgit v1.2.3