[Cbc] defining a custom cut generator

Tobias Stengel Tobias.Stengel at locom.de
Tue May 17 04:19:48 EDT 2016


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
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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20160517/762b4d0c/attachment.html>


More information about the Cbc mailing list