From 610f7013ef1ec53938c81fd4eef05b7e594f893f Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 18 Jan 2021 22:12:28 -0500 Subject: Fix some high rank issues and improve error messages in Progressive Index Of --- src/r.bqn | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3