@@ -625,6 +625,10 @@ bool computeDualObjectiveValue(const HighsLp& lp, const HighsSolution& solution,
625625
626626 dual_objective_value = lp.offset_ ;
627627 double bound = 0 ;
628+ assert (HighsInt (lp.col_lower_ .size ()) >= lp.num_col_ );
629+ assert (HighsInt (lp.col_upper_ .size ()) >= lp.num_col_ );
630+ assert (HighsInt (lp.row_lower_ .size ()) >= lp.num_row_ );
631+ assert (HighsInt (lp.row_upper_ .size ()) >= lp.num_row_ );
628632 for (HighsInt iVar = 0 ; iVar < lp.num_col_ + lp.num_row_ ; iVar++) {
629633 const bool is_col = iVar < lp.num_col_ ;
630634 const HighsInt iRow = iVar - lp.num_col_ ;
@@ -634,6 +638,7 @@ bool computeDualObjectiveValue(const HighsLp& lp, const HighsSolution& solution,
634638 is_col ? solution.col_dual [iVar] : solution.row_dual [iRow];
635639 const double lower = is_col ? lp.col_lower_ [iVar] : lp.row_lower_ [iRow];
636640 const double upper = is_col ? lp.col_upper_ [iVar] : lp.row_upper_ [iRow];
641+ if (!is_col) assert (iRow < lp.num_row_ );
637642 if (lower <= -kHighsInf && upper >= kHighsInf ) {
638643 // Free
639644 bound = 1 ;
@@ -642,6 +647,12 @@ bool computeDualObjectiveValue(const HighsLp& lp, const HighsSolution& solution,
642647 bound = primal < mid ? lower : upper;
643648 }
644649 dual_objective_value += bound * dual;
650+ if (bound * dual)
651+ printf (
652+ " computeDualObjectiveValue: %s %6d: bound = %11.5g; dual = %11.5g; "
653+ " objective = %11.5g\n " ,
654+ is_col ? " col" : " row" , is_col ? int (iVar) : int (iRow), bound, dual,
655+ dual_objective_value);
645656 }
646657 return true ;
647658}
0 commit comments