| 2313 | } |
| 2314 | |
| 2315 | HighsStatus Highs::getBasisInverseCol(const HighsInt col, double* col_vector, |
| 2316 | HighsInt* col_num_nz, |
| 2317 | HighsInt* col_indices) { |
| 2318 | if (col_vector == NULL) { |
| 2319 | highsLogUser(options_.log_options, HighsLogType::kError, |
| 2320 | "getBasisInverseCol: col_vector is NULL\n"); |
| 2321 | return HighsStatus::kError; |
| 2322 | } |
| 2323 | // col_indices can be NULL - it's the trigger that determines |
| 2324 | // whether they are identified or not |
| 2325 | HighsInt num_row = model_.lp_.num_row_; |
| 2326 | if (col < 0 || col >= num_row) { |
| 2327 | highsLogUser(options_.log_options, HighsLogType::kError, |
| 2328 | "Column index %" HIGHSINT_FORMAT |
| 2329 | " out of range [0, %" HIGHSINT_FORMAT |
| 2330 | "] in getBasisInverseCol\n", |
| 2331 | col, num_row - 1); |
| 2332 | return HighsStatus::kError; |
| 2333 | } |
| 2334 | if (!ekk_instance_.status_.has_invert) |
| 2335 | return invertRequirementError("getBasisInverseCol"); |
| 2336 | // Compute a col i of the inverse of the basis matrix by solving Bx=e_i |
| 2337 | vector<double> rhs; |
| 2338 | rhs.assign(num_row, 0); |
| 2339 | rhs[col] = 1; |
| 2340 | basisSolveInterface(rhs, col_vector, col_num_nz, col_indices, false); |
| 2341 | return HighsStatus::kOk; |
| 2342 | } |
| 2343 | |
| 2344 | HighsStatus Highs::getBasisSolve(const double* Xrhs, double* solution_vector, |
| 2345 | HighsInt* solution_num_nz, |