[Coin-discuss] Setting solver parameters in OSI

Brady Hunsaker hunsaker at engr.pitt.edu
Thu Sep 11 12:06:24 EDT 2003


On Thu, 2003-09-11 at 10:30, Jesper Hansen wrote:
> Hi
> 
> I'm solving an IP problem with use of OSI. Is there any easy way to set
> solver parameters in OSI?
> 
<snip>

For the additional CPLEX parameters, you need to do it directly using
the solver environment, as you suggested.  I don't use CPLEX regularly,
but looking at the OsiCpx code, it looks like the method 
  CPXENVptr OsiCpxSolverInterface::getEnvironmentPtr();
is what you want to get the environment pointer.  It looks like this is
a public method, so you should be able to use it directly.  Then you can
call the CPLEX parameter routines yourself.  Somebody more familiar with
OsiCpx please correct me if that's wrong.  

If you also need the LP pointer, use
  CPXLPptr OsiCpxSolverInterface::getLpPtr();

Part of the difficulty with having a common interface is the variety of
solver options and parameters.  As you noticed, OSI handles certain
parameters that are common to all solvers.  We do need to come up with a
long term solution to this problem, which will probably include more
options handled by the OSI.  Of course, even then there will be cases
when you'll need to fall back on this method for some solver-specific
options.

Let us know if you run into difficulties with this approach,

Brady




More information about the Coin-discuss mailing list