aboutsummaryrefslogtreecommitdiff
path: root/spec/primitive.md
diff options
context:
space:
mode:
authorMarshall Lochbaum <mwlochbaum@gmail.com>2021-02-14 21:18:37 -0500
committerMarshall Lochbaum <mwlochbaum@gmail.com>2021-02-14 21:18:37 -0500
commiteac71d728f7a83c52deddcc766ae1ad3f8e3ef23 (patch)
tree098fe0edc4e75d4584aaee242f33926c542b5776 /spec/primitive.md
parentb20aba3b36cfe161e762c85c98874c15d0b6985d (diff)
More detailed/correct description of Group
Diffstat (limited to 'spec/primitive.md')
-rw-r--r--spec/primitive.md2
1 files changed, 1 insertions, 1 deletions
diff --git a/spec/primitive.md b/spec/primitive.md
index ba7a7805..fca283d5 100644
--- a/spec/primitive.md
+++ b/spec/primitive.md
@@ -161,7 +161,7 @@ For **Select** (`โŠ`), `๐•จ` is an array of natural numbers, or a list of such
**First Cell** (`โŠ`) selects the initial major cell of `๐•ฉ`, giving an error if `๐•ฉ` has rank 0 or length 0.
-**Group** (`โŠ”`) performs an opposite operation to Select, so that `๐•จ` specifies not the argument index that result values come from, but the result index that argument values go to. The result rank is `โ‰ ๐•จ`, and each result element has rank `1+(=๐•ฉ)-+ยด=ยจ๐•จ`. The result element contains the minimal list of cells so that each cell of `๐•ฉ` appears in the corresponding element of `๐•จโŠ๐•จโŠ”๐•ฉ`, in index order. **Group Indices** treats its argument `๐•ฉ` as a left argument for Group and uses a right argument made up of indices, with the definition `โŠ”โŸœ(โ†•โ‰ โš‡1)`.
+**Group** (`โŠ”`) performs an opposite operation to Select, so that `๐•จ` specifies not the argument index that result values come from, but the result index that argument values go to. The general case is that `๐•จ` is a list of arrays of numbers; if it has depth less than 2 it's converted to this form by first enclosing it if it's an atom, then placing it in a length-1 list. After this transformation, the result rank is `โ‰ ๐•จ`, and each result element has rank `(โ‰ ๐•จ)+(=๐•ฉ)-+ยด=ยจ๐•จ`, with the initial `โ‰ ๐•จ` axes corresponding to elements of `๐•จ` and the remainder to trailing axes of `๐•ฉ`. Each atom in `๐•จ` can be either a natural number or `ยฏ1` (which indicates the corresponding position in `๐•ฉ` will be omitted). If `ยฏ1` doesn't appear, the result has the property that each cell of `๐•ฉ` appears in the corresponding element of `๐•จโŠ๐•จโŠ”๐•ฉ`. More concretely, the length of the result along axis `a` is the maximum value in `aโŠ‘๐•จ` plus one, or zero if `aโŠ‘๐•จ` is empty. Axis `a` corresponds to `=aโŠ‘๐•จ` axes in `๐•ฉ`, and an element of the result at position `i` along this axis contains all positions in `๐•ฉ` where `i=aโŠ‘๐•จ`. There may be multiple such positions, and they're arranged along axis `a` of that result element according to their index order in `๐•ฉ`. **Group Indices** treats its argument `๐•ฉ` as a left argument for Group and uses a right argument made up of indices, with the definition `โŠ”โŸœ(โ†•โ‰ โš‡1)`.
**Range** (`โ†•`) is extended to apply to a list of natural numbers, in addition to the provided case of a single natural number (an enclosed natural number `๐•ฉ` should still result in an error). For a list `๐•ฉ`, the result is an array of shape `๐•ฉ` in which the value at a given index is that index, as a list of natural numbers. That is, `iโ‰กiโŠ‘โ†•๐•ฉ` for any list of natural numbers `i` with `โˆงยดi<๐•ฉ`.