<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 <josyoun@nmt.edu></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>
Right now, there does not appear to be any
bounds checking in <br>
COIN. For example, you are allowed set the objective coefficient
of a a <br>
collumn that doesn't exist. While some solvers recover gracefully,
like <br>
glpk, others don't, such as clp. Would this be too difficult to add?<br>
<br>
Here is some sample code that will crash clp:<br>
#include"CoinPackedVector.hpp"<br>
#include"OsiClpSolverInterface.hpp"<br>
typedef OsiClpSolverInterface OsiXxxSolverInterface;<br>
int main(){<br>
double rZero = 0;<br>
int iZero = 0;<br>
OsiXxxSolverInterface *clsLp=new OsiXxxSolverInterface;<br>
double inf = clsLp->getInfinity();<br>
clsLp->loadProblem(0, 0, &iZero, &iZero, &rZero,<br>
&rZero, &rZero, &rZero, &rZero, &rZero);<br>
clsLp->addCol(CoinPackedVector(),-inf,inf,0);<br>
clsLp->setObjCoeff(2000,0.); //This line indexes
a col that doesn't exist<br>
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>