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 &quot;emulate&quot; CLP to a certain extent?</div>
<div><br></div><div>I&#39;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&#39;t make use of any of CBC&#39;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&#39;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&#39;m asking is - should I just forget about trying to get my LP solver working? I don&#39;t mind if CLP is still compiled into the project, I just don&#39;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">&lt;<a href="mailto:ted@lehigh.edu">ted@lehigh.edu</a>&gt;</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&#39;ve built and installed Cbc,<br>
the line you&#39;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&#39;re using the autotools, there are options to configure that<br>
will build Cbc with alternative solvers, but if I&#39;m not mistaken,<br>
these options are mostly not working at this point. Lou Hafer (cc&#39;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&#39;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 &lt;<a href="mailto:iaindunning@gmail.com">iaindunning@gmail.com</a>&gt; wrote:<br>
&gt; Hello,<br>
&gt; I&#39;ve been investigating the use of LP solvers other than CLP with CBC, and<br>
&gt; I&#39;ve hit a bit of a snag.<br>
&gt; In CbcConfig, there are 2 lines:<br>
&gt;<br>
&gt; /* Define to 1 if the Clp package is used */<br>
&gt; #define COIN_HAS_CLP 1<br>
&gt;<br>
&gt; As I am compiling the &quot;minimum.cpp&quot; example with an LP solver that isn&#39;t CLP<br>
&gt; (i.e. #include &quot;OsiXYZSolverInterface.hpp&quot;), I figured I should set this to<br>
&gt; zero<br>
&gt;<br>
&gt; #define COIN_HAS_CLP 0<br>
&gt;<br>
&gt; I re-compiled, and I happened to being stepping through when I noticed code<br>
&gt; that (I think) shouldn&#39;t of been compiled, was compiled!<br>
&gt;<br>
&gt; As an example, right near the start of void CbcModel::branchAndBound():<br>
&gt;<br>
&gt; ...<br>
&gt; ...<br>
&gt; #ifdef COIN_HAS_CLP<br>
&gt; {<br>
&gt;   OsiClpSolverInterface * clpSolver = dynamic_cast&lt;OsiClpSolverInterface *&gt;<br>
&gt; (solver_);<br>
&gt;   if (clpSolver) {<br>
&gt;     // pass in disaster handler<br>
&gt;     CbcDisasterHandler handler(this);<br>
&gt; ...<br>
&gt; ...<br>
&gt;<br>
&gt;<br>
&gt; Because COIN_HAS_CLP is still defined, the code still compiles. I can&#39;t help<br>
&gt; but feel this is _not_ the intended behaviour...<br>
&gt; Should it not be:<br>
&gt; #if COIN_HAS_CLP == 1<br>
&gt; or maybe just<br>
&gt; #if COIN_HAS_CLP<br>
&gt; ?<br>
&gt; Cheers,<br>
&gt; Iain Dunning<br>
&gt; University of Auckland<br>
</div></div>&gt; _______________________________________________<br>
&gt; Cbc mailing list<br>
&gt; <a href="mailto:Cbc@list.coin-or.org">Cbc@list.coin-or.org</a><br>
&gt; <a href="http://list.coin-or.org/mailman/listinfo/cbc" target="_blank">http://list.coin-or.org/mailman/listinfo/cbc</a><br>
&gt;<br>
&gt;<br>
<font color="#888888"><br>
<br>
<br>
--<br>
Dr. Ted Ralphs<br>
Associate Professor, Lehigh University<br>
(610) 628-1280<br>
ted &#39;at&#39; lehigh &#39;dot&#39; 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="&#39;courier new&#39;, 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>