@@ -933,8 +933,6 @@ HighsStatus Highs::presolve() {
933933 return returnFromHighs (return_status);
934934}
935935
936- HighsMipSolverInfo getMipSolverInfo (const HighsMipSolver& solver);
937-
938936HighsStatus Highs::run () {
939937 const bool options_had_highs_files = this ->optionsHasHighsFiles ();
940938 if (options_had_highs_files) {
@@ -4025,24 +4023,22 @@ HighsStatus Highs::callSolveMip() {
40254023 }
40264024 HighsLp& lp = has_semi_variables ? use_lp : model_.lp_ ;
40274025 HighsMipSolver solver (callback_, options_, lp, solution_);
4028- HighsMipSolverInfo mip_solver_info;
40294026 solver.run ();
4030- mip_solver_info = getMipSolverInfo (solver);
40314027 options_.log_dev_level = log_dev_level;
40324028 // Set the return_status, model status and, for completeness, scaled
40334029 // model status
40344030 HighsStatus return_status =
4035- highsStatusFromHighsModelStatus (mip_solver_info. modelstatus );
4036- model_status_ = mip_solver_info. modelstatus ;
4031+ highsStatusFromHighsModelStatus (solver. modelstatus_ );
4032+ model_status_ = solver. modelstatus_ ;
40374033 // Extract the solution
4038- if (mip_solver_info. solution_objective != kHighsInf ) {
4034+ if (solver. solution_objective_ != kHighsInf ) {
40394035 // There is a primal solution
40404036 //
40414037 // If the original model has semi-variables, its solution is
40424038 // (still) given by the first model_.lp_.num_col_ entries of the
40434039 // solution from the MIP solver
40444040 solution_.col_value .resize (model_.lp_ .num_col_ );
4045- solution_.col_value = mip_solver_info. solution ;
4041+ solution_.col_value = solver. solution_ ;
40464042 this ->saved_objective_and_solution_ = solver.saved_objective_and_solution_ ;
40474043 model_.lp_ .a_matrix_ .productQuad (solution_.row_value , solution_.col_value );
40484044 solution_.value_valid = true ;
@@ -4062,7 +4058,7 @@ HighsStatus Highs::callSolveMip() {
40624058 // There is no basis: should be so by default
40634059 assert (!basis_.valid );
40644060 // Get the objective and any KKT failures
4065- info_.objective_function_value = mip_solver_info. solution_objective ;
4061+ info_.objective_function_value = solver. solution_objective_ ;
40664062 // Remember to judge primal feasibility according to
40674063 // mip_feasibility_tolerance, so take a copy of the original
40684064 // value...
@@ -4071,23 +4067,23 @@ HighsStatus Highs::callSolveMip() {
40714067 // NB getKktFailures sets the primal and dual solution status
40724068 getKktFailures (options_, model_, solution_, basis_, info_);
40734069 // Set the MIP-specific values of info_
4074- info_.mip_node_count = mip_solver_info. node_count ;
4075- info_.mip_dual_bound = mip_solver_info. dual_bound ;
4076- info_.mip_gap = mip_solver_info. gap ;
4077- info_.primal_dual_integral = mip_solver_info. primal_dual_integral ;
4070+ info_.mip_node_count = solver. node_count_ ;
4071+ info_.mip_dual_bound = solver. dual_bound_ ;
4072+ info_.mip_gap = solver. gap_ ;
4073+ info_.primal_dual_integral = solver. primal_dual_integral_ ;
40784074 // Get the number of LP iterations, avoiding overflow if the int64_t
40794075 // value is too large
4080- int64_t mip_total_lp_iterations = mip_solver_info. total_lp_iterations ;
4076+ int64_t mip_total_lp_iterations = solver. total_lp_iterations_ ;
40814077 info_.simplex_iteration_count = mip_total_lp_iterations > kHighsIInf
40824078 ? -1
40834079 : HighsInt (mip_total_lp_iterations);
40844080 info_.valid = true ;
40854081 if (model_status_ == HighsModelStatus::kOptimal )
40864082 return_status = checkOptimality (" MIP" );
40874083 // Overwrite max infeasibility to include integrality if there is a solution
4088- if (mip_solver_info. solution_objective != kHighsInf ) {
4089- const double mip_max_bound_violation = std::max (
4090- mip_solver_info. row_violation , mip_solver_info. bound_violation );
4084+ if (solver. solution_objective_ != kHighsInf ) {
4085+ const double mip_max_bound_violation =
4086+ std::max (solver. row_violation_ , solver. bound_violation_ );
40914087 const double delta_max_bound_violation =
40924088 std::abs (mip_max_bound_violation - info_.max_primal_infeasibility );
40934089 // Possibly report a mis-match between the max bound violation
@@ -4099,7 +4095,7 @@ HighsStatus Highs::callSolveMip() {
40994095 " (%10.4g); Difference of %10.4g\n " ,
41004096 mip_max_bound_violation, info_.max_primal_infeasibility ,
41014097 delta_max_bound_violation);
4102- info_.max_integrality_violation = mip_solver_info. integrality_violation ;
4098+ info_.max_integrality_violation = solver. integrality_violation_ ;
41034099 if (info_.max_integrality_violation > options_.mip_feasibility_tolerance ) {
41044100 info_.primal_solution_status = kSolutionStatusInfeasible ;
41054101 assert (model_status_ == HighsModelStatus::kInfeasible );
@@ -4809,22 +4805,3 @@ void Highs::getHighsFiles() {
48094805 this ->options_ .write_basis_file = this ->files_ .write_basis_file ;
48104806 this ->files_ .clear ();
48114807}
4812-
4813- HighsMipSolverInfo getMipSolverInfo (const HighsMipSolver& mip_solver) {
4814- HighsMipSolverInfo mip_solver_info;
4815- mip_solver_info.clear ();
4816- mip_solver_info.modelstatus = mip_solver.modelstatus_ ;
4817- mip_solver_info.solution = mip_solver.solution_ ;
4818- mip_solver_info.solution_objective = mip_solver.solution_objective_ ;
4819- mip_solver_info.bound_violation = mip_solver.bound_violation_ ;
4820- mip_solver_info.integrality_violation = mip_solver.integrality_violation_ ;
4821- mip_solver_info.row_violation = mip_solver.row_violation_ ;
4822- mip_solver_info.dual_bound = mip_solver.dual_bound_ ;
4823- mip_solver_info.primal_bound = mip_solver.primal_bound_ ;
4824- mip_solver_info.gap = mip_solver.gap_ ;
4825- mip_solver_info.max_submip_level = mip_solver.max_submip_level ;
4826- mip_solver_info.node_count = mip_solver.node_count_ ;
4827- mip_solver_info.total_lp_iterations = mip_solver.total_lp_iterations_ ;
4828- mip_solver_info.primal_dual_integral = mip_solver.primal_dual_integral_ ;
4829- return mip_solver_info;
4830- }
0 commit comments