| 54 | } |
| 55 | |
| 56 | void checkIncreasingSort(const HighsInt num_sorted, |
| 57 | const vector<double>& values, |
| 58 | const vector<HighsInt>& indices, |
| 59 | const vector<double>& original_values) { |
| 60 | // Check that the random numbers are ascending and that the indices |
| 61 | // point from the original values to their new positions |
| 62 | bool error0 = false; |
| 63 | bool error1 = false; |
| 64 | double previous = -kHighsInf; |
| 65 | for (HighsInt ix = 0; ix < num_sorted; ix++) { |
| 66 | if (values[1 + ix] < previous) { |
| 67 | printf("Values[%2" HIGHSINT_FORMAT "] = %f5.4 < %f5.4 = previous\n", |
| 68 | 1 + ix, values[1 + ix], previous); |
| 69 | error0 = true; |
| 70 | } |
| 71 | previous = values[1 + ix]; |
| 72 | if (values[1 + ix] != original_values[1 + indices[1 + ix]]) { |
| 73 | printf("Values[%2" HIGHSINT_FORMAT |
| 74 | "] = %f5.4 != %f5.4 = original_values[indices[%2" HIGHSINT_FORMAT |
| 75 | "]]\n", |
| 76 | 1 + ix, values[1 + ix], original_values[indices[1 + ix]], 1 + ix); |
| 77 | error1 = true; |
| 78 | } |
| 79 | } |
| 80 | |
| 81 | REQUIRE(error0 == false); |
| 82 | REQUIRE(error1 == false); |
| 83 | } |
| 84 | |
| 85 | void checkDecreasingSort(const HighsInt num_sorted, |
| 86 | const vector<double>& values, |