[Coin-discuss] Problem in Osi method writeLp()...
Francois Margot
fmargot at andrew.cmu.edu
Tue Apr 4 10:32:37 EDT 2006
> The problem is in OsiClpSolverInterface, apparently. When
> OsiClpSolverInterface::writeLp() is called on line 98, it has
> objSense=0 and the objective function has not been flipped.
> The call setObjsense(-1.0) on line 91 is apparently ignored.
I now see the problem. It is that writeLp() is called with
default parameters.
In OsiSolverInterface.cpp, in the method
OsiSolverInterface::writeLpNative(FILE *fp,
char const * const * const rowNames,
char const * const * const columnNames,
const double epsilon,
const int numberAcross,
const int decimals,
const double objSense,
const bool useRowNames) const
Replace
if(getObjSense() * objSense < 0.0) {
by
double locObjSense = (objSense == 0 ? 1 : objSense);
if(getObjSense() * locObjSense < 0.0) {
Note that the method writeLp() in OsiClpSolverInterface should be
updated: its last parameter "bool changeNameOnRange" should be
"bool useRowNames". Moreover, OsiSolverInterface now has two
writeLp() methods, differing only in the first parameter. For reasons
unknown to me, the writeLp() function defined in OsiClpSolverInterface
apparently overloads both writeLp() functions from OsiSolverInterface.
It seems necessary to add a second writeLp() function in OsiClpSolverInterface
in order to use writeLp(FILE *, ...) for an OsiClpSolverInterface.
Francois
More information about the Coin-discuss
mailing list