[Coin-lpsolver] bug
Bozhena Bidyuk
bbidyuk at dcse.com
Tue Mar 15 18:00:21 EST 2005
John,
I have come across a bug that has caused major memory problems for me.
Could you please fix it for future releases?
Location: ClpNonLinearCost.hpp
In lines 83-84
if (lower[iSequence]>-1.0e20)
put++;
if (upper[iSequence]<1.0e20)
put++;
put is incremented based on bounds 1.0e20 and -1.0e20.
Then arrays are allocated based on precomputed size put:
lower_ = new double [put];
cost_ = new double [put];
But then in line 101:
for (iSequence=0;iSequence<numberTotal1;iSequence++) {
if (!always4) {
if (lower[iSequence]>-COIN_DBL_MAX) {
The lower[iSequence] is compared to -COIN_DLB_MAX=-DBL_MAX=-1.7976931348623158e+308
Needless to say that this causes problems when you have many constraints that are "unbounded"
with a lower bound value between -1.0e20 and -1.7976931348623158e+308.
(The upper bound is fine:
if (upper[iSequence]<1.0e20) {
)
Thanks.
Bozhena
More information about the Clp
mailing list