| 2284 | } |
| 2285 | |
| 2286 | HighsStatus Highs::getBasisInverseRow(const HighsInt row, double* row_vector, |
| 2287 | HighsInt* row_num_nz, |
| 2288 | HighsInt* row_indices) { |
| 2289 | if (row_vector == NULL) { |
| 2290 | highsLogUser(options_.log_options, HighsLogType::kError, |
| 2291 | "getBasisInverseRow: row_vector is NULL\n"); |
| 2292 | return HighsStatus::kError; |
| 2293 | } |
| 2294 | // row_indices can be NULL - it's the trigger that determines |
| 2295 | // whether they are identified or not |
| 2296 | HighsInt num_row = model_.lp_.num_row_; |
| 2297 | if (row < 0 || row >= num_row) { |
| 2298 | highsLogUser(options_.log_options, HighsLogType::kError, |
| 2299 | "Row index %" HIGHSINT_FORMAT |
| 2300 | " out of range [0, %" HIGHSINT_FORMAT |
| 2301 | "] in getBasisInverseRow\n", |
| 2302 | row, num_row - 1); |
| 2303 | return HighsStatus::kError; |
| 2304 | } |
| 2305 | if (!ekk_instance_.status_.has_invert) |
| 2306 | return invertRequirementError("getBasisInverseRow"); |
| 2307 | // Compute a row i of the inverse of the basis matrix by solving B^Tx=e_i |
| 2308 | vector<double> rhs; |
| 2309 | rhs.assign(num_row, 0); |
| 2310 | rhs[row] = 1; |
| 2311 | basisSolveInterface(rhs, row_vector, row_num_nz, row_indices, true); |
| 2312 | return HighsStatus::kOk; |
| 2313 | } |
| 2314 | |
| 2315 | HighsStatus Highs::getBasisInverseCol(const HighsInt col, double* col_vector, |
| 2316 | HighsInt* col_num_nz, |