aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-08-01 22:16:42 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-08-02 10:45:50 -0400
commit69dfc9072dea38f5bfb0cd1587599de8b8bb209f (patch)
tree62cb3dcaae82fddac0996ff139202e3640c4b91c
parent53671f739683445730cbd8bef8893ed31a685ac9 (diff)
Fixes in impl.bqn
-rw-r--r--impl.bqn9
1 files changed, 5 insertions, 4 deletions
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/𝕩