Skip to content

Commit

Permalink
corrects interpretation of sort order
Browse files Browse the repository at this point in the history
  • Loading branch information
Mike Park authored and Mike Park committed Jul 27, 2022
1 parent fdea519 commit 820cc1a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/ref_inflate.c
Expand Up @@ -433,19 +433,19 @@ REF_FCN static REF_STATUS ref_inflate_sort_rail(REF_INT n, REF_DBL *x,
ref_malloc(tmp, n, REF_DBL);
RSS(ref_sort_heap_dbl(n, x, order), "heap");
for (node = 0; node < n; node++) {
tmp[order[node]] = x[node];
tmp[node] = x[order[node]];
}
for (node = 0; node < n; node++) {
x[node] = tmp[node];
}
for (node = 0; node < n; node++) {
tmp[order[node]] = yz[0 + 2 * node];
tmp[node] = yz[0 + 2 * order[node]];
}
for (node = 0; node < n; node++) {
yz[0 + 2 * node] = tmp[node];
}
for (node = 0; node < n; node++) {
tmp[order[node]] = yz[1 + 2 * node];
tmp[node] = yz[1 + 2 * order[node]];
}
for (node = 0; node < n; node++) {
yz[1 + 2 * node] = tmp[node];
Expand Down

0 comments on commit 820cc1a

Please sign in to comment.