<div>hi,</div> <div> </div> <div>I am using the trunk version of OsiClp and valgrind reports a bug on the following code. The valgrind error is attached at the end. No such bug is reported when the same code is compiled and run with the stable version of Osi obtained via the stable version of Cgl; this suggests the problem originates somewhere in the recently modified trunk version of the code.</div> <div> </div> <div>I will greatly appreciate if someone could help me fix this. </div> <div> </div> <div>regards & thanks,</div> <div>anureet</div> <div> </div> <div>PS: I will be more than happy to use the stable version of the code, except that some of the COIN-OR code I am using (cbc bonmin etc) depends on the trunk version of OsiClp.</div> <div> </div> <div> </div> <div>/*******************************************************************************/</div> <div>#include "OsiClpSolverInterface.hpp"<BR>#include
"CoinPackedVector.hpp"</div> <div>int main()<BR>{<BR> OsiSolverInterface * si = new OsiClpSolverInterface();<BR> si->readMps("p0033.mps");<BR> const char* rsense=si->getRowSense();<BR> int mx_nci=3;<BR> int* ci=new int[mx_nci];<BR> double* el=new double[mx_nci];<BR> int nci;</div> <div> nci=0;<BR> ci[nci]=0; el[nci]=16; nci++;<BR> ci[nci]=1; el[nci]=16; nci++;<BR> ci[nci]=2; el[nci]=10; nci++;<BR> CoinPackedVector* vec=new CoinPackedVector(nci, ci,el, false);</div> <div> si->addRow(*vec, -si->getInfinity(), 11);<BR>}<BR></div> <div>/*******************************************************************************/</div> <div> </div> <div>Valgrind
report:</div> <div> </div> <div>Invalid write of size 8 <BR> at 0x45CBB6: OsiSolverInterface::convertBoundToSense(double, double, char&, double&, double&) const (OsiSolverInterface.hpp:1788)<BR> by 0x7514C4: OsiClpSolverInterface::setRowBounds(int, double, double) (OsiClpSolverInterface.cpp:3801)<BR> by 0x75C674: OsiClpSolverInterface::addRow(CoinPackedVectorBase const&, double, double) (OsiClpSolverInterface.cpp:2158) <BR> by 0x405550: main (BonLgp.cpp:20)<BR> Address 0x4F06378 is 0 bytes after a block of size 128 alloc'd<BR> at 0x4A05E45: operator new[](unsigned long) (vg_replace_malloc.c:199)<BR> by 0x748973: OsiClpSolverInterface::extractSenseRhsRange() const (OsiClpSolverInterface.cpp:3149)<BR> by 0x748AD6: OsiClpSolverInterface::getRowSense() const (OsiClpSolverInterface.cpp:1749)<BR> by 0x4053F3: main (main.cpp:8)<BR>
<BR></div><BR><BR>Anureet Saxena<br> anureet@cmu.edu<br> anureet@yahoo.com<br> <br>--This mail was delivered to you on 100% recyclable electrons.<p> 
<hr size=1>Looking for a deal? <a href="http://us.rd.yahoo.com/evt=47094/*http://farechase.yahoo.com/;_ylc=X3oDMTFicDJoNDllBF9TAzk3NDA3NTg5BHBvcwMxMwRzZWMDZ3JvdXBzBHNsawNlbWFpbC1uY20-">Find great prices on flights and hotels</a> with Yahoo! FareChase.