[Coin-lpsolver] checkClear() in createRim() and NDEBUG compilation flag
Francois Margot
fmargot at andrew.cmu.edu
Sat Aug 13 06:49:54 EDT 2005
If I want to compile an optimized version of Clp (-O) should I use the
flag NDEBUG or not? In Makefile.Clp, I have:
ifeq ($(OptLevel),-g)
# CXXFLAGS += -DCLP_DEBUG
#CXXFLAGS += -DPRESOLVE_DEBUG=1
endif
ifeq ($(OptLevel),-O2)
# CXXFLAGS += -DNDEBUG
endif
meaning that NDEBUG is not used, even when optimization is set. Is this
correct?
Moreover, in ClpSimplex::createRim(), around lines 3362 in ClpSimplex.cpp,
I have
#ifndef NDEBUG
for (iRow=0;iRow<4;iRow++) {
int length =numberRows2+factorization_->maximumPivots();
if (iRow==3||objective_->type()>1)
length += numberColumns_;
assert(rowArray_[iRow]->capacity()==length);
rowArray_[iRow]->checkClear();
}
for (iColumn=0;iColumn<2;iColumn++) {
int length =numberColumns_;
if (iColumn)
length=CoinMax(numberRows2,numberColumns_);
assert(columnArray_[iColumn]->capacity()==length);
columnArray_[iColumn]->checkClear();
}
#endif
The code sometimes stops in the calls to
rowArray_[iRow]->checkClear();
columnArray_[iColumn]->checkClear();
Are these calls debugging checks only or is it a serious failure?
If the latter is true, can I simply clear the vectors and continue?
Francois
More information about the Clp
mailing list