55 const int n =
static_cast<int>(pValues.size());
58 std::vector<std::pair<double, int>> indexed(n);
59 for (
int i = 0; i < n; ++i) {
60 indexed[i] = {pValues.data()[i], i};
64 std::sort(indexed.begin(), indexed.end());
67 std::vector<double> adjusted(n);
68 for (
int i = 0; i < n; ++i) {
69 adjusted[i] = indexed[i].first *
static_cast<double>(n - i);
73 for (
int i = 1; i < n; ++i) {
74 adjusted[i] = std::max(adjusted[i], adjusted[i - 1]);
78 MatrixXd corrected(pValues.rows(), pValues.cols());
79 for (
int i = 0; i < n; ++i) {
80 corrected.data()[indexed[i].second] = std::min(adjusted[i], 1.0);
92 const int n =
static_cast<int>(pValues.size());
95 std::vector<std::pair<double, int>> indexed(n);
96 for (
int i = 0; i < n; ++i) {
97 indexed[i] = {pValues.data()[i], i};
101 std::sort(indexed.begin(), indexed.end());
104 std::vector<double> adjusted(n);
105 for (
int i = 0; i < n; ++i) {
107 adjusted[i] = indexed[i].first *
static_cast<double>(n) /
static_cast<double>(rank);
111 for (
int i = n - 2; i >= 0; --i) {
112 adjusted[i] = std::min(adjusted[i], adjusted[i + 1]);
116 MatrixXd corrected(pValues.rows(), pValues.cols());
117 for (
int i = 0; i < n; ++i) {
118 corrected.data()[indexed[i].second] = std::min(adjusted[i], 1.0);