[Cbc] defining a custom cut generator

John Forrest john.forrest at fastercoin.com
Tue May 10 08:57:05 EDT 2016


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.
>
> CustomCutGenerator::CustomCutGenerator() : CglCutGenerator() { }
>
> CustomCutGenerator::CustomCutGenerator(constCustomCutGenerator& other) {}
>
> CustomCutGenerator::~CustomCutGenerator()
>
> {}
>
> std::stringCustomCutGenerator::generateCpp(FILE* file)
>
> {
>
> return"customCutGenerator";
>
> }
>
> voidCustomCutGenerator::generateCuts(constOsiSolverInterface&si, 
> OsiCuts&cs, constCglTreeInfoinfo)
>
> {}
>
> CglCutGenerator* CustomCutGenerator::clone() const
>
> {
>
> returnnewCustomCutGenerator();
>
> }
>
> CustomCutGenerator& 
> CustomCutGenerator::operator=(constCustomCutGenerator& rhs) {
>
> return*this;
>
> }
>
> CustomCutGenerator implements CglCutGenerator. Any help why this 
> happens and/or how to fix it would be welcomed. Especially since the 
> user guide chapter on cuts is empty. Feel free to ask for more 
> information.
>
> I am using Cbc 2.9.8 and Microsoft visual C++ 2013.
>
> Thanks
>
> Tobias
>
>
>
> _______________________________________________
> Cbc mailing list
> 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/20160510/8145bb20/attachment-0001.html>


More information about the Cbc mailing list