MCPcopy Create free account
hub / github.com/ERGO-Code/HiGHS / getReducedColumn

Method getReducedColumn

highs/lp_data/Highs.cpp:2451–2482  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2449}
2450
2451HighsStatus Highs::getReducedColumn(const HighsInt col, double* col_vector,
2452 HighsInt* col_num_nz,
2453 HighsInt* col_indices) {
2454 HighsLp& lp = model_.lp_;
2455 // Ensure that the LP is column-wise
2456 lp.ensureColwise();
2457 if (col_vector == NULL) {
2458 highsLogUser(options_.log_options, HighsLogType::kError,
2459 "getReducedColumn: col_vector is NULL\n");
2460 return HighsStatus::kError;
2461 }
2462 // col_indices can be NULL - it's the trigger that determines
2463 // whether they are identified or not
2464 if (col < 0 || col >= lp.num_col_) {
2465 highsLogUser(options_.log_options, HighsLogType::kError,
2466 "Column index %" HIGHSINT_FORMAT
2467 " out of range [0, %" HIGHSINT_FORMAT
2468 "] in getReducedColumn\n",
2469 col, lp.num_col_ - 1);
2470 return HighsStatus::kError;
2471 }
2472 if (!ekk_instance_.status_.has_invert)
2473 return invertRequirementError("getReducedColumn");
2474 HighsInt num_row = lp.num_row_;
2475 vector<double> rhs;
2476 rhs.assign(num_row, 0);
2477 for (HighsInt el = lp.a_matrix_.start_[col];
2478 el < lp.a_matrix_.start_[col + 1]; el++)
2479 rhs[lp.a_matrix_.index_[el]] = lp.a_matrix_.value_[el];
2480 basisSolveInterface(rhs, col_vector, col_num_nz, col_indices, false);
2481 return HighsStatus::kOk;
2482}
2483
2484HighsStatus Highs::getKappa(double& kappa, const bool exact,
2485 const bool report) const {

Callers 4

highs_getReducedColumnFunction · 0.45
testBasisSolveFunction · 0.45

Calls 2

highsLogUserFunction · 0.85
ensureColwiseMethod · 0.45

Tested by 1

testBasisSolveFunction · 0.36