@@ -55,7 +55,7 @@ void getLpKktFailures(const HighsOptions& options, const HighsLp& lp,
5555 HighsInfo& highs_info) {
5656 HighsPrimalDualErrors primal_dual_errors;
5757 getLpKktFailures (options, lp, solution, basis, highs_info,
58- primal_dual_errors);
58+ primal_dual_errors, false );
5959}
6060
6161void getLpKktFailures (const HighsOptions& options, const HighsLp& lp,
@@ -64,7 +64,7 @@ void getLpKktFailures(const HighsOptions& options, const HighsLp& lp,
6464 HighsPrimalDualErrors& primal_dual_errors,
6565 const bool get_residuals) {
6666 getKktFailures (options, false , lp, lp.col_cost_ , solution, highs_info,
67- get_residuals);
67+ get_residuals, basis. valid );
6868 getPrimalDualBasisErrors (options, lp, solution, basis, primal_dual_errors);
6969 getPrimalDualGlpsolErrors (options, lp, lp.col_cost_ , solution,
7070 primal_dual_errors);
@@ -73,7 +73,8 @@ void getLpKktFailures(const HighsOptions& options, const HighsLp& lp,
7373void getKktFailures (const HighsOptions& options, const bool is_qp,
7474 const HighsLp& lp, const std::vector<double >& gradient,
7575 const HighsSolution& solution, HighsInfo& highs_info,
76- const bool get_residuals) {
76+ const bool get_residuals,
77+ const bool basic_solution) {
7778 double primal_feasibility_tolerance = options.primal_feasibility_tolerance ;
7879 double dual_feasibility_tolerance = options.dual_feasibility_tolerance ;
7980 double primal_residual_tolerance = options.primal_residual_tolerance ;
@@ -444,7 +445,7 @@ void getKktFailures(const HighsOptions& options, const bool is_qp,
444445 // Determine the sum of complementarity violations
445446 const bool have_values = getComplementarityViolations (
446447 lp, solution, optimality_tolerance, num_complementarity_violation,
447- max_complementarity_violation);
448+ max_complementarity_violation, basic_solution );
448449 assert (have_values);
449450 }
450451
@@ -955,7 +956,8 @@ bool getComplementarityViolations(const HighsLp& lp,
955956 const HighsSolution& solution,
956957 const double optimality_tolerance,
957958 HighsInt& num_complementarity_violation,
958- double & max_complementarity_violation) {
959+ double & max_complementarity_violation,
960+ const bool basic_solution) {
959961 num_complementarity_violation = kHighsIllegalComplementarityCount ;
960962 max_complementarity_violation = kHighsIllegalComplementarityViolation ;
961963 if (!solution.dual_valid ) return false ;
@@ -983,11 +985,13 @@ bool getComplementarityViolations(const HighsLp& lp,
983985 const double dual_residual = std::fabs (dual);
984986 const double complementarity_violation = primal_residual * dual_residual;
985987 if (complementarity_violation > optimality_tolerance) {
986- printf (" getComplementarityViolations: %s %d has (primal / dual) residual (%g / %g) violation = %g\n " ,
987- is_col ? " column" : " row" ,
988- is_col ? int (iVar) : int (iRow),
989- primal_residual, dual_residual,
990- complementarity_violation);
988+ if (basic_solution) {
989+ printf (" getComplementarityViolations: %s %d has (primal / dual) residual (%g / %g) violation = %g\n " ,
990+ is_col ? " column" : " row" ,
991+ is_col ? int (iVar) : int (iRow),
992+ primal_residual, dual_residual,
993+ complementarity_violation);
994+ }
991995 num_complementarity_violation++;
992996 }
993997 max_complementarity_violation =
0 commit comments