reorders an array (in place) using an permutation vector. This is most likely the output from one of the
sorting routines PDA_QSI[A|D][x]
CALL PDA_RINP[x]( PERM, N, X, IFAIL )
PERM( N ) = INTEGER (Given and Returned)
The index vector. Note this is modified
but should be returned in the same state as when input. Indices may not be negative.
N = INTEGER
Number of elements.
X( N ) = ? (Given and Returned)
The array to reorder.
Status flag. Set 0 for success, otherwise the permutation isn’t correct.
Re-ordering is trivial if two arrays are available.
DO I = 1, N
XX( I ) = X( PERM( I )
The XX array contains the sorted values on completion.
There is a routine for each of the data types integer, real and double precision; replace [x] in the
routine name by I, R or D as appropriate. The data type of the X argument should match the routine
Proportional to N.