msort
|
msort(x1, x2, x3, ...)
returns an index list which sorts the array X1 into increasing
order. Where X1 values are equal, the list will sort X2 into
increasing order. Where both X1 and X2 are equal, X3 will be
in increasing order, and so on. Finally, where all of the keys
are equal, the returned list will leave the order unchanged
from the input keys.
The Xi may be numbers or strings (e.g.- X1 could be an integer
while X2 was a string, and X3 was a real). The Xi must all be
conformable, and each dimension of X1 must be as large as the
corresponding dimension of any otehr Xi.
Hence, msort(x) will return the same list as sort(x), except
where the values of x are equal, in which case msort leaves
the order unchanged, while sort non-deterministically permutes
equal elements. This feature may cost a factor of two in speed,
so don't use it unless you really need it. In general, msort
will call sort up to twice per input argument.
interpreted function, defined at i/msort.i line 10
|