[OS] API change
    Kipp Martin 
    Kipp.Martin at ChicagoGSB.edu
       
    Fri Feb 29 10:53:07 EST 2008
    
    
  
Hi:
There has been a slight change to the Optimization Services 
DefaultSolver class in the trunk version.  This will get rolled into the 
next Stable and next Release.  Previously, a call to the solve() method 
would convert an OSInstance object into the appropriate data structure 
that is native to the solver being called AND it would also call a solve 
method.  For example, in
CoinSolver *solver  = NULL;
solver = new CoinSolver();
solver->sSolverName ="clp";
solver->osinstance = osinstance;
solver->solve();
the call to solve() results in a conversion of the OSInstance object 
osinstance into a COIN-OR data structure that is used by the COIN-OR 
solver Clp to solve a linear program.   This is now a two-step process and
solver->solve();
should be replaced by
solver->buildSolverInstance();
solver->solve();
This adds far greater flexibility for the user. See for example, the new 
test code in OS/examples/addCuts where the call to
solver->buildSolverInstance();
creates an OsiClpSolverInterface() and cuts are added using OsiCuts. 
The user can now interact directly with OsiSolverInterface and 
associated methods and options. This was not possible before.
The change applies to all COIN-OR solvers (including Ipopt which is not 
accessed through the COIN-OR Osi) supported by OS, i.e. if it is a 
COIN-OR solver, in your old code you now need
solver->buildSolverInstance();
prior to calling
solver->solve();
This change also applies to the LINDO solver interface. A call to
solver->buildSolverInstance();
builds the instance using the LINOD API.  The LINDO solver is used in 
the same manner as the COIN-OR.
Please let me know if this causes anyone problems.
Thanks
-- 
Kipp Martin
Professor of Operations Research
and Computing Technology
Graduate School of Business
University of Chicago
5807 South Woodlawn Avenue
Chicago, IL 60637
773-702-7456
kipp.martin at chicagogsb.edu
http://gsbkip.chicagogsb.edu
http://www.coin-or.org
    
    
More information about the OS
mailing list