@@ -4105,8 +4105,10 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
41054105
41064106 // Must at least have a primal column solution of the right size
41074107 if (HighsInt (solution.col_value .size ()) != presolved_lp.num_col_ ) {
4108- highsLogUser (options_.log_options , HighsLogType::kError ,
4109- " Primal solution provided to postsolve is incorrect size\n " );
4108+ highsLogUser (
4109+ options_.log_options , HighsLogType::kError ,
4110+ " Primal solution provided to postsolve is of size %d rather than %d\n " ,
4111+ int (solution.col_value .size ()), int (presolved_lp.num_col_ ));
41104112 return HighsStatus::kError ;
41114113 }
41124114 // Check any basis that is supplied
@@ -4168,7 +4170,7 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
41684170 " Postsolve performed for MIP, but model status cannot be known\n " );
41694171 } else {
41704172 highsLogUser (options_.log_options , HighsLogType::kError ,
4171- " Postsolve return status is %d\n " , ( int ) postsolve_status);
4173+ " Postsolve return status is %d\n " , int ( postsolve_status) );
41724174 setHighsModelStatusAndClearSolutionAndBasis (
41734175 HighsModelStatus::kPostsolveError );
41744176 }
@@ -4183,10 +4185,20 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
41834185 presolve_.data_ .recovered_solution_ .row_dual .size () > 0 ||
41844186 presolve_.data_ .recovered_solution_ .dual_valid ;
41854187 if (dual_supplied) {
4186- if (!isDualSolutionRightSize (presolved_lp,
4187- presolve_.data_ .recovered_solution_ )) {
4188+ if (!isRowDualSolutionRightSize (presolved_lp,
4189+ presolve_.data_ .recovered_solution_ )) {
4190+ highsLogUser (options_.log_options , HighsLogType::kError ,
4191+ " Row dual solution provided to postsolve is of size %d "
4192+ " rather than %d\n " ,
4193+ int (solution.row_dual .size ()), int (presolved_lp.num_row_ ));
4194+ return HighsStatus::kError ;
4195+ }
4196+ if (!isColDualSolutionRightSize (presolved_lp,
4197+ presolve_.data_ .recovered_solution_ )) {
41884198 highsLogUser (options_.log_options , HighsLogType::kError ,
4189- " Dual solution provided to postsolve is incorrect size\n " );
4199+ " Column dual solution provided to postsolve is of size %d "
4200+ " rather than %d\n " ,
4201+ int (solution.col_dual .size ()), int (presolved_lp.num_col_ ));
41904202 return HighsStatus::kError ;
41914203 }
41924204 presolve_.data_ .recovered_solution_ .dual_valid = true ;
@@ -4277,6 +4289,9 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
42774289 getKktFailures (this ->options_ , is_qp, this ->model_ .lp_ ,
42784290 this ->model_ .lp_ .col_cost_ , this ->solution_ , this ->info_ ,
42794291 get_residuals);
4292+ highsLogUser (options_.log_options , HighsLogType::kInfo , " \n " );
4293+ reportLpKktFailures (this ->model_ .lp_ , this ->options_ , this ->info_ ,
4294+ " After postsolve" );
42804295 if (info_.num_primal_infeasibilities == 0 &&
42814296 info_.num_dual_infeasibilities == 0 ) {
42824297 model_status_ = HighsModelStatus::kOptimal ;
@@ -4285,7 +4300,7 @@ HighsStatus Highs::callRunPostsolve(const HighsSolution& solution,
42854300 }
42864301 highsLogUser (
42874302 options_.log_options , HighsLogType::kInfo ,
4288- " Pure postsolve yields primal %ssolution, but no basis: model "
4303+ " \n Pure postsolve yields primal %ssolution, but no basis: model "
42894304 " status is %s\n " ,
42904305 solution_.dual_valid ? " and dual " : " " ,
42914306 modelStatusToString (model_status_).c_str ());
0 commit comments