<html><body>
<p>Sebastian,<br>
<br>
If columnActivity_ is NULL then numberColumns_ should have been zero.  I should probably look into it further.<br>
<br>
However your fix will do no harm - thanks.<br>
<br>
John Forrest<br>
<br>
<img width="16" height="16" src="cid:1__=0ABBFCC8DFBC69858f9e8a93df938@us.ibm.com" border="0" alt="Inactive hide details for &quot;Sebastian Theophil&quot; ---10/23/2009 08:55:37 AM---Hi, I have encountered what I believe to be a bug in"><font color="#424282">&quot;Sebastian Theophil&quot; ---10/23/2009 08:55:37 AM---Hi, I have encountered what I believe to be a bug in ClpModel::gutsOfCopy.</font><br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFCC8DFBC69858f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">From:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFCC8DFBC69858f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">&quot;Sebastian Theophil&quot; &lt;stheophil@think-cell.com&gt;</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFCC8DFBC69858f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">To:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFCC8DFBC69858f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">&lt;clp@list.coin-or.org&gt;</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFCC8DFBC69858f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Date:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFCC8DFBC69858f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">10/23/2009 08:55 AM</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFCC8DFBC69858f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Subject:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFCC8DFBC69858f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">[Clp] Proposed Patch for ClpModel::gutsOfCopy</font></td></tr>

<tr valign="top"><td width="1%"><img width="96" height="1" src="cid:2__=0ABBFCC8DFBC69858f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2" color="#5F5F5F">Sent by:</font></td><td width="100%"><img width="1" height="1" src="cid:2__=0ABBFCC8DFBC69858f9e8a93df938@us.ibm.com" border="0" alt=""><br>
<font size="2">clp-bounces@list.coin-or.org</font></td></tr>
</table>
<hr width="100%" size="2" align="left" noshade style="color:#8091A5; "><br>
<br>
<br>
<tt>Hi,<br>
<br>
<br>
I have encountered what I believe to be a bug in ClpModel::gutsOfCopy.<br>
In the latest trunk, lines 779-797 are<br>
<br>
 &nbsp; &nbsp; &nbsp;if (rhs.rowActivity_) {<br>
                 rowActivity_=new double[numberRows_];<br>
                 columnActivity_=new double[numberColumns_];<br>
                 dual_=new double[numberRows_];<br>
                 reducedCost_=new double[numberColumns_];<br>
                 ClpDisjointCopyN ( rhs.rowActivity_, numberRows_ ,<br>
                                                   &nbsp; &nbsp;rowActivity_);<br>
                 ClpDisjointCopyN ( rhs.columnActivity_, numberColumns_ ,<br>
                                                   &nbsp; &nbsp;columnActivity_);<br>
                 ClpDisjointCopyN ( rhs.dual_, numberRows_ , <br>
                                                   &nbsp; &nbsp;dual_);<br>
                 ClpDisjointCopyN ( rhs.reducedCost_, numberColumns_ ,<br>
                                                   &nbsp; &nbsp;reducedCost_);<br>
 &nbsp; &nbsp; &nbsp;} else {<br>
                 rowActivity_=NULL;<br>
                 columnActivity_=NULL;<br>
                 dual_=NULL;<br>
                 reducedCost_=NULL;<br>
 &nbsp; &nbsp; &nbsp;}<br>
<br>
After creating a OsiClpSolverInterface and adding a few constraints I<br>
have created an object in which rowActivity_ and dual_ are set, but<br>
columnActivity_ and reducedCost_ are not and the above code crashes. The<br>
model is not solved yet, maybe that's why the problem occurs.<br>
<br>
If I change the above lines to <br>
<br>
                 rowActivity_= ClpCopyOfArray(rhs.rowActivity_, numberRows_);<br>
                 columnActivity_= ClpCopyOfArray(rhs.columnActivity_,<br>
numberColumns_);<br>
                 dual_= ClpCopyOfArray(rhs.dual_, numberRows_);<br>
                 reducedCost_= ClpCopyOfArray(rhs.reducedCost_, numberColumns_);<br>
<br>
Everything works fine.<br>
<br>
Regards<br>
Sebastian<br>
<br>
--<br>
Sebastian Theophil . stheophil@think-cell.com<br>
Software Engineer<br>
 <br>
think-cell Software GmbH . Invalidenstr. 34 . 10115 Berlin, Germany <br>
</tt><tt><a href="http://www.think-cell.com">http://www.think-cell.com</a></tt><tt>&nbsp;. phone +49-30-666473-10 . toll-free (US) +1-800-891-8091<br>
Directors: Dr. Markus Hannebauer, Dr. Arno Schoedl . Amtsgericht Berlin-Charlottenburg, HRB 85229<br>
<br>
<br>
_______________________________________________<br>
Clp mailing list<br>
Clp@list.coin-or.org<br>
</tt><tt><a href="http://list.coin-or.org/mailman/listinfo/clp">http://list.coin-or.org/mailman/listinfo/clp</a></tt><tt><br>
</tt><br>
<br>
</body></html>