Hi guys,<div><br></div><div>Well it does seem a shame that CLP is so wired into CBC, but given how CBC developed and given most peoples needs, its fairly understandable.</div><div><br></div><div>Do you think that it would be possible to "emulate" CLP to a certain extent?</div>
<div><br></div><div>I've made a simple LP solver, lets call it XYZ. So far (to use VS terminology) I have two projects, libXYZ and libOsiXYZ.</div><div>libOsiXYZ has one class that inherits from OsiSolverInterface, and to start off with I just implemented dummy functions for all the required virtual functions.</div>
<div>I then ran the minimum.cpp example over and over with a linear (non-integer) programme and implemented all the required functions until I succesfully solved the LP.</div><div><br></div><div>Obviously this didn't make use of any of CBC's IP solving techniques, so that was the next step. Seeing that there was so much CLP-specific code, I thought it might be best to remove it so I don't implement more than the bare minimum number of features to get my LP solver usable.</div>
<div><br></div><div>However my own experiments with this and what Lou said have cast some doubt on that plan... Is it desirable for CBC to be LP-solver agnostic? It seems some work has been done in this direction so far, but its far from complete.</div>
<div><br></div><div>I guess what I'm asking is - should I just forget about trying to get my LP solver working? I don't mind if CLP is still compiled into the project, I just don't want to ever be used to solve an LP.</div>
<div><br></div><div>Cheers,</div><div>Iain</div><div><br><div class="gmail_quote">On 25 January 2011 18:45, Ted Ralphs <span dir="ltr"><<a href="mailto:ted@lehigh.edu">ted@lehigh.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Ian,<br>
<br>
What platform are you building on? Are you using the autotools? In<br>
general, editing CbcConfig is probably not going to get you where you<br>
want to go. Depending on exactly how you've built and installed Cbc,<br>
the line you're editing is most likely be inside a block that is being<br>
ignored because HAVE_CONFIG_H is defined. Even if not, I believe that<br>
the line<br>
<div class="im"><br>
#define COIN_HAS_CLP 0<br>
<br>
</div>still defines COIN_HAS_CLP. What you would want to do in principle is<br>
to delete the line altogether or even put<br>
<br>
#undef COIN_HAS_CLP<br>
<br>
If you're using the autotools, there are options to configure that<br>
will build Cbc with alternative solvers, but if I'm not mistaken,<br>
these options are mostly not working at this point. Lou Hafer (cc'd)<br>
has worked extensively on getting Cbc to work with other solvers and<br>
will be able to say for sure (and save you a lot of trouble going down<br>
blind alleys). With Visual C++, there is a separate solutions file<br>
that builds Cbc with alternative solvers. If you search the mailing<br>
list, you should find some posts about this or I'm sure Lou will also<br>
be able to let you know about it.<br>
<br>
Cheers,<br>
<br>
Ted<br>
<div><div></div><div class="h5"><br>
On Mon, Jan 24, 2011 at 10:06 PM, Iain Dunning <<a href="mailto:iaindunning@gmail.com">iaindunning@gmail.com</a>> wrote:<br>
> Hello,<br>
> I've been investigating the use of LP solvers other than CLP with CBC, and<br>
> I've hit a bit of a snag.<br>
> In CbcConfig, there are 2 lines:<br>
><br>
> /* Define to 1 if the Clp package is used */<br>
> #define COIN_HAS_CLP 1<br>
><br>
> As I am compiling the "minimum.cpp" example with an LP solver that isn't CLP<br>
> (i.e. #include "OsiXYZSolverInterface.hpp"), I figured I should set this to<br>
> zero<br>
><br>
> #define COIN_HAS_CLP 0<br>
><br>
> I re-compiled, and I happened to being stepping through when I noticed code<br>
> that (I think) shouldn't of been compiled, was compiled!<br>
><br>
> As an example, right near the start of void CbcModel::branchAndBound():<br>
><br>
> ...<br>
> ...<br>
> #ifdef COIN_HAS_CLP<br>
> {<br>
> OsiClpSolverInterface * clpSolver = dynamic_cast<OsiClpSolverInterface *><br>
> (solver_);<br>
> if (clpSolver) {<br>
> // pass in disaster handler<br>
> CbcDisasterHandler handler(this);<br>
> ...<br>
> ...<br>
><br>
><br>
> Because COIN_HAS_CLP is still defined, the code still compiles. I can't help<br>
> but feel this is _not_ the intended behaviour...<br>
> Should it not be:<br>
> #if COIN_HAS_CLP == 1<br>
> or maybe just<br>
> #if COIN_HAS_CLP<br>
> ?<br>
> Cheers,<br>
> Iain Dunning<br>
> University of Auckland<br>
</div></div>> _______________________________________________<br>
> Cbc mailing list<br>
> <a href="mailto:Cbc@list.coin-or.org">Cbc@list.coin-or.org</a><br>
> <a href="http://list.coin-or.org/mailman/listinfo/cbc" target="_blank">http://list.coin-or.org/mailman/listinfo/cbc</a><br>
><br>
><br>
<font color="#888888"><br>
<br>
<br>
--<br>
Dr. Ted Ralphs<br>
Associate Professor, Lehigh University<br>
(610) 628-1280<br>
ted 'at' lehigh 'dot' edu<br>
<a href="http://coral.ie.lehigh.edu/~ted" target="_blank">coral.ie.lehigh.edu/~ted</a><br>
</font></blockquote></div><br><br clear="all"><br>-- <br><font face="'courier new', monospace">Iain Dunning<br>Email: <a href="mailto:iaindunning@gmail.com" target="_blank">iaindunning@gmail.com</a><br>Web: <a href="http://www.iaindunning.com/" target="_blank">http://www.iaindunning.com/</a></font><br>
<br>
</div>