M01EAF rearranges a vector of real numbers into the order specified by a vector of ranks.
M01EAF is designed to be used typically in conjunction with the M01D ranking routines. After one of the M01D routines has been called to determine a vector of ranks, M01EAF can be called to rearrange a vector of real numbers into the rank order. If the vector of ranks has been generated in some other way, then
M01ZBF should be called to check its validity before M01EAF is called.
None.
If on entry
${\mathbf{IFAIL}}={\mathbf{0}}$ or
${-{\mathbf{1}}}$, explanatory error messages are output on the current error message unit (as defined by
X04AAF).
If
${\mathbf{IFAIL}}={\mathbf{2}}$ or
${\mathbf{3}}$, elements
M1 to
M2 of
IRANK do not contain a permutation of the integers
M1 to
M2. On exit, the contents of
RV may be corrupted. To check the validity of
IRANK without the risk of corrupting
RV, use
M01ZBF.
Not applicable.
Not applicable.
This example reads a matrix of real numbers and rearranges its rows so that the elements of the
$k$th column are in ascending order. To do this, the program first calls
M01DAF to rank the elements of the
$k$th column, and then calls M01EAF to rearrange each column into the order specified by the ranks. The value of
$k$ is read from the datafile.