coin-or / Cgl

Cut Generator Library
Other
24 stars 14 forks source link

CglKnapsackCover::deriveAKnapsack asserts when leMatrixRow has 0 element #8

Closed svigerske closed 5 years ago

svigerske commented 5 years ago

Issue created by migration from Trac.

Original creator: San

Original creation time: 2007-02-06 02:27:09

Assignee: fmargot

Version: release 0.5.1

Code asserted when attempting to transform a matrix with 0 elements. The fix is attached to this ticket.

At line 831:

    if (leMatrixRow.getNumElements() > 0)
    {
        std::transform(leMatrixRow.getElements(),
               leMatrixRow.getElements() + leMatrixRow.getNumElements(),
               leMatrixRow.getElements(),
               std::negate<double>());
    }
svigerske commented 5 years ago

Attachment CglKnapsackCover.cpp by San created at 2007-02-06 02:28:31

svigerske commented 5 years ago

Comment by fmargot created at 2007-02-06 18:43:57

Changing component from Cgl to CglKnapsackCover.

svigerske commented 5 years ago

Comment by fmargot created at 2007-02-06 18:45:05

Changing assignee from fmargot to @rlougee.

svigerske commented 5 years ago

Comment by @rlougee created at 2007-08-29 17:59:05

Changing status from new to assigned.

svigerske commented 5 years ago

Comment by @rlougee created at 2007-08-29 19:15:50

San: Do you have an example which triggered the bug? I'd like to test before committing the fix. Robin (robinlh@us.ibm.com)

svigerske commented 5 years ago

Comment by @rlougee created at 2007-09-24 15:07:57

The deriveAKnapsack() method was changed in the trunk version of CglKnapsackCover.cpp on 08/17/07 by John Forrest to return 0 if the number of elements in a row is zero.

{ // On investiagtion looks as if it can happen without being a bug if (numberElements==0) return 0; }

The fix will be included in the next point release.

svigerske commented 5 years ago

Comment by @rlougee created at 2007-09-24 15:07:57

Resolution: fixed

svigerske commented 5 years ago

Comment by @rlougee created at 2007-09-24 15:10:16

Second try to see what Trac will do with this formating in it's ticketing system...

{

if (numberElements==0) return 0;

}