arank

void arank(double* first, double* last, double* irank, RankType type)

Ranks the absolute values of the elements in [first, last) by returning the table of ranks in [irank, irank + (last - first)). The input elements of [first, last) are not changed. The parameter ties determines the method used to assign ranks to tied values as described above.

Parameters:
firstBeginning iterator for the container of elements.
lastEnding iterator for the container of elements.
irankBeginning iterator of the ranks container.
typeType of ranking to use.

Returns:
On return, the elements of [first, last) are replaced with thier absolute ranks.

Usage:

double x[] = {2.0, 1.0, 3.0, 5.0, 4.0, 5.0};
double y[6];
arank(x, x + 6, y);

Header:
#include "ranking.h"

See Also:
RankType