Skip to content
Snippets Groups Projects
Commit b55f4d38 authored by Mark Jenkinson's avatar Mark Jenkinson
Browse files

Fixed bug in sort

parent 430643ff
No related branches found
No related tags found
No related merge requests found
......@@ -214,6 +214,7 @@ double pvalue(double tX, double dof) {
}
vector<int> get_sortindex(const Matrix& vals)
{
// return the mapping of old indices to new indices in the
......@@ -226,12 +227,11 @@ vector<int> get_sortindex(const Matrix& vals)
sort(sortlist.begin(),sortlist.end()); // O(N.log(N))
vector<int> idx(length);
for (int n=0; n<length; n++) {
idx[n] = sortlist[n].second;
idx[sortlist[n].second-1] = n+1;
}
return idx;
}
////////////////////////////////////////////////////////////////////////////
// Main function - this does all the work
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment