Ordering
The permutation of indices that would sort the collection into increasing order.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
Ordering✓Ordering(collection)the permutation of indices that sorts the collection into increasing order.Ordering(collection, n)just the first n indices of the full ordering; a negative n takes the last |n| (the largest elements); {m, n} takes positions m through n of the full ordering; UpTo(n) caps at n without erroring on a shorter collection.Ordering(collection, All, Greater)every index, ordered descending rather than ascending.Typed signatures
| Type | Package | Applies |
|---|---|---|
(indexed_collection<T>, order: (((T) any -> unknown) | ((any, any) any -> boolean | number))?) -> list<integer> where T: any | compute-engine | always |
(indexed_collection<any>, any?, any?) -> list<integer> | combinatoricsreplaces compute-engine | always |
Details
- : applying the permutation at those positions recovers Sort's result.
- Ties break in favor of earlier position, i.e. it's a stable ordering.
- Symbols order alphabetically by name, matching Wolfram's canonical ordering.
- A second argument takes just the first indices of the full ordering; see the signatures above for the negative-count, , and forms.
Examples
Scope #
Applications #
Properties #
About
| Examples | 13 |
|---|---|
| Checked against | Wolfram Language 13 agree |
| Crosswalk | Wolfram Language |