[Top][All Lists]

[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? 


        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

Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:
How to fund new projects:
Subscription information:

reply via email to

[Prev in Thread] Current Thread [Next in Thread]