<br><tt><font size=2>Kish:</font></tt>
<br><tt><font size=2><br>
&gt; However, should my code have reached here under normal circumstances,
or<br>
&gt; are the printf's<br>
&gt; here to show the user an error condition?<br>
</font></tt>
<br><tt><font size=2>Yes - your code should have reached there under normal
circumstances. &nbsp;I'm not sure how those printf's sneaked in there.
Francois Margot (thank you!) has fixed the code in svn (both trunk and
stable). </font></tt>
<br>
<br><tt><font size=2>Robin</font></tt>
<br>
<br>
<br><tt><font size=2><br>
&gt; ---------- Forwarded message ----------<br>
&gt; Date: Sat, 11 Nov 2006 02:58:09 +0000<br>
&gt; From: Kish Shen &lt;kish.shen@crosscoreop.com&gt;<br>
&gt; Reply-To: Discussions about open source software for Operations Research<br>
&gt; &nbsp; &nbsp; &lt;coin-discuss@list.coin-or.org&gt;<br>
&gt; To: coin-discuss@list.coin-or.org<br>
&gt; Subject: [Coin-discuss] debug printf left in CglKnapsackCover.cpp?<br>
&gt;<br>
&gt; Hi,<br>
&gt;<br>
&gt; I was running some code using Cbc, and some extra output was produced:<br>
&gt;<br>
&gt; At one 1<br>
&gt; 88 21 1.48197<br>
&gt; frac 2<br>
&gt; 23 2.0833 0.746648<br>
&gt; 94 0.6667 0.373324<br>
&gt;<br>
&gt; These look like some sort of debugging output, and after some checking,
I<br>
&gt; found that they<br>
&gt; came from CglKnapsackCover.cpp, in the function<br>
&gt; liftUpDownAndUncomplementAndAdd():<br>
&gt;<br>
&gt; &nbsp; if (unsatRhs&lt;=0.0&amp;&amp;fabs(xstar[firstFrac])&gt;epsilon2_)
{<br>
&gt; &nbsp; &nbsp; printf(&quot;At one %d\n&quot;,atOne.getNumElements());<br>
&gt; &nbsp; &nbsp; for (i=0; i&lt;atOne.getNumElements(); i++){<br>
&gt; &nbsp; &nbsp; &nbsp; int iColumn = atOne.getIndices()[i];<br>
&gt; &nbsp; &nbsp; &nbsp; printf(&quot;%d %g %g\n&quot;,atOne.getIndices()[i],atOne.getElements()[i],<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;xstar[iColumn]);<br>
&gt; &nbsp; &nbsp; }<br>
&gt; &nbsp; &nbsp; printf(&quot;frac %d\n&quot;,fracCover.getNumElements());<br>
&gt; &nbsp; &nbsp; for (i=0; i&lt;fracCover.getNumElements(); i++){<br>
&gt; &nbsp; &nbsp; &nbsp; int iColumn = fracCover.getIndices()[i];<br>
&gt; &nbsp; &nbsp; &nbsp; printf(&quot;%d %g<br>
&gt; %g\n&quot;,fracCover.getIndices()[i],fracCover.getElements()[i],<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;xstar[iColumn]);<br>
&gt; &nbsp; &nbsp; }<br>
&gt;<br>
&gt; I assume these should only be printed if debugging, so I have put
a #ifdef<br>
&gt; PRINT_DEBUG<br>
&gt; around this code.<br>
&gt;<br>
&gt; However, should my code have reached here under normal circumstances,
or<br>
&gt; are the printf's<br>
&gt; here to show the user an error condition?<br>
&gt;<br>
&gt; I am using the trunk branch, but I checked the stable branch, and
the<br>
&gt; above code is also there.<br>
&gt;<br>
&gt; Looking at CglKnapsackCover.cpp, I found another printf that is not<br>
&gt; enclosed by ifdefs, in<br>
&gt; deriveAKnapsack(), around line 928 in my copy of the file:<br>
&gt;<br>
&gt; &nbsp; &nbsp; &nbsp; printf(&quot;*** Doubleton Row is &quot;);<br>
&gt; &nbsp; &nbsp; &nbsp; for(i=0; i&lt;2; i++){<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int iColumn
= indices[i];<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; sum += elements[i]*xstar[iColumn];<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; printf(&quot;%d
(coeff = %g, value = %g} &quot;,indices[i],<br>
&gt; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;elements[i],xstar[iColumn]);<br>
&gt; &nbsp; &nbsp; &nbsp; }<br>
&gt; &nbsp; &nbsp; &nbsp; printf(&quot;&lt;= %g - go for it\n&quot;,b);<br>
&gt;<br>
&gt; Should there be an ifdef around this as well?<br>
&gt;<br>
&gt; --Kish Shen<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</font></tt>