[Clp-tickets] [COIN-OR Linear Programming Solver] #3: fix failed
assertion in CoinPackedMatrix::removeGaps
COIN-OR Linear Programming Solver
coin-trac at coin-or.org
Tue Oct 24 17:28:00 EDT 2006
#3: fix failed assertion in CoinPackedMatrix::removeGaps
------------------------+---------------------------------------------------
Reporter: dmg | Owner: somebody
Type: defect | Status: new
Priority: major | Milestone:
Component: component1 | Version:
Keywords: |
------------------------+---------------------------------------------------
We have an example (in a Sandia application that calls the
COIN MIP solver) in which line 2368 of ClpPackedMatrix::allElementsInRange
invokes
matrix_->compress(smallest);
and soon thereafter we get a failed assertion at CoinPackedMatrix.cpp:604.
Here's a partial traceback at the invocation of
matrix_->compress(smallest:
#0 ClpPackedMatrix::allElementsInRange (this=0x8d8dbb0, model=0xbff76c2c,
smallest=9.9999999999999995e-21, largest=1e+20, check=15)
at ClpPackedMatrix.cpp:2368
#1 0x081ee330 in ClpPresolve::presolvedModel (this=0xbff766a0,
si=@0xbff76c2c, feasibilityTolerance=1e-08, keepIntegers=false,
numberPasses=5, dropNames=true, doRowObjective=false) at
ClpPresolve.cpp:97
#2 0x08260f59 in ClpSimplex::initialSolve (this=0xbff76c2c,
options=@0xbff76f80) at ClpSolve.cpp:590
#3 0x081ae2a7 in OsiClpSolverInterface::initialSolve (this=0x8d8d288)
at OsiClpSolverInterface.cpp:274
and here's a partial traceback at the failed assertion:
#0 0x00edf402 in __kernel_vsyscall ()
#1 0x00324f90 in raise () from /lib/libc.so.6
#2 0x00326678 in abort () from /lib/libc.so.6
#3 0x0031e269 in __assert_fail () from /lib/libc.so.6
#4 0x08071a56 in CoinPackedMatrix::removeGaps (this=0x8d98c60)
at CoinPackedMatrix.cpp:604
#5 0x081f3fd2 in ClpPresolve::gutsOfPresolvedModel (this=0xbff766a0,
originalModel=0xbff76c2c, feasibilityTolerance=1e-08,
keepIntegers=false,
numberPasses=5, dropNames=true, doRowObjective=false)
at ClpPresolve.cpp:1718
#6 0x081ee36d in ClpPresolve::presolvedModel (this=0xbff766a0,
si=@0xbff76c2c, feasibilityTolerance=1e-08, keepIntegers=false,
numberPasses=5, dropNames=true, doRowObjective=false)
at ClpPresolve.cpp:102
#7 0x08260f59 in ClpSimplex::initialSolve (this=0xbff76c2c,
options=@0xbff76f80) at ClpSolve.cpp:590
#8 0x081ae2a7 in OsiClpSolverInterface::initialSolve (this=0x8d8d288)
at OsiClpSolverInterface.cpp:274
As a work-around (which may not accord with your design philosophy), I
modified our copy of the COIN source as follows: I added
int really_compress(double threshold);
to CoinPackedMatrix (in CoinUtils/src/CoinPackedMatrix.hpp),
changed line 2368 ofClp/src/ClpPackedMatrix.cpp to
matrix_->really_compress(smallest);
and added the following implementation of really_compress to
CoinUtils/src/CoinPackedMatrix.cpp:
int
CoinPackedMatrix::really_compress(double threshold)
{
CoinBigIndex i, j, k, k0, m, n, nelim;
m = majorDim_;
for (i = k = nelim = 0; i < m; i++) {
j = start_[i];
start_[i] = k0 = k;
for (n = j + length_[i]; j < n; j++) {
if (fabs(element_[j])>=threshold) {
element_[k]=element_[j];
index_[k++]=index_[j];
} else {
++nelim;
}
}
length_[i] = k - k0;
}
start_[m] = k;
size_ -= nelim;
return nelim;
}
--
Ticket URL: <https://projects.coin-or.org/Clp/ticket/3>
COIN-OR Linear Programming Solver <http://projects.coin-or.org/Clp>
A linear programming solver.
More information about the Clp-tickets
mailing list