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

John Forrest john.forrest at fastercoin.com
Tue Oct 27 12:56:48 EDT 2015


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();
> }
>



More information about the Clp mailing list