Skip to content

Commit 817ee30

Browse files
committed
add comment that arg_sort is not a stable sort
1 parent 4b0d880 commit 817ee30

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

doc/specs/stdlib_selection.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,9 @@ search.
187187

188188
`arg_select` does not modify `array`, unlike `select`.
189189

190+
The partial sorting of `indx` is not stable, i.e., indices that map to equal
191+
values of array may be reordered.
192+
190193
While it is essential that that `indx` contains a permutation of the integers `1:size(array)`,
191194
the code does not check for this. For example if `size(array) == 4`, then we could have
192195
`indx = [4, 2, 1, 3]` or `indx = [1, 2, 3, 4]`, but not `indx = [2, 1, 2, 4]`. It is the user's

0 commit comments

Comments
 (0)