[Coin-lpsolver] bug

John J Forrest jjforre at us.ibm.com
Wed Mar 16 10:37:29 EST 2005


Bozhena,

I think it is okay now.

John Forrest



"Bozhena Bidyuk" <bbidyuk at dcse.com> 
Sent by: coin-lpsolver-bounces at list.coin-or.org
03/15/2005 06:00 PM

To
<Coin-lpsolver at list.coin-or.org>
cc

Subject
[Coin-lpsolver] bug






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




_______________________________________________
Coin-lpsolver mailing list
Coin-lpsolver at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/coin-lpsolver

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/clp/attachments/20050316/243048cd/attachment.html>


More information about the Clp mailing list