PDA_RINPx

Reorder an array in place using a permutation index

Description:

This routine 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]

Invocation

CALL PDA_RINP[x]( PERM, N, X, IFAIL )

Arguments

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 (Given)
Number of elements.
X( N ) = ? (Given and Returned)
The array to reorder.
IFAIL = INTEGER (Returned)
Status flag. Set 0 for success, otherwise the permutation isn’t correct.

Notes:

Timing

Proportional to N.