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

Method solve

highs/simplex/HEkk.cpp:1002–1120  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1000}
1001
1002HighsStatus 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);

Callers 6

solveLpSimplexFunction · 0.45
highs_lexicographicFunction · 0.45
highs_weightedFunction · 0.45
distillation.pyFile · 0.45
nqueens.pyFile · 0.45
chip.pyFile · 0.45

Calls 12

clearRayRecordsMethod · 0.95
highsLogUserFunction · 0.85
interpretCallStatusFunction · 0.85
highsLogDevFunction · 0.85
utilModelStatusToStringFunction · 0.85
simplexTimerStartMethod · 0.80
debugCheckDataMethod · 0.80
c_strMethod · 0.80
summaryReportMethod · 0.80
reportInvertFormDataMethod · 0.80
reportFactorTimerMethod · 0.80

Tested by

no test coverage detected