[Osi] Adding a row provokes a segfault

Stefan Vigerske stefan at math.hu-berlin.de
Thu Jul 22 11:52:05 EDT 2010


Hi,

you now seem to add a column with row entries before having added the
row. :-)
My guess is that OsiClp does not allow it (since it does not make much
sense), while OsiGlpk is less strict.
Try adding columns without row entries first, then add rows with column
entries.
Or add rows without column entries, and then add columns with row entries.

Stefan

Christophe-Marie Duquesne wrote:
> Adding a column first does not solve this:
> 
> This program throws a CoinError:
> 
> #include <coin/OsiSolverInterface.hpp>
> #include <coin/OsiClpSolverInterface.hpp>
> #include <coin/CoinPackedVector.hpp>
> 
> 
> int main(int argc, const char *argv[])
> {
>     OsiSolverInterface * solver = new OsiClpSolverInterface();
> 
>     CoinPackedVector vector;
>     vector.insert(1, 1);
> 
>     solver->addCol(vector, 0, 1, 1);
> 
>     delete solver;
>     return 0;
> }
> 
> (gdb) bt
> #0  0x00110416 in __kernel_vsyscall ()
> #1  0x005fcd11 in raise () from /lib/libc.so.6
> #2  0x005fe5ea in abort () from /lib/libc.so.6
> #3  0x00d41397 in __gnu_cxx::__verbose_terminate_handler() () from
> /usr/lib/libstdc++.so.6
> #4  0x00d3f226 in ?? () from /usr/lib/libstdc++.so.6
> #5  0x00d3f263 in std::terminate() () from /usr/lib/libstdc++.so.6
> #6  0x00d3f3a2 in __cxa_throw () from /usr/lib/libstdc++.so.6
> #7  0x001a0e54 in OsiClpSolverInterface::freeCachedResults
> (this=0x804afa0) at OsiClpSolverInterface.cpp:4088
> #8  0x0019a08c in OsiClpSolverInterface::addCol (this=0x804afa0,
> vec=..., collb=0, colub=1, obj=1) at OsiClpSolverInterface.cpp:2863
> #9  0x080488ad in main ()
> 


-- 
Stefan Vigerske
Humboldt University Berlin, Numerical Mathematics
http://www.math.hu-berlin.de/~stefan




More information about the Osi mailing list