Skip to content
Snippets Groups Projects
Commit a28aed19 authored by Thomas Purcell's avatar Thomas Purcell
Browse files

USe size_type not int

parent f82285c8
No related branches found
No related tags found
No related merge requests found
...@@ -746,8 +746,8 @@ void rank(const double* a, double* rank, int* index, const size_type size) ...@@ -746,8 +746,8 @@ void rank(const double* a, double* rank, int* index, const size_type size)
{ {
std::iota(index, index + size, 0); std::iota(index, index + size, 0);
std::sort(index, index + size, [a](int i1, int i2) { return a[i1] < a[i2]; }); std::sort(index, index + size, [a](int i1, int i2) { return a[i1] < a[i2]; });
int ii = 1; size_type ii = 1;
int ii_start = 0; size_type ii_start = 0;
while (ii_start < size) while (ii_start < size)
{ {
while ((ii < size) && (std::abs(a[index[ii]] - a[index[ii - 1]]) < while ((ii < size) && (std::abs(a[index[ii]] - a[index[ii - 1]]) <
...@@ -756,7 +756,7 @@ void rank(const double* a, double* rank, int* index, const size_type size) ...@@ -756,7 +756,7 @@ void rank(const double* a, double* rank, int* index, const size_type size)
++ii; ++ii;
} }
for (int jj = ii_start; jj < ii; ++jj) for (size_type jj = ii_start; jj < ii; ++jj)
{ {
rank[index[jj]] = static_cast<double>(ii + ii_start - 1) / 2.0 + 1.0; rank[index[jj]] = static_cast<double>(ii + ii_start - 1) / 2.0 + 1.0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment