<br><font size=2 face="sans-serif">In our BCP application we kept getting
errors which we eventually tracked down to reduced_cost_fixing screwing
up the bounds on some variables. &nbsp;Our suspicion is that when dj[i]
(the reactivity of the objective to the given variable) ought to be zero,
it can sometimes be given a very small value due to roundoff error. &nbsp;In
this case, the bounds can get slammed to one end or the other, leaving
the relaxed value of the variable outside the bounds.</font>
<br>
<br><font size=2 face="sans-serif">We propose adding a check that doesn't
adjust the bound if doing so would exclude the current value of the variable.
&nbsp;The relevant code is:</font>
<br>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; if (dj[i] &gt;
0) {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; const
double lb = var-&gt;lb();</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; const
double new_ub = lb + floor(gap / dj[i]);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; if
(new_ub &lt; var-&gt;ub() &amp;&amp; (atAny || CoinAbs(x[i])&lt;petol)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &amp;&amp; (new_ub &gt;= x[i])) { // &nbsp;If x[i] is no longer
in range, you've goofed due to roundoff error.</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; // (this problem came up with an upper bound of 1e+24 and
a dj of -1.9e-13)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
vars[i]-&gt;set_ub(new_ub);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
changed_indices.unchecked_push_back(i);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
changed_bounds.unchecked_push_back(lb);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
changed_bounds.unchecked_push_back(new_ub);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; }</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; } else if (dj[i]
&lt; 0) {</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; const
double ub = var-&gt;ub();</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; const
double new_lb = ub - floor(gap / (-dj[i]));</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; if
(new_lb &gt; var-&gt;lb() &amp;&amp; (atAny || CoinAbs(x[i])&lt;petol)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &amp;&amp; (new_lb &lt;= x[i])) { // &nbsp;If x[i] is no longer
in range, you've goofed due to roundoff error.</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; // (this problem came up with an upper bound of 1e+24 and
a dj of -1.9e-13)</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
vars[i]-&gt;set_lb(new_lb);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
changed_indices.unchecked_push_back(i);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
changed_bounds.unchecked_push_back(new_lb);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
changed_bounds.unchecked_push_back(ub);</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; &nbsp; }</font>
<br><font size=2 face="sans-serif">&nbsp; &nbsp; &nbsp; }</font>
<br>
<br><font size=2 face="sans-serif">The changes are marked with comments.</font>
<br>
<br><font size=2 face="sans-serif">So far our tests show the problem that
used to cause the errors, no longer doing so. &nbsp;But our confidence-level
is not high: the error was elusive, appearing and disappearing with changes
that ought to have made no difference. &nbsp;We are wondering if we are
on the right track, and if this is a worthwhile change to migrate back
into the source. &nbsp;We'd appreciate any insights from other members
of the COIN/Bcp community.</font>