| 5062 | } |
| 5063 | |
| 5064 | HighsStatus 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 | |
| 5091 | HighsStatus Highs::openLogFile(const std::string& log_file) { |
| 5092 | highsOpenLogFile(options_.log_options, options_.records, log_file); |