From 5c2e7dcc6883f121088b1e6556698a02c4668749 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Fri, 3 Jun 2022 16:36:34 -0400 Subject: =?UTF-8?q?Allow=20=E2=8A=8F=20to=20handle=20trailing=20unchanged?= =?UTF-8?q?=20axes=20in=20dyadic=20=E2=8D=89,=20speeding=20up=20cases=20wi?= =?UTF-8?q?th=20large=20cells?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/r1.bqn | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/r1.bqn b/src/r1.bqn index 73050a70..2bd1aa72 100644 --- a/src/r1.bqn +++ b/src/r1.bqn @@ -239,9 +239,10 @@ _reorderAxesSub_←{ "𝕨⍉𝕩: Length of 𝕨 must not exceed rank of 𝕩" ! (≠𝕨)≤r←=𝕩 "𝕨⍉𝕩: 𝕨 must consist of valid axis indices" ! 1∧´(Nat∧<⟜r)⌜𝕨 r𝔽↩n←GroupLen𝕨 - a←𝔾 𝕨∾(/0⊸=⌜n)∾{𝕩⊸+⌜↕r-𝕩}≠n - l‿s←a⊸Group1⌜⋈⟜Stride≢𝕩 - (⌊´⌜l) (0<≠∘⊢)◶⟨⥊,((<0)+⌜´s(<+´)⊸(×⌜)⟜↕¨⊣)⊸⊏⟜⥊⟩ _fillBy_ ⊢ 𝕩 + k←≠a←𝔾 𝕨∾/0⊸=⌜n + c‿d←k(↑⋈↓)≢𝕩 + l‿s←a⊸Group1⌜⋈⟜Stride c + (⌊´⌜l) (0<≠∘⊢)◶⟨∾⟜d⊸⥊,((<0)+⌜´s(<+´)⊸(×⌜)⟜↕¨⊣)⊏(⟨1×´c⟩∾d)⥊⊢⟩ ⥊𝕩 } HandleDupAxes←{ r←𝕨-0+´(0⌈-⟜1)⌜𝕩 -- cgit v1.2.3