Rank items (1-based) with SciPy-like tie handling.
Replicates scipy.stats.rankdata(a, method=..., nan_policy=...), flattened/1D semantics. Tie methods:
- average: average of ranks for ties
- min: minimum rank for ties (aka "competition")
- max: maximum rank for ties
- dense: like "min" but next unique value increases rank by 1
- ordinal: break ties by original order (stable), all ranks distinct
NaN handling:
- propagate: if any NaN in input, every output is NaN (matches SciPy 1.16.2 docs)
- omit: ignore NaNs when ranking; NaN positions in output remain NaN
- raise: throw std::invalid_argument if any NaN is present
Ranks start at 1, matching SciPy.
- Template Parameters
-
| T | Numeric type (float/double/integers supported; integers are internally promoted). |