[Osi] Problem building examples with OSI/CLP

Stefan Vigerske stefan at math.hu-berlin.de
Sat Jul 2 07:25:08 EDT 2011


Hi,

> Hi There,
>
> Thanks to Ted Ralphs for answering my question last week about choosing a package for my project.  I'm going to try using OSI and CLP.  I have some very basic questions about getting set up.  i haven't been able to find this information after looking around the mail lists.
>
> 1.) There is an Osi subdirectory when I install Clp.  Is that all I need, or do I also need to install the Osi project?  If I do install and build the Osi project there isn't mention of Clp.  For example, the solver directories are:
>
> Osi OsiCommonTest OsiCpx OsiGlpk OsiGrb  OsiMsk OsiSpx OsiXpr
>
> so I'm guessing I just use what is installed by Clp.

You also need Osi, because it implements the Osi base class and other 
helper classes. These are in the src/Osi subdirectory of Osi.
Clp only has the OsiClp class, which derives from the general 
OsiSolverInterface in Osi.

> 2.) I can't get the examples in coin-Clp/Osi/examples to build.  The README seems out of date.  Could someone detail how I would build build.cpp, for example? (I'm using Mac OSX.) The file build.cpp starts out:
>
> // ________________________________________
>
> #include<iostream>
> #include OSIXXXhpp
> #include "CoinPackedMatrix.hpp"
> #include "CoinPackedVector.hpp"
>
> int
> main(void)
> {
>     // Create a problem pointer.  We use the base class here.
>     OsiSolverInterface *si;
>
>     // When we instantiate the object, we need a specific derived class.
>     si = new OSIXXX;
>
> // ________________________________________
>
> I'm not sure what to substitute for XXX.  There is no file that I can find fitting OSIXXX.hpp   There isn't a OsiClp.hpp either, which I might have guessed it would be.  What class to I instantiate with the new statement?

If you build Osi with Glpk, Cplex, Gurobi, Mosek, Soplex, or Xpress, 
then the Makefile that is generated by configure should define OSIXXXhpp 
and OSIXXX. It is set to one of those Osi interfaces that are available 
for Osi. Since OsiClp is not part of Osi anymore (but moved to Clp), it 
is not available there, but it should not be difficult to adapt the 
Makefile to define OSIXXXhpp and OSIXXX in a way that Clp is used.
Some more documentation is available at
https://projects.coin-or.org/BuildTools/wiki/user-examples

> 3).  Does using OSI and CLP together provide any benefits if I don't plan on using any other solvers?  I realize the idea is to provide a layer of solver independence.  If I'm not too worried about that, does it provide extra functionality over raw CLP?  Is there any CLP functionality that is missing from OSI+CLP?

If you do not need solver independence, then I think using Clp directly 
is the better choice. You would not have to struggle with limitations 
imposed by Osi then.

Stefan

> 4).  Are there any examples beyond coin-Clp/Osi/examples?  It would be nice to have an example more like coin-Clp/Clp/examples/addRows.cpp that gives more detail on building a problem from scratch.
>
> Thanks very much,
> Craig Schmidt
>
>
>
>
>
> _______________________________________________
> Osi mailing list
> Osi at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/osi




More information about the Osi mailing list