[Coin-discuss] Bounds Checking

John J Forrest jjforre at us.ibm.com
Thu Jul 29 17:37:20 EDT 2004


What do you want - throw an exception or something else?

John Forrest



Joseph Young <josyoun at nmt.edu> 
Sent by: coin-discuss-admin at www-124.southbury.usf.ibm.com
07/29/2004 04:56 PM
Please respond to
coin-discuss


To
coin-discuss at www-124.southbury.usf.ibm.com
cc

Subject
[Coin-discuss] Bounds Checking






                 Right now, there does not appear to be any bounds 
checking in 
COIN.  For example, you are allowed set the objective coefficient of a a 
collumn that doesn't exist.  While some solvers recover gracefully, like 
glpk, others don't, such as clp.  Would this be too difficult to add?

                 Here is some sample code that will crash clp:
#include"CoinPackedVector.hpp"
#include"OsiClpSolverInterface.hpp"
typedef OsiClpSolverInterface OsiXxxSolverInterface;
int main(){
    double          rZero = 0;
    int             iZero = 0;
    OsiXxxSolverInterface *clsLp=new OsiXxxSolverInterface;
    double          inf = clsLp->getInfinity();
    clsLp->loadProblem(0, 0, &iZero, &iZero, &rZero,
                      &rZero, &rZero, &rZero, &rZero, &rZero);
    clsLp->addCol(CoinPackedVector(),-inf,inf,0);
    clsLp->setObjCoeff(2000,0.);  //This line indexes a col that doesn't 
exist
    delete clsLp;
}

Sinc, Joseph Young

_______________________________________________
Coin-discuss mailing list
Coin-discuss at www-124.ibm.com
http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/coin-discuss/attachments/20040729/34100e5d/attachment.html>


More information about the Coin-discuss mailing list