[Cbc] defining a custom cut generator

Tobias Stengel Tobias.Stengel at locom.de
Tue May 10 08:02:12 EDT 2016


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(const CustomCutGenerator & other) {}

             CustomCutGenerator::~CustomCutGenerator()
             {}

             std::string CustomCutGenerator::generateCpp(FILE* file)
             {
                    return "customCutGenerator";
             }

             void CustomCutGenerator::generateCuts(const OsiSolverInterface &si, OsiCuts &cs, const CglTreeInfo info)
             {}

             CglCutGenerator* CustomCutGenerator::clone() const
             {
                    return new CustomCutGenerator();
             }

             CustomCutGenerator & CustomCutGenerator::operator=(const CustomCutGenerator& 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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.coin-or.org/pipermail/cbc/attachments/20160510/7742d3ed/attachment.html>


More information about the Cbc mailing list