aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-06-21 11:02:37 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-06-21 11:02:37 -0400
commit514c12c131780119536a39dbee4d12517b5d5c5f (patch)
treee15e950fadf32f408377bbc6af6307c7871cb6a4 /src
parent57b40621a807f089cbc08c51005b9f0b70377ba3 (diff)
Use recursive doubling with ∾ for Reshape
Diffstat (limited to 'src')
-rw-r--r--src/r1.bqn4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/r1.bqn b/src/r1.bqn
index 7ae64e3a..f4a17a28 100644
--- a/src/r1.bqn
+++ b/src/r1.bqn
@@ -616,8 +616,8 @@ Reshape←{
s↩p⊣◶⊢‿a¨s
{d∾↩(Fill d)⌜↕𝕩-n⋄n}⍟(n⊸<)⍟(3=t)lp×a
} s
- s⥊{
- 𝕩(0<n)◶⟨<∘Fill⊸(⊣⌜)⋄{i←¯1⋄m←n-1⋄{𝕩⋄(i+↩1-n×i=m)⊑d}⌜𝕩}⟩↕l
+ s⥊(0<n)◶{(<Fill𝕩)⊣⌜↕l}‿{
+ l >⟜≠◶⟨↑, ⊣(⊢∾-⟜≠↑⊢)÷⟜2⊸{𝕨𝕊⟜(∾˜)⍟(>⟜≠)𝕩}⟩ 𝕩
}_fillBy_⊢⍟(1-l=n)d
}