@@ -284,12 +284,10 @@ void getKktFailures(const HighsOptions& options, const bool is_qp,
284284 // one-sided variables. For free variables, fixed variables, or
285285 // variables with small positive bound interval lengths,
286286 // mid_status is returned as kHighsSolutionNo.
287- const HighsInt index = pass == 0 ? 0 : (is_col ? iVar : -(1 +(iVar-lp.num_col_ )));
288287 getVariableKktFailures (primal_feasibility_tolerance,
289288 dual_feasibility_tolerance, lower, upper, value,
290289 dual, integrality, primal_infeasibility,
291- dual_infeasibility, at_status, mid_status,
292- index);
290+ dual_infeasibility, at_status, mid_status);
293291 if (pass == 0 ) {
294292 // If the primal value is close to a bound then include the bound
295293 // in the active bound norm
@@ -551,9 +549,11 @@ void getVariableKktFailures(const double primal_feasibility_tolerance,
551549 const HighsVarType integrality,
552550 double & primal_infeasibility,
553551 double & dual_infeasibility, uint8_t & at_status,
554- uint8_t & mid_status,
555- const HighsInt index) {
556- const HighsInt feasibility_tolerance_mu = 0.0 ;
552+ uint8_t & mid_status, const HighsInt index) {
553+ // Return the primal residual (ie infeasibility with zero tolerance)
554+ // as the primal infeasibility, ensuring (cf #2653) that it doesn't
555+ // exceed the primal feasibility tolerance if the standard primal
556+ // infeasibility (ie infeasibility exceeding the tolerance) is zero
557557 std::pair<double , double > infeasibility_residual =
558558 infeasibility (&lower, &value, &upper, &primal_feasibility_tolerance);
559559 primal_infeasibility = infeasibility_residual.second ;
0 commit comments