69 const int n =
static_cast<int>(pValues.size());
72 std::vector<std::pair<double, int>> indexed(n);
73 for (
int i = 0; i < n; ++i) {
74 indexed[i] = {pValues.data()[i], i};
78 std::sort(indexed.begin(), indexed.end());
81 std::vector<double> adjusted(n);
82 for (
int i = 0; i < n; ++i) {
83 adjusted[i] = indexed[i].first *
static_cast<double>(n - i);
87 for (
int i = 1; i < n; ++i) {
88 adjusted[i] = std::max(adjusted[i], adjusted[i - 1]);
92 MatrixXd corrected(pValues.rows(), pValues.cols());
93 for (
int i = 0; i < n; ++i) {
94 corrected.data()[indexed[i].second] = std::min(adjusted[i], 1.0);
106 const int n =
static_cast<int>(pValues.size());
109 std::vector<std::pair<double, int>> indexed(n);
110 for (
int i = 0; i < n; ++i) {
111 indexed[i] = {pValues.data()[i], i};
115 std::sort(indexed.begin(), indexed.end());
118 std::vector<double> adjusted(n);
119 for (
int i = 0; i < n; ++i) {
121 adjusted[i] = indexed[i].first *
static_cast<double>(n) /
static_cast<double>(rank);
125 for (
int i = n - 2; i >= 0; --i) {
126 adjusted[i] = std::min(adjusted[i], adjusted[i + 1]);
130 MatrixXd corrected(pValues.rows(), pValues.cols());
131 for (
int i = 0; i < n; ++i) {
132 corrected.data()[indexed[i].second] = std::min(adjusted[i], 1.0);