[Osi] OsiCpx writeLp not working
Matthew Galati
magh at lehigh.edu
Mon Jun 2 13:01:26 EDT 2008
If I addCols to my OsiCpx object -- it correctly keeps the information
in memory, however when I call writeLp it calls the native Osi writer
and does not seem to have my new columns - it only has the original
problem. I assume this once again has something to do with cached
information.
One quick fix suggestion -- use Cpx's native LP writer just like we do
for MPS. This is suggested in ticket 61.
void OsiCpxSolverInterface::writeLp(const char *filename,
const char *extension,
double epsilon,
int numberAcross,
int decimals,
double objSense,
bool useRowNames) const
{
debugMessage("OsiCpxSolverInterface::writeLp(%s, %s, %g)\n", filename,
extens\
ion, objSense);
// *FIXME* : this will not output ctype information to the MPS file
char filetype[4] = "LP";
std::string f(filename);
std::string e(extension);
std::string fullname = f + "." + e;
int err = CPXwriteprob( env_, getMutableLpPtr(), const_cast<char*>(
fullname.\
c_str() ), filetype );
checkCPXerror( err, "CPXwriteprob", "writeLp" );
}
More information about the Osi
mailing list