Ranking based on the natural ordering on doubles.
NaNs are treated according to the configured {@link NaNStrategy} and tiesare handled using the selected {@link TiesStrategy}. Configuration settings are supplied in optional constructor arguments. Defaults are {@link NaNStrategy#FAILED} and {@link TiesStrategy#AVERAGE}, respectively. When using {@link TiesStrategy#RANDOM}, a {@link RandomGenerator} may be supplied as a constructor argument.
Examples:
Input data: (20, 17, 30, 42.3, 17, 50, Double.NaN, Double.NEGATIVE_INFINITY, 17) | ||
---|---|---|
NaNStrategy | TiesStrategy | rank(data) |
default (NaNs maximal) | default (ties averaged) | (5, 3, 6, 7, 3, 8, 9, 1, 3) |
default (NaNs maximal) | MINIMUM | (5, 2, 6, 7, 2, 8, 9, 1, 2) |
MINIMAL | default (ties averaged) | (6, 4, 7, 8, 4, 9, 1.5, 1.5, 4) |
REMOVED | SEQUENTIAL | (5, 2, 6, 7, 3, 8, 1, 4) |
MINIMAL | MAXIMUM | (6, 5, 7, 8, 5, 9, 2, 2, 5) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|