| 32 | using std::pair; |
| 33 | |
| 34 | static void solveMatrixT(const HighsInt X_Start, const HighsInt x_end, |
| 35 | const HighsInt y_start, const HighsInt y_end, |
| 36 | const HighsInt* t_index, const double* t_value, |
| 37 | const double t_pivot, HighsInt* rhs_count, |
| 38 | HighsInt* rhs_index, double* rhs_array) { |
| 39 | // Collect by X |
| 40 | double pivot_multiplier = 0; |
| 41 | for (HighsInt k = X_Start; k < x_end; k++) |
| 42 | pivot_multiplier += t_value[k] * rhs_array[t_index[k]]; |
| 43 | |
| 44 | // Scatter by Y |
| 45 | if (fabs(pivot_multiplier) > kHighsTiny) { |
| 46 | HighsInt work_count = *rhs_count; |
| 47 | |
| 48 | pivot_multiplier /= t_pivot; |
| 49 | for (HighsInt k = y_start; k < y_end; k++) { |
| 50 | const HighsInt index = t_index[k]; |
| 51 | const double value0 = rhs_array[index]; |
| 52 | const double value1 = value0 - pivot_multiplier * t_value[k]; |
| 53 | if (value0 == 0) rhs_index[work_count++] = index; |
| 54 | rhs_array[index] = (fabs(value1) < kHighsTiny) ? kHighsZero : value1; |
| 55 | } |
| 56 | |
| 57 | *rhs_count = work_count; |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | static void solveHyper(const HighsInt h_size, const HighsInt* h_lookup, |
| 62 | const HighsInt* h_pivot_index, |