Skip to content

Commit b45441b

Browse files
committed
Added changes suggested by gareth-nx.
Added changes in the description of `SORT_INDEX`. [ticket: X]
1 parent a0a5d0c commit b45441b

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

doc/specs/stdlib_sorting.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,10 @@ data:
4444
* `ORD_SORT` is intended to sort simple arrays of intrinsic data
4545
that have significant sections that were partially ordered before
4646
the sort;
47-
* `SORT_INDEX` is intended to provide indices for sorting arrays of
48-
derived type data, based on the ordering of an intrinsic component
49-
of the derived type; and
47+
* `SORT_INDEX` is based on ORD_SORT, but in addition to sorting the
48+
input array, it returns indices that map the original array to its
49+
sorted version. This enables related arrays to be re-ordered in the
50+
same way; and
5051
* `SORT` is intended to sort simple arrays of intrinsic data
5152
that are effectively unordered before the sort.
5253

@@ -142,7 +143,8 @@ arrays, or arrays of derived types. For such related data, what is
142143
useful is an array of indices that maps a rank 1 array to its sorted
143144
form. For such a sort, a stable sort is useful, therefore the module
144145
provides a subroutine, `SORT_INDEX`, that generates such an array of
145-
indices based on the `ORD_SORT` algorithm.
146+
indices based on the `ORD_SORT` algorithm, in addition to sorting
147+
the input array.
146148

147149
The logic of `SORT_INDEX` parallels that of `ORD_SORT`, with
148150
additional housekeeping to keep the array of indices consistent with

0 commit comments

Comments
 (0)