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

Method returnFromHighs

highs/lp_data/Highs.cpp:4963–5018  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4961}
4962
4963HighsStatus Highs::returnFromHighs(HighsStatus highs_return_status) {
4964 // Applies checks before returning from HiGHS
4965 HighsStatus return_status = highs_return_status;
4966
4967 forceHighsSolutionBasisSize();
4968
4969 const bool consistent =
4970 debugHighsBasisConsistent(options_, model_.lp_, basis_) !=
4971 HighsDebugStatus::kLogicalError;
4972 if (!consistent) {
4973 highsLogUser(
4974 options_.log_options, HighsLogType::kError,
4975 "returnFromHighs: Supposed to be a HiGHS basis, but not consistent\n");
4976 assert(consistent);
4977 return_status = HighsStatus::kError;
4978 }
4979 // Check that any retained Ekk data - basis and NLA - are OK
4980 bool retained_ekk_data_ok = ekk_instance_.debugRetainedDataOk(model_.lp_) !=
4981 HighsDebugStatus::kLogicalError;
4982 if (!retained_ekk_data_ok) {
4983 highsLogUser(options_.log_options, HighsLogType::kError,
4984 "returnFromHighs: Retained Ekk data not OK\n");
4985 assert(retained_ekk_data_ok);
4986 return_status = HighsStatus::kError;
4987 }
4988 // Check that returnFromOptimizeModel() has been called
4989 if (!called_return_from_optimize_model) {
4990 highsLogDev(options_.log_options, HighsLogType::kError,
4991 "Highs::returnFromHighs() called with "
4992 "called_return_from_optimize_model false\n");
4993 assert(called_return_from_optimize_model);
4994 }
4995 // Stop the HiGHS run clock if it is running
4996 if (timer_.running()) timer_.stop();
4997 const bool dimensions_ok =
4998 lpDimensionsOk("returnFromHighs", model_.lp_, options_.log_options);
4999 if (!dimensions_ok) {
5000 highsLogDev(options_.log_options, HighsLogType::kError,
5001 "LP Dimension error in returnFromHighs()\n");
5002 return_status = HighsStatus::kError;
5003 }
5004 assert(dimensions_ok);
5005 if (ekk_instance_.status_.has_nla) {
5006 const bool lp_factor_row_compatible =
5007 ekk_instance_.lpFactorRowCompatible(model_.lp_.num_row_);
5008 if (!lp_factor_row_compatible) {
5009 highsLogDev(options_.log_options, HighsLogType::kWarning,
5010 "Highs::returnFromHighs(): LP and HFactor have inconsistent "
5011 "numbers of rows\n");
5012 assert(lp_factor_row_compatible);
5013 // Clear Ekk entirely
5014 ekk_instance_.clear();
5015 }
5016 }
5017 return return_status;
5018}
5019
5020void Highs::reportSolvedLpQpStats() {

Callers

nothing calls this directly

Calls 9

highsLogUserFunction · 0.85
highsLogDevFunction · 0.85
lpDimensionsOkFunction · 0.85
debugRetainedDataOkMethod · 0.80
lpFactorRowCompatibleMethod · 0.80
runningMethod · 0.45
stopMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected