aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-18 22:12:28 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-01-18 22:12:28 -0500
commit610f7013ef1ec53938c81fd4eef05b7e594f893f (patch)
tree77a5629a0907729cad35957b7e63760026ba22f9 /src
parent7eaaa5874b4e84d3b2ca3d10d3ede870d7f5ed69 (diff)
Fix some high rank issues and improve error messages in Progressive Index Of
Diffstat (limited to 'src')
-rw-r--r--src/r.bqn7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/r.bqn b/src/r.bqn
index e86bbea3..d1eb4471 100644
--- a/src/r.bqn
+++ b/src/r.bqn
@@ -656,7 +656,12 @@ ReorderAxesInv←{
⍉ ← Transpose ⊘ ReorderAxes
OccurrenceCount ← ⊐˜(⊢-⊏)⍋∘⍋
-ProgressiveIndexOf ← {𝕨⊐○((≠∾2˙)⥊·≍˘⟜OccurrenceCount𝕨⊸⊐)𝕩}
+ProgressiveIndexOf ← {
+ c←1-˜=𝕨
+ "⊒: Rank of 𝕨 must be at least 1" ! 0≤c
+ "⊒: Rank of 𝕩 must be at least cell rank of 𝕨" ! c≤=𝕩
+ 𝕨⊐○(((≢∾2˙)⥊≍˘⟜OccurrenceCount∘⥊) 𝕨⊸⊐)𝕩
+}
⊏ ← FirstCell ⊘ (ToArray⊸(SelSub _onAxes_ 1))
⊑ ↩ First ⊘ Pick