[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sort index ordering
From: |
Paul Kienzle |
Subject: |
sort index ordering |
Date: |
Sun, 7 May 2000 05:45:20 +0100 (BST) |
Hi! Does anyone know if sort is guaranteed to preserve relative index
order for identical sort values?
E.g.,
octave> [s,idx]=sort([1,2,3,1])
s =
1 1 2 3
idx =
1 4 2 3
^^^^^^^
The values in idx are increasing when the values in s are the same. It
is true for the cases I've checked, but I want to be sure that it is
true in all cases, and that this characteristic will be preserved even
if the sort algorithm is changed.
Paul Kienzle
address@hidden
-----------------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.che.wisc.edu/octave/octave.html
How to fund new projects: http://www.che.wisc.edu/octave/funding.html
Subscription information: http://www.che.wisc.edu/octave/archive.html
-----------------------------------------------------------------------
- sort index ordering,
Paul Kienzle <=