Feature Request: Get sorted list of indices of an array
The problem: Consider the following floats:
data[x] = 1.7 -0.3 2.1 0.5
What I want is an array of int that represents the order of the original array with indices.
ind[x] = 1 3 0 2
data[ind[x]] = -0.3 0.5 1.7 2.1
To my knowledge there is no way to do that easily with Java, which is a pity, since it is not much different from the usual sort(). All solutions I know of require either an excessive amount of boxing/unboxing, or a custom implementation of sort().
That would be a great addition to the class library.