aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-05 08:17:15 -0400
committerMarshall Lochbaum <mwlochbaum@gmail.com>2020-09-05 08:49:50 -0400
commit78c26551d039c1cb07521c6601eb2b389a7d9644 (patch)
treea2a17f3fb4b8986c4bcf077fb9a77259a4d9822a /src
parenteeac7dd581f7a575cead857ab576beaee2cf5355 (diff)
Extend depth-2 Group Indices to arbitrary-rank components
Diffstat (limited to 'src')
-rw-r--r--src/r.bqn5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/r.bqn b/src/r.bqn
index 89e18a5f..de6ea148 100644
--- a/src/r.bqn
+++ b/src/r.bqn
@@ -331,16 +331,15 @@ Join←(1≠=)◶⟨∨´1≠=⌜,1⟩◶{
}⍟(0<≠∘⥊)
_group←{
- "Grouping argument must be a list" ! 1==𝕩
"Grouping argument must consist of integers" ! ∧´Int⌜𝕩
"Grouping argument values cannot be less than ¯1" ! ∧´¯1≤𝕩
d←(l←GroupLen𝕩)GroupOrd𝕩
i←0⋄(𝔽{𝕩⋄(i↩i+1)⊢i⊑d}⌜∘↕)⌜l
}
GroupInds←{
- "Group Indices argument must be an array" ! IsArray 𝕩
+ "Group Indices argument must be a list" ! 1==𝕩
G←⊢_group
- (1<≡)◶G‿((<<⟨⟩)⥊⊸∾⌜⌜´G⌜)𝕩
+ (1<≡)◶⟨G , (<<⟨⟩) ∾⌜⌜´ {⊏⟜(⥊↕≢𝕩)⌜ G⥊𝕩}⌜⟩ 𝕩
}
GroupGen←{
"Group right argument must be an array" ! IsArray 𝕩