void rank(double* first, double* last, double* irank, RankType type)
Ranks 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.
Parameters:
first | Beginning iterator for the container of elements. |
---|---|
last | Ending iterator for the container of elements. |
irank | Beginning iterator of the ranks container. |
type | Type of ranking to use. |
Returns:
On return, the elements of [first, last) are replaced with thier ranks.
Usage:
double x[] = {2.0, 1.0, 3.0, 5.0, 4.0, 5.0}; double y[6]; rank(x, x + 6, y, RANK_LOW);
Header:
#include "ranking.h"
See Also:
RankType