[Cbc] defining a custom cut generator

Tobias Stengel Tobias.Stengel at locom.de
Thu May 19 03:34:58 EDT 2016


John,

yes, the bug goes away. Valgrind keeps quiet, too. Except that I used "= {}" instead of "= {0}". I changed that in my copy of Cbc as a workaround until a fixed version is released.
In case the real bug is hiding in the following if-else  statements it may not be sufficient and someone else may trigger it again.

Tobias

Von: John Forrest [mailto:john.forrest at fastercoin.com]
Gesendet: Mittwoch, 18. Mai 2016 17:54
An: Tobias Stengel <Tobias.Stengel at locom.de>
Betreff: Re: [Cbc] defining a custom cut generator

Tobias,

If you set switches and accuracyFlag to 0, does the bug go away?  Anyway it would obviously be more elegant to have

               int switches[30]={0};
               int accuracyFlag[30]={0};
               char doAtEnd[30]={0};

John Forrest
On 17/05/16 09:19, Tobias Stengel wrote:
Hello John,

I did some printf+valgrind debugging and found the following (for gcc+linux):

-          If (and only if) the custom cut generator is added, an uninitialised value is passed to the "TwoMirCuts" CbcCutGenerator::setInaccuracy

-          This value originates from CbcSolver.cpp, line 4880. I have no idea whether just a "= {}" is missing or if something goes wrong in the following if-else statements.


For Visual C++, with the "int accuracyFlag[30] = {};" the assert is still triggered with TwoMirCuts.switchOffIfLessThan() == 858993460. If the the switches array in CbcSolver, line 4879 is also initialised with " = {}", everything works fine.

As the arrays live on the stack, this could explain why switchOffIfLessThan() is reproducible 858993460 and why the behaviour depends on the compiler/compilerflags.

Nevertheless looks very strange to me that adding a custom cut generator changes the values passed to the TwoMirCuts generator.

Tobias

Von: Cbc [mailto:cbc-bounces at coin-or.org] Im Auftrag von John Forrest
Gesendet: Dienstag, 10. Mai 2016 14:57
An: cbc at list.coin-or.org<mailto:cbc at list.coin-or.org>
Betreff: Re: [Cbc] defining a custom cut generator

Tobias,

Odd.  By default the variable  switchOffIfLessThan_ in a CbcCutGenerator is zero.  This means that you would not get to 9401 as it would fail test -

 if (generator_[i]->switchOffIfLessThan() < 0) {

at line 9398.

What value is switchOffIfLessThan_ when assert happens?  You do not reference CbcCutGenerator so how is the generator being added to CbcModel?

John Forrest

On 10/05/16 13:02, Tobias Stengel wrote:
Hi all,

I am trying to define my on cut generator. My test problem is noswot problem from miplib 3. When I add the following generator (reduced from my generator) to my model, the assert "assert (iSwitch >= 0 && iSwitch < 2);" in CbcModel.cpp, line 9401 fails. If compiled in release mode (turning asserts off), the correct solution is found.

I am using Cbc 2.9.8 and Microsoft visual C++ 2013.


Thanks
Tobias





_______________________________________________

Cbc mailing list

Cbc at list.coin-or.org<mailto:Cbc at list.coin-or.org>

http://list.coin-or.org/mailman/listinfo/cbc





_______________________________________________

Cbc mailing list

Cbc at list.coin-or.org<mailto:Cbc at list.coin-or.org>

http://list.coin-or.org/mailman/listinfo/cbc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20160519/096d2ee3/attachment.html>


More information about the Cbc mailing list