diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-02 20:09:40 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-02 21:28:25 -0400 |
| commit | f28b37aa309ae88efb2cedda228af3ca8ce114a0 (patch) | |
| tree | ed3e6792b2ad57592f742a5bc56c4f6fc740b244 /spec | |
| parent | 7828a13806046e2ec25ba1d19e4c5ce4df579fc0 (diff) | |
Update reference Reshape
Diffstat (limited to 'spec')
| -rw-r--r-- | spec/reference.bqn | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/spec/reference.bqn b/spec/reference.bqn index 57245ac6..08ead65a 100644 --- a/spec/reference.bqn +++ b/spec/reference.bqn @@ -130,12 +130,22 @@ Nat←IsArray◶⟨0⊸≤∧⌊⊸=,0⟩ Deshape←IsArray◶{⟨𝕩⟩}‿⥊ Reshape←{ ! 1≥=𝕨 - 𝕨↩⥊𝕨 - ! ∧´Nat¨𝕨 - n←≠𝕩 ⋄ l←×´𝕨 - ! n≤○(0⊸=)l - 𝕨⥊⊑⟜𝕩¨n|↕l -}⟜Deshape + s←Deshape 𝕨 + sp←+´p←¬Nat⌜s + ! 1≥sp + n←≠d←Deshape 𝕩 + l←sp◶(×´)‿{ + lp←×´p⊣◶⊢‿1¨𝕩 + ! 0<lp + I←+´↕∘≠⊸× + t←I e←⟨∘,⌊,⌽,↑⟩=(I p)⊑s + ! +´e + a←(2⌊t)◶⟨{!Nat𝕩⋄𝕩},⌊,⌈⟩n÷lp + s↩p⊣◶⊢‿a¨s + {d∾↩(Type d)⌜↕𝕩-n⋄n↩𝕩}⍟(n⊸<)⍟(3=t)lp×a + } s + s⥊d(n<○(0⊸<)l)◶⟨Type⊸(⊣¨)⋄{⊑⟜𝕨¨n|𝕩}⟩↕l +} Range←{ I←{!Nat𝕩⋄↕𝕩} |
