diff options
| author | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-05 08:17:15 -0400 |
|---|---|---|
| committer | Marshall Lochbaum <mwlochbaum@gmail.com> | 2020-09-05 08:49:50 -0400 |
| commit | 78c26551d039c1cb07521c6601eb2b389a7d9644 (patch) | |
| tree | a2a17f3fb4b8986c4bcf077fb9a77259a4d9822a /src | |
| parent | eeac7dd581f7a575cead857ab576beaee2cf5355 (diff) | |
Extend depth-2 Group Indices to arbitrary-rank components
Diffstat (limited to 'src')
| -rw-r--r-- | src/r.bqn | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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 𝕩 |
