[Cbc] Using LP solvers other than CLP
Iain Dunning
iaindunning at gmail.com
Mon Jan 24 22:06:41 EST 2011
Hello,
I've been investigating the use of LP solvers other than CLP with CBC, and
I've hit a bit of a snag.
In CbcConfig, there are 2 lines:
/* Define to 1 if the Clp package is used */
#define COIN_HAS_CLP 1
As I am compiling the "minimum.cpp" example with an LP solver that isn't CLP
(i.e. #include "OsiXYZSolverInterface.hpp"), I figured I should set this to
zero
#define COIN_HAS_CLP 0
I re-compiled, and I happened to being stepping through when I noticed code
that (I think) shouldn't of been compiled, was compiled!
As an example, right near the start of void CbcModel::branchAndBound():
...
...
#ifdef COIN_HAS_CLP
{
OsiClpSolverInterface * clpSolver = dynamic_cast<OsiClpSolverInterface *>
(solver_);
if (clpSolver) {
// pass in disaster handler
CbcDisasterHandler handler(this);
...
...
Because COIN_HAS_CLP is still defined, the code still compiles. I can't help
but feel this is _not_ the intended behaviour...
Should it not be:
#if COIN_HAS_CLP == 1
or maybe just
#if COIN_HAS_CLP
?
Cheers,
Iain Dunning
University of Auckland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/cbc/attachments/20110125/b9011072/attachment.html
More information about the Cbc
mailing list