| 68 | } |
| 69 | |
| 70 | HighsInt Highs_mipCall(const HighsInt num_col, const HighsInt num_row, |
| 71 | const HighsInt num_nz, const HighsInt a_format, |
| 72 | const HighsInt sense, const double offset, |
| 73 | const double* col_cost, const double* col_lower, |
| 74 | const double* col_upper, const double* row_lower, |
| 75 | const double* row_upper, const HighsInt* a_start, |
| 76 | const HighsInt* a_index, const double* a_value, |
| 77 | const HighsInt* integrality, double* col_value, |
| 78 | double* row_value, HighsInt* model_status) { |
| 79 | Highs highs; |
| 80 | highs.setOptionValue("output_flag", false); |
| 81 | *model_status = kHighsModelStatusNotset; |
| 82 | HighsStatus status = highs.passModel( |
| 83 | num_col, num_row, num_nz, a_format, sense, offset, col_cost, col_lower, |
| 84 | col_upper, row_lower, row_upper, a_start, a_index, a_value, integrality); |
| 85 | if (status == HighsStatus::kError) return (HighsInt)status; |
| 86 | |
| 87 | status = highs.run(); |
| 88 | |
| 89 | if (status == HighsStatus::kOk) { |
| 90 | const HighsSolution& solution = highs.getSolution(); |
| 91 | *model_status = (HighsInt)highs.getModelStatus(); |
| 92 | const HighsInfo& info = highs.getInfo(); |
| 93 | const bool copy_col_value = |
| 94 | col_value != nullptr && |
| 95 | info.primal_solution_status != SolutionStatus::kSolutionStatusNone; |
| 96 | |
| 97 | if (copy_col_value) { |
| 98 | for (HighsInt i = 0; i < num_col; i++) |
| 99 | col_value[i] = solution.col_value[i]; |
| 100 | } |
| 101 | const bool copy_row_value = |
| 102 | row_value != nullptr && |
| 103 | info.primal_solution_status != SolutionStatus::kSolutionStatusNone; |
| 104 | if (copy_row_value) { |
| 105 | for (HighsInt i = 0; i < num_row; i++) |
| 106 | row_value[i] = solution.row_value[i]; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | highs.resetGlobalScheduler(true); |
| 111 | |
| 112 | return (HighsInt)status; |
| 113 | } |
| 114 | |
| 115 | HighsInt Highs_qpCall( |
| 116 | const HighsInt num_col, const HighsInt num_row, const HighsInt num_nz, |