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

Method crossover

highs/lp_data/Highs.cpp:5064–5089  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5062}
5063
5064HighsStatus Highs::crossover(const HighsSolution& user_solution) {
5065 HighsStatus return_status = HighsStatus::kOk;
5066 HighsLogOptions& log_options = options_.log_options;
5067 HighsLp& lp = model_.lp_;
5068 if (lp.isMip()) {
5069 highsLogUser(log_options, HighsLogType::kError,
5070 "Cannot apply crossover to solve MIP\n");
5071 return_status = HighsStatus::kError;
5072 } else if (model_.isQp()) {
5073 highsLogUser(log_options, HighsLogType::kError,
5074 "Cannot apply crossover to solve QP\n");
5075 return_status = HighsStatus::kError;
5076 } else {
5077 clearSolver();
5078 solution_ = user_solution;
5079 // Use IPX crossover to try to form a basic solution
5080 return_status = callCrossover(options_, model_.lp_, basis_, solution_,
5081 model_status_, info_, callback_);
5082 if (return_status == HighsStatus::kError) return return_status;
5083 // Get the objective and any KKT failures
5084 info_.objective_function_value =
5085 model_.lp_.objectiveValue(solution_.col_value);
5086 getLpKktFailures(options_, model_.lp_, solution_, basis_, info_);
5087 }
5088 return returnFromHighs(return_status);
5089}
5090
5091HighsStatus Highs::openLogFile(const std::string& log_file) {
5092 highsOpenLogFile(options_.log_options, options_.records, log_file);

Callers 2

Highs_crossoverFunction · 0.80
test_crossoverFunction · 0.80

Calls 6

highsLogUserFunction · 0.85
callCrossoverFunction · 0.85
getLpKktFailuresFunction · 0.85
isQpMethod · 0.80
isMipMethod · 0.45
objectiveValueMethod · 0.45

Tested by 1

test_crossoverFunction · 0.64