Forms the inverse of a permutation

This routine inverts a
permutation in place. It can be used to transform an index vector (from a sort) into a rank vector and
vice versa.

CALL PDA_IPERM( N, X )

Number of
elements.

The permutation. On exit this contains the inverse.

The permutation must consist of positive integers. The permutation inverse Y(X(I))=I for
I=1,N can be formed trivially with 2*N arrays.

The Art of Computer Programming,
Fundamental Algorithms Vol 1, by Donald E. Knuth (Addison-Wesley).

Proportional to N.