<br><font size=2 face="sans-serif">What do you want - throw an exception
or something else?</font>
<br>
<br><font size=2 face="sans-serif">John Forrest</font>
<br>
<br>
<br>
<table width=100%>
<tr valign=top>
<td width=40%><font size=1 face="sans-serif"><b>Joseph Young &lt;josyoun@nmt.edu&gt;</b>
</font>
<br><font size=1 face="sans-serif">Sent by: coin-discuss-admin@www-124.southbury.usf.ibm.com</font>
<p><font size=1 face="sans-serif">07/29/2004 04:56 PM</font>
<table border>
<tr valign=top>
<td bgcolor=white>
<div align=center><font size=1 face="sans-serif">Please respond to<br>
coin-discuss</font></div></table>
<br>
<td width=59%>
<table width=100%>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">To</font></div>
<td valign=top><font size=1 face="sans-serif">coin-discuss@www-124.southbury.usf.ibm.com</font>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">cc</font></div>
<td valign=top>
<tr>
<td>
<div align=right><font size=1 face="sans-serif">Subject</font></div>
<td valign=top><font size=1 face="sans-serif">[Coin-discuss] Bounds Checking</font></table>
<br>
<table>
<tr valign=top>
<td>
<td></table>
<br></table>
<br>
<br>
<br><font size=2><tt>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp; &nbsp;Right now, there does not appear to be any
bounds checking in <br>
COIN. &nbsp;For example, you are allowed set the objective coefficient
of a a <br>
collumn that doesn't exist. &nbsp;While some solvers recover gracefully,
like <br>
glpk, others don't, such as clp. &nbsp;Would this be too difficult to add?<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
Here is some sample code that will crash clp:<br>
#include&quot;CoinPackedVector.hpp&quot;<br>
#include&quot;OsiClpSolverInterface.hpp&quot;<br>
typedef OsiClpSolverInterface OsiXxxSolverInterface;<br>
int main(){<br>
 &nbsp; &nbsp;double &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;rZero = 0;<br>
 &nbsp; &nbsp;int &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; iZero = 0;<br>
 &nbsp; &nbsp;OsiXxxSolverInterface *clsLp=new OsiXxxSolverInterface;<br>
 &nbsp; &nbsp;double &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;inf = clsLp-&gt;getInfinity();<br>
 &nbsp; &nbsp;clsLp-&gt;loadProblem(0, 0, &amp;iZero, &amp;iZero, &amp;rZero,<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp;&amp;rZero, &amp;rZero, &amp;rZero, &amp;rZero, &amp;rZero);<br>
 &nbsp; &nbsp;clsLp-&gt;addCol(CoinPackedVector(),-inf,inf,0);<br>
 &nbsp; &nbsp;clsLp-&gt;setObjCoeff(2000,0.); &nbsp;//This line indexes
a col that doesn't exist<br>
 &nbsp; &nbsp;delete clsLp;<br>
}<br>
<br>
Sinc, Joseph Young<br>
<br>
_______________________________________________<br>
Coin-discuss mailing list<br>
Coin-discuss@www-124.ibm.com<br>
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss<br>
</tt></font>
<br>