aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-05-01 13:09:43 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-05-01 13:09:43 -0400
commit9c71729997443b38d7dc92b772afeab25af3edce (patch)
tree4516d78aec1ea0340832b26d01c2ec3dd2150e6f /src
parent86b69992eaeec3622b914990ddecf432b227f87f (diff)
Fix simple-array test for dyadic ⍋
Diffstat (limited to 'src')
-rw-r--r--src/r1.bqn6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/r1.bqn b/src/r1.bqn
index 30c4e410..f31c03c7 100644
--- a/src/r1.bqn
+++ b/src/r1.bqn
@@ -116,7 +116,7 @@ _grade ← {
gt ← 𝕗
cmps ← {𝕏˜}⌜⍟𝕗⟨Cmp,Cmp0,Cmp≤0˙,≤⟩
_getC_ ← { 𝕨 𝕘{(𝕨 𝕏 _getCellCmp 𝕗)≤0˙}⍟(𝕩≤1) 𝔽 𝕩⊑cmps }
- AllNum ← 0=1+´(1=Type)⌜
+ IsSimple ← 1×´(0<Type)⌜
0 Fill {
"⍋𝕩: 𝕩 must have rank at least 1" ! 1≤=𝕩
l←≠𝕩
@@ -146,13 +146,13 @@ _grade ← {
c←1-˜=𝕨
"⍋ or ⍒: Rank of 𝕨 must be at least 1" ! 0≤c
"⍋ or ⍒: Rank of 𝕩 must be at least cell rank of 𝕨" ! c≤=𝕩
- lw←1×´sw←1 Cell 𝕨 ⋄ nw←≠𝕨 ⋄ 𝕨↩⥊𝕨 ⋄ Gw←⊑⟜𝕨 ⋄ a0w←AllNum𝕨
+ lw←1×´sw←1 Cell 𝕨 ⋄ nw←≠𝕨 ⋄ 𝕨↩⥊𝕨 ⋄ Gw←⊑⟜𝕨 ⋄ a0w←IsSimple𝕨
lew←{𝕏○Gw} _getC_ lw a0w+2×1=lw
"⍋ or ⍒: 𝕨 must be sorted" ! 0⊸<◶⟨1,1×´·LEw⟜(lw⊸+)∘(lw⊸×)⌜↕∘-⟜1⟩nw
𝕩↩ToArray𝕩
cx←c-˜=𝕩
sx←cx Cell 𝕩 ⋄ sz←cx↑≢𝕩 ⋄ 𝕩↩⥊𝕩 ⋄ Gx←⊑⟜𝕩
- a0←AllNum∘𝕩⊸×⍟⊢a0w
+ a0←IsSimple∘𝕩⊸×⍟⊢a0w
cd‿lc←sw CmpLen sx
le ← cd {GW⊸𝕏⟜GX}_getC_ lc a0+2×1=lc
B←(1×´sw)⊸×⊸LE