@@ -841,8 +841,9 @@ HighsStatus Highs::writeBasis(const std::string& filename) {
841841}
842842
843843HighsStatus Highs::presolve () {
844+ const HighsLogOptions& log_options = options_.log_options ;
844845 if (model_.needsMods (options_.infinite_cost )) {
845- highsLogUser (options_. log_options , HighsLogType::kError ,
846+ highsLogUser (log_options, HighsLogType::kError ,
846847 " Model contains infinite costs or semi-variables, so cannot "
847848 " be presolved independently\n " );
848849 return HighsStatus::kError ;
@@ -861,7 +862,7 @@ HighsStatus Highs::presolve() {
861862 max_threads = highs::parallel::num_threads ();
862863 if (options_.threads != 0 && max_threads != options_.threads ) {
863864 highsLogUser (
864- options_. log_options , HighsLogType::kError ,
865+ log_options, HighsLogType::kError ,
865866 " Option 'threads' is set to %d but global scheduler has already been "
866867 " initialized to use %d threads. The previous scheduler instance can "
867868 " be destroyed by calling Highs::resetGlobalScheduler().\n " ,
@@ -873,6 +874,7 @@ HighsStatus Highs::presolve() {
873874 }
874875
875876 bool using_reduced_lp = false ;
877+ HighsLp& incumbent_lp = model_.lp_ ;
876878 switch (model_presolve_status_) {
877879 case HighsPresolveStatus::kNotPresolved : {
878880 // Shouldn't happen
@@ -881,9 +883,12 @@ HighsStatus Highs::presolve() {
881883 break ;
882884 }
883885 case HighsPresolveStatus::kNotReduced :
886+ reportPresolveReductions (log_options, incumbent_lp, false );
884887 case HighsPresolveStatus::kInfeasible :
885888 case HighsPresolveStatus::kReduced :
889+ reportPresolveReductions (log_options, incumbent_lp, presolve_.getReducedProblem ());
886890 case HighsPresolveStatus::kReducedToEmpty :
891+ reportPresolveReductions (log_options, incumbent_lp, true );
887892 case HighsPresolveStatus::kUnboundedOrInfeasible : {
888893 // All OK
889894 if (model_presolve_status_ == HighsPresolveStatus::kInfeasible ) {
@@ -915,7 +920,7 @@ HighsStatus Highs::presolve() {
915920 default : {
916921 // case HighsPresolveStatus::kOutOfMemory
917922 assert (model_presolve_status_ == HighsPresolveStatus::kOutOfMemory );
918- highsLogUser (options_. log_options , HighsLogType::kError ,
923+ highsLogUser (log_options, HighsLogType::kError ,
919924 " Presolve fails due to memory allocation error\n " );
920925 setHighsModelStatusAndClearSolutionAndBasis (
921926 HighsModelStatus::kPresolveError );
@@ -927,7 +932,7 @@ HighsStatus Highs::presolve() {
927932 presolved_model_.lp_ .setMatrixDimensions ();
928933 }
929934
930- highsLogUser (options_. log_options , HighsLogType::kInfo ,
935+ highsLogUser (log_options, HighsLogType::kInfo ,
931936 " Presolve status: %s\n " ,
932937 presolveStatusToString (model_presolve_status_).c_str ());
933938 return returnFromHighs (return_status);
@@ -1400,6 +1405,7 @@ HighsStatus Highs::optimizeModel() {
14001405 // presolved problem, since the iteration count is reset to zero
14011406 // if PDLP is used to clean up after postsolve
14021407 HighsInt presolved_lp_pdlp_iteration_count = 0 ;
1408+ // reportPresolveReductions(log_options, model_presolve_status_, incumbent_lp, presolve_.getReducedProblem());
14031409 switch (model_presolve_status_) {
14041410 case HighsPresolveStatus::kNotPresolved : {
14051411 ekk_instance_.lp_name_ = " Original LP" ;
@@ -3522,8 +3528,8 @@ HighsPresolveStatus Highs::runPresolve(const bool force_lp_presolve,
35223528 // Start the MIP solver's timer so that timeout in presolve can be
35233529 // identified
35243530 solver.timer_ .start ();
3525- // Only place that HighsMipSolver::runPresolve is called
3526- solver.runPresolve (options_.presolve_reduction_limit );
3531+ // Only place that HighsMipSolver::runMipPresolve is called
3532+ solver.runMipPresolve (options_.presolve_reduction_limit );
35273533 presolve_return_status = solver.getPresolveStatus ();
35283534 // Assign values to data members of presolve_
35293535 presolve_.data_ .reduced_lp_ = solver.getPresolvedModel ();
0 commit comments