Next: PDA_RNEXP - Returns pseudo-random numbers from an exponential distribution
Up: User-callable routines
Previous: PDA_RFFTI - Initialize PDA_RFFTF and PDA_RFFTB.
PDA_RINP[x]
- 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:
- Re-ordering is trivial if two arrays are available.
- DO I = 1, N
XX( I ) = X( PERM( I ) )
END DO
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 being used.
-
Timing
- Proportional to N.
Next: PDA_RNEXP - Returns pseudo-random numbers from an exponential distribution
Up: User-callable routines
Previous: PDA_RFFTI - Initialize PDA_RFFTF and PDA_RFFTB.
PDA [1ex
Starlink User Note 194
H. Meyerdierks, D. Berry, P. W. Draper, G. Privett, M. Currie
12th October 2005
E-mail:ussc@star.rl.ac.uk
Copyright © 2011 Science and Technology Facilities Council