[Osi] OsiCpx writeLp not working

Matthew Galati magh at lehigh.edu
Wed Jun 4 15:16:58 EDT 2008


Note/Warning: although using CPX's built-in LP works. It can be 
extremely confusing if you plan to use it for debugging. CPX apparently 
does a lot of internal matrix manipulation that can cause your problem 
to look very different from one iteration to another -- i.e., you could 
just change one row bound and go from 100 'L' constraints to 100 'E' 
constraint with 100 extra slack vars.

I suspect this, once again, is related to caching options.

> 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" );
> }
>
>
> _______________________________________________
> Osi mailing list
> Osi at list.coin-or.org
> http://list.coin-or.org/mailman/listinfo/osi
>   





More information about the Osi mailing list