diff options
Diffstat (limited to 'impl.bqn')
| -rw-r--r-- | impl.bqn | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -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/𝕩 |
