From dac3a40a2a06aa0b5dbe2d17b217b2d1007a707d Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Thu, 31 Dec 2020 21:59:48 -0500 Subject: =?UTF-8?q?Use=20shaped=20identities=20for=20arithmetic=20Insert?= =?UTF-8?q?=20and=20support=20=E2=88=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/r.bqn | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/r.bqn b/src/r.bqn index 6c3678ed..305d7447 100644 --- a/src/r.bqn +++ b/src/r.bqn @@ -394,7 +394,9 @@ _rankOp_←{ } _insert←{ "˝: 𝕩 must have rank at least 1" ! 1≤=𝕩 - 𝕨 𝔽´ <˘𝕩 + F←𝔽 + Id ← {s←1 Drop ≢𝕩 ⋄ s joinPrim˙⊸≠◶⟨(0<↕∘≠)⊸×⊸⥊⟜⟨⟩, Reshape⟜Identity⟩ f} + 𝕨 (0<≠)⊘1◶Id‿{𝕨F´<˘𝕩} 𝕩 } ˝ ← _insert @@ -588,6 +590,7 @@ _repeat_←{ } ReshapeT ← ⟨∘,⌊,⌽,↑⟩⊑∘⊐< +JoinPrim ← ∾ ⍟ ↩ _repeat_ ⥊ ↩ Deshape ⊘ Reshape -- cgit v1.2.3