@@ -4116,8 +4116,10 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
41164116
41174117 // Must at least have a primal column solution of the right size
41184118 if (HighsInt (solution.col_value .size ()) != presolved_lp.num_col_ ) {
4119- highsLogUser (options_.log_options , HighsLogType::kError ,
4120- " Primal solution provided to postsolve is incorrect size\n " );
4119+ highsLogUser (
4120+ options_.log_options , HighsLogType::kError ,
4121+ " Primal solution provided to postsolve is of size %d rather than %d\n " ,
4122+ int (solution.col_value .size ()), int (presolved_lp.num_col_ ));
41214123 return HighsStatus::kError ;
41224124 }
41234125 // Check any basis that is supplied
@@ -4179,7 +4181,7 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
41794181 " Postsolve performed for MIP, but model status cannot be known\n " );
41804182 } else {
41814183 highsLogUser (options_.log_options , HighsLogType::kError ,
4182- " Postsolve return status is %d\n " , ( int ) postsolve_status);
4184+ " Postsolve return status is %d\n " , int ( postsolve_status) );
41834185 setHighsModelStatusAndClearSolutionAndBasis (
41844186 HighsModelStatus::kPostsolveError );
41854187 }
@@ -4194,10 +4196,20 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
41944196 presolve_.data_ .recovered_solution_ .row_dual .size () > 0 ||
41954197 presolve_.data_ .recovered_solution_ .dual_valid ;
41964198 if (dual_supplied) {
4197- if (!isDualSolutionRightSize (presolved_lp,
4198- presolve_.data_ .recovered_solution_ )) {
4199+ if (!isRowDualSolutionRightSize (presolved_lp,
4200+ presolve_.data_ .recovered_solution_ )) {
4201+ highsLogUser (options_.log_options , HighsLogType::kError ,
4202+ " Row dual solution provided to postsolve is of size %d "
4203+ " rather than %d\n " ,
4204+ int (solution.row_dual .size ()), int (presolved_lp.num_row_ ));
4205+ return HighsStatus::kError ;
4206+ }
4207+ if (!isColDualSolutionRightSize (presolved_lp,
4208+ presolve_.data_ .recovered_solution_ )) {
41994209 highsLogUser (options_.log_options , HighsLogType::kError ,
4200- " Dual solution provided to postsolve is incorrect size\n " );
4210+ " Column dual solution provided to postsolve is of size %d "
4211+ " rather than %d\n " ,
4212+ int (solution.col_dual .size ()), int (presolved_lp.num_col_ ));
42014213 return HighsStatus::kError ;
42024214 }
42034215 presolve_.data_ .recovered_solution_ .dual_valid = true ;
@@ -4288,6 +4300,9 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
42884300 getKktFailures (this ->options_ , is_qp, this ->model_ .lp_ ,
42894301 this ->model_ .lp_ .col_cost_ , this ->solution_ , this ->info_ ,
42904302 get_residuals);
4303+ highsLogUser (options_.log_options , HighsLogType::kInfo , " \n " );
4304+ reportLpKktFailures (this ->model_ .lp_ , this ->options_ , this ->info_ ,
4305+ " After postsolve" );
42914306 if (info_.num_primal_infeasibilities == 0 &&
42924307 info_.num_dual_infeasibilities == 0 ) {
42934308 model_status_ = HighsModelStatus::kOptimal ;
@@ -4296,7 +4311,7 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
42964311 }
42974312 highsLogUser (
42984313 options_.log_options , HighsLogType::kInfo ,
4299- " Pure postsolve yields primal %ssolution, but no basis: model "
4314+ " \n Pure postsolve yields primal %ssolution, but no basis: model "
43004315 " status is %s\n " ,
43014316 solution_.dual_valid ? " and dual " : " " ,
43024317 modelStatusToString (model_status_).c_str ());
0 commit comments