| 217 | } |
| 218 | |
| 219 | HighsDebugStatus HEkk::debugSimplex(const std::string message, |
| 220 | const SimplexAlgorithm algorithm, |
| 221 | const HighsInt phase, |
| 222 | const bool initialise) const { |
| 223 | if (this->options_->highs_debug_level < kHighsDebugLevelCheap) |
| 224 | return HighsDebugStatus::kNotChecked; |
| 225 | static double max_max_basic_dual; |
| 226 | static double max_max_primal_residual; |
| 227 | static double max_max_dual_residual; |
| 228 | if (initialise) { |
| 229 | max_max_basic_dual = 0; |
| 230 | max_max_primal_residual = 0; |
| 231 | max_max_dual_residual = 0; |
| 232 | return ::HighsDebugStatus::kOk; |
| 233 | } |
| 234 | HighsDebugStatus return_status = HighsDebugStatus::kOk; |
| 235 | const HighsLp& lp = this->lp_; |
| 236 | const HighsSimplexInfo& info = this->info_; |
| 237 | const SimplexBasis& basis = this->basis_; |
| 238 | const HighsOptions& options = *(this->options_); |
| 239 | |
| 240 | const HighsInt num_col = lp.num_col_; |
| 241 | const HighsInt num_row = lp.num_row_; |
| 242 | const HighsInt num_tot = num_col + num_row; |
| 243 | const HighsInt iteration_count = this->iteration_count_; |
| 244 | std::string value_adjective; |
| 245 | HighsLogType report_level; |
| 246 | |
| 247 | // Check the nonbasic flags are all kNonbasicFlagTrue or kNonbasicFlagFalse |
| 248 | for (HighsInt iVar = 0; iVar < num_tot; iVar++) { |
| 249 | HighsInt flag = basis.nonbasicFlag_[iVar]; |
| 250 | bool flag_error = flag != kNonbasicFlagTrue && flag != kNonbasicFlagFalse; |
| 251 | if (flag_error) { |
| 252 | highsLogDev(options.log_options, HighsLogType::kError, |
| 253 | "HEkk::debugSimplex - %s: Iteration %" HIGHSINT_FORMAT |
| 254 | " Variable %" HIGHSINT_FORMAT |
| 255 | " has " |
| 256 | "nonbasic flag = %" HIGHSINT_FORMAT "\n", |
| 257 | message.c_str(), iteration_count, iVar, flag); |
| 258 | assert(!flag_error); |
| 259 | return HighsDebugStatus::kLogicalError; |
| 260 | } |
| 261 | } |
| 262 | const double primal_feasibility_tolerance = |
| 263 | options.primal_feasibility_tolerance; |
| 264 | const double dual_feasibility_tolerance = options.dual_feasibility_tolerance; |
| 265 | HighsInt num_dual_infeasibility = 0; |
| 266 | double max_dual_infeasibility = 0; |
| 267 | double sum_dual_infeasibility = 0; |
| 268 | HighsInt num_primal_infeasibility = 0; |
| 269 | double max_primal_infeasibility = 0; |
| 270 | double sum_primal_infeasibility = 0; |
| 271 | // Check the nonbasic variables |
| 272 | for (HighsInt iVar = 0; iVar < num_tot; iVar++) { |
| 273 | if (basis.nonbasicFlag_[iVar] == kNonbasicFlagFalse) continue; |
| 274 | // For nonbasic variables, check that they are on a bound (or free |
| 275 | // at 0 with correct nonbasic move. Determine dual infeasibilities |
| 276 | double dual = info.workDual_[iVar]; |
no test coverage detected