[Clp] Assertion `!diffUpper||fabs(diffLower-diffUpper)<1.0e-5' failed

John Forrest john.forrest at fastercoin.com
Wed Oct 28 12:49:11 EDT 2015


Lasse,

I managed to get the error.  Looking more closely the assert is stupid - 
and also the code which led to the assert is probably not very reliable.

I have modified ClpSolve.cpp.  However to duplicate your bug, I 
downloaded the latest CoinAll and it is wildly out of date - January 
this year - so I would use svn where possible.

John Forrest
On 27/10/15 19:52, Lasse Kliemann wrote:
> Dear John, thanks for your help.
>
> Further tests revealed that the error happens with newer versions as
> well (I tested up to CoinAll-1.7.5) -- but only if
>
>    -Xlinker -Rxxx
>
> is used for building the libraries, even if xxx points to an empty
> directory. Without this directive, it is fine.
>
> So it looks more like a build problem, at least for newer versions.
>
> John Forrest <john.forrest at fastercoin.com> writes:
>
>> Lasse,
>>
>> I am unable to reproduce error using latest Osi stable 0.107.
>>
>> I compiled in stable 2.9/Cbc/examples so was using Clp 1.16 and
>> Coinutils 2.10
>>
>>
>>
>> John Forrest
>>
>> On 27/10/15 15:04, Lasse Kliemann wrote:
>>> The program below will give the error:
>>>
>>>     ClpSolve.cpp:1792: int ClpSimplex::initialSolve(ClpSolve&):
>>>     Assertion `!diffUpper||fabs(diffLower-diffUpper)<1.0e-5' failed.
>>>
>>> when compiled against Osi 0.97.0 or newer, but is ok for 0.96.1 or
>>> older.
>>>
>>> The LP has n^3 variables and 3*n constraints. The matrix has three
>>> 1-entries in each column, distributed in a certain pattern. This LP is
>>> feasible.
>>>
>>> The error goes away when n < 19 or when the upper row bound is set to
>>> 1.0 (matching the lower bound) or larger than 2.0.
>>>
>>> Could anyone please provide some insight on this? The diff between
>>> 0.96.1 and 0.97.0 probably holds the answer, but I'm not qualified to
>>> analyze it. Thanks!
>>>
>>> #include <cstring>
>>> #include <OsiClpSolverInterface.hpp>
>>> #include <CoinModel.hpp>
>>>
>>> int main() {
>>>     const double ones[3] = { 1, 1, 1 };
>>>     const int n = 19;             // n < 19 eliminates error
>>>     const double row_upper = 1.1; // 1.000001 <= row_upper <= 2.0 gives error
>>>     CoinModel model;
>>>     for(int i=0; i<n; ++i)
>>>       for(int j=0; j<n; ++j)
>>>         for(int k=0; k<n; ++k) {
>>> 	int rows[3]; rows[0]=i; rows[1]=n+j; rows[2]=2*n+k;
>>> 	model.addColumn(3, rows, ones, 0.0, 1.0, 1.0);
>>>         }
>>>     for(int i=0; i<3*n; ++i) model.setRowBounds(i, 1.0, row_upper);
>>>     OsiClpSolverInterface si;
>>>     si.loadFromCoinModel(model);
>>>     si.initialSolve();
>>> }
>>>
>> _______________________________________________
>> Clp mailing list
>> Clp at list.coin-or.org
>> http://list.coin-or.org/mailman/listinfo/clp
>



More information about the Clp mailing list