| 1000 | } |
| 1001 | |
| 1002 | HighsStatus HEkk::solve(const bool force_phase2) { |
| 1003 | debugInitialise(); |
| 1004 | |
| 1005 | initialiseAnalysis(); |
| 1006 | initialiseControl(); |
| 1007 | |
| 1008 | if (analysis_.analyse_simplex_time) |
| 1009 | analysis_.simplexTimerStart(SimplexTotalClock); |
| 1010 | dual_simplex_cleanup_level_ = 0; |
| 1011 | dual_simplex_phase1_cleanup_level_ = 0; |
| 1012 | |
| 1013 | previous_iteration_cycling_detected = -kHighsIInf; |
| 1014 | |
| 1015 | initialiseForSolve(); |
| 1016 | |
| 1017 | const HighsDebugStatus simplex_nla_status = |
| 1018 | simplex_nla_.debugCheckData("Before HEkk::solve()"); |
| 1019 | const bool simplex_nla_ok = simplex_nla_status == HighsDebugStatus::kOk; |
| 1020 | if (!simplex_nla_ok) { |
| 1021 | highsLogUser(options_->log_options, HighsLogType::kError, |
| 1022 | "Error in simplex NLA data\n"); |
| 1023 | assert(simplex_nla_ok); |
| 1024 | return returnFromEkkSolve(HighsStatus::kError); |
| 1025 | } |
| 1026 | |
| 1027 | const bool report_initial_basis = false; |
| 1028 | if (report_initial_basis) debugReportInitialBasis(); |
| 1029 | |
| 1030 | assert(status_.has_basis); |
| 1031 | assert(status_.has_invert); |
| 1032 | assert(status_.initialised_for_solve); |
| 1033 | if (model_status_ == HighsModelStatus::kOptimal) |
| 1034 | return returnFromEkkSolve(HighsStatus::kOk); |
| 1035 | |
| 1036 | HighsStatus return_status = HighsStatus::kOk; |
| 1037 | HighsStatus call_status; |
| 1038 | std::string algorithm_name; |
| 1039 | |
| 1040 | // Indicate that dual and primal rays are not known |
| 1041 | this->clearRayRecords(); |
| 1042 | |
| 1043 | // Allow primal and dual perturbations in case a block on them is |
| 1044 | // hanging over from a previous call |
| 1045 | info_.allow_cost_shifting = true; |
| 1046 | info_.allow_cost_perturbation = true; |
| 1047 | info_.allow_bound_perturbation = true; |
| 1048 | |
| 1049 | chooseSimplexStrategyThreads(*options_, info_); |
| 1050 | HighsInt& simplex_strategy = info_.simplex_strategy; |
| 1051 | |
| 1052 | // Initial solve according to strategy |
| 1053 | if (simplex_strategy == kSimplexStrategyPrimal) { |
| 1054 | algorithm_name = "primal"; |
| 1055 | reportSimplexPhaseIterations(options_->log_options, iteration_count_, info_, |
| 1056 | true); |
| 1057 | highsLogUser(options_->log_options, HighsLogType::kInfo, "Using %s\n", |
| 1058 | simplexStrategyToString(kSimplexStrategyPrimal).c_str()); |
| 1059 | HEkkPrimal primal_solver(*this); |
no test coverage detected