| 1075 | } |
| 1076 | |
| 1077 | HighsDebugStatus HEkk::debugOkForSolve(const SimplexAlgorithm algorithm, |
| 1078 | const HighsInt phase) const { |
| 1079 | if (this->options_->highs_debug_level < kHighsDebugLevelCheap) |
| 1080 | return HighsDebugStatus::kNotChecked; |
| 1081 | const HighsDebugStatus return_status = HighsDebugStatus::kOk; |
| 1082 | const HighsLp& lp = this->lp_; |
| 1083 | const HighsSimplexStatus& status = this->status_; |
| 1084 | const SimplexBasis& basis = this->basis_; |
| 1085 | const HighsOptions& options = *this->options_; |
| 1086 | bool ok; |
| 1087 | // Minimal check - just look at flags. This means we trust them! |
| 1088 | ok = status.has_basis && status.has_ar_matrix && status.has_nla && |
| 1089 | // status.has_dual_steepest_edge_weights && |
| 1090 | status.has_invert; |
| 1091 | if (!ok) { |
| 1092 | if (!status.has_basis) |
| 1093 | highsLogDev(options.log_options, HighsLogType::kError, |
| 1094 | "Not OK to solve since status.has_basis = " |
| 1095 | "%" HIGHSINT_FORMAT "\n", |
| 1096 | status.has_basis); |
| 1097 | if (!status.has_ar_matrix) |
| 1098 | highsLogDev(options.log_options, HighsLogType::kError, |
| 1099 | "Not OK to solve since status.has_ar_matrix = " |
| 1100 | "%" HIGHSINT_FORMAT "\n", |
| 1101 | status.has_ar_matrix); |
| 1102 | if (!status.has_nla) |
| 1103 | highsLogDev(options.log_options, HighsLogType::kError, |
| 1104 | "Not OK to solve since status.has_nla " |
| 1105 | "= %" HIGHSINT_FORMAT "\n", |
| 1106 | status.has_nla); |
| 1107 | if (!status.has_dual_steepest_edge_weights) |
| 1108 | highsLogDev(options.log_options, HighsLogType::kError, |
| 1109 | "Not OK to solve since " |
| 1110 | "status.has_dual_steepest_edge_weights = %" HIGHSINT_FORMAT |
| 1111 | "\n", |
| 1112 | status.has_dual_steepest_edge_weights); |
| 1113 | if (!status.has_invert) |
| 1114 | highsLogDev(options.log_options, HighsLogType::kError, |
| 1115 | "Not OK to solve since status.has_invert = " |
| 1116 | "%" HIGHSINT_FORMAT "\n", |
| 1117 | status.has_invert); |
| 1118 | } |
| 1119 | if (this->options_->highs_debug_level < kHighsDebugLevelCostly) |
| 1120 | return return_status; |
| 1121 | // Basis and data check |
| 1122 | if (this->debugBasisConsistent() == HighsDebugStatus::kLogicalError) |
| 1123 | return HighsDebugStatus::kLogicalError; |
| 1124 | // Check work cost, lower, upper and range |
| 1125 | if (!this->debugWorkArraysOk(algorithm, phase)) |
| 1126 | return HighsDebugStatus::kLogicalError; |
| 1127 | const HighsInt numTot = lp.num_col_ + lp.num_row_; |
| 1128 | // Check nonbasic move against work cost, lower, upper and range |
| 1129 | for (HighsInt var = 0; var < numTot; ++var) { |
| 1130 | if (basis.nonbasicFlag_[var]) { |
| 1131 | // Nonbasic variable |
| 1132 | if (!this->debugOneNonbasicMoveVsWorkArraysOk(var)) |
| 1133 | return HighsDebugStatus::kLogicalError; |
| 1134 | } |
no test coverage detected