[Osi] Adding a row provokes a segfault

Christophe-Marie Duquesne chm.duquesne at gmail.com
Thu Jul 22 09:13:15 EDT 2010


Right! I did not realize there was an order (col before rows). Thanks!

On Thu, Jul 22, 2010 at 3:03 PM, Stefan Vigerske
<stefan at math.hu-berlin.de> wrote:
> Hi,
>
> you seem to use columns in your row that had not been added before.
>
> Stefan
>
> Christophe-Marie Duquesne wrote:
>> Hi list,
>>
>> The following program segfaults:
>>
>> #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->addRow(vector, 0, 1);
>>
>>     delete solver;
>>     return 0;
>> }
>>
>> Here is a backtrace with gdb:
>>
>> #0  0x00330e59 in CoinPackedMatrix::appendMinorVector (this=0x804e9f0,
>> vecsize=1, vecind=0x804e878, vecelem=0x804e8a8) at
>> CoinPackedMatrix.cpp:1314
>> #1  0x0033102a in CoinPackedMatrix::appendMinorVector (this=0x804e9f0,
>> vec=...) at CoinPackedMatrix.cpp:1345
>> #2  0x0032da45 in CoinPackedMatrix::appendRow (this=0x804e9f0,
>> vec=...) at CoinPackedMatrix.cpp:239
>> #3  0x0019ad10 in OsiClpSolverInterface::addRow (this=0x804afa0,
>> vec=..., rowlb=0, rowub=1) at OsiClpSolverInterface.cpp:3041
>>
>> Attached is an archive with this program and a Makefile. Set the OSI
>> flags according to your system.
>>
>> Did I do something wrong?
>>
>> Cheers,
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Osi mailing list
>> Osi at list.coin-or.org
>> http://list.coin-or.org/mailman/listinfo/osi
>
>
> --
> Stefan Vigerske
> Humboldt University Berlin, Numerical Mathematics
> http://www.math.hu-berlin.de/~stefan
>



-- 
Christophe-Marie Duquesne
06 84 14 26 82 - mobile
04 76 57 48 06 - g-scop
04 97 23 27 33 - amadeus





More information about the Osi mailing list