[Coin-discuss] Osi MPS import and row/col names

Leo Lopes leo at sie.arizona.edu
Tue May 4 12:37:20 EDT 2004


Hi Pierre,

    As an alternative, you might consider the FML interface libraries at:

http://gsbkip.uchicago.edu/fml/fml.html

    There is an mps2fml converter there, utilities for accessing coin 
solvers from the cmd line, and a simple event-based library you can use, 
including the following calls:

   virtual int onVariables(vector<std::string> const &label,
         vector<double> const &lb, vector<double> const &ub,
         vector<char> const &domain, vector<double> const &val ) {return 
0;};

   /// called when all the information on the constraints becomes available
   virtual int onConstraints(vector<std::string> const &label,
         vector<double> const &lhs, vector<double> const &rhs ) {return 0;};

Plus, there is a Writer class that allows you to output not only 
problems but also their solutions by specifying vectors.

The format is XML-based and the library includes the ability to apply 
XSLT transforms. With the distribution there is an example XSLT that 
converts a sparsity matrix to an SVG object.

File sizes (I knew you would ask) are no more than 30% larger than MPS 
files (sometimes smaller) in canonical form (i.e., with only the tags 
and no extra space for human readibility), and they compress much better 
than MPS.

Cheers,
Leo.

Lou Hafer wrote:

>Pierre,
>
>	You are correct, OSI does not provide for constraint or variable
>names at the interface.  A CoinMpsIO object does provide access to row and
>column names (via the rowName and colName methods). But there is no OSI
>method to provide access to the CoinMpsIO object.
>
>	It's hard to provide specific advice. I'd suggest that what you want
>is a readMps (and matching writeMps) that you control. You could derive a
>class from one of the solver interfaces and override readMps, or write a
>standalone readMps routine that called one of the standard OSI::loadProblem
>methods. You can probably borrow the bulk of the code from the readMps
>(writeMps) routine of any solver interface.
>
>	The issue is a little more interesting than it appears at first
>glance.  Names are necessary to write an MPS file. Right now this means that
>individual solver interfaces invent names for any rows and columns not loaded
>from an MPS input file. Arguably names are not useful to programs, and
>troublesome to manipulate, but they convey a lot more information to humans.
>
>						Lou
>
>_______________________________________________
>Coin-discuss mailing list
>Coin-discuss at www-124.ibm.com
>http://www-124.ibm.com/developerworks/oss/mailman/listinfo/coin-discuss
>  
>

-- 
========================================================================
Leonardo B. Lopes                                    leo at sie.arizona.edu 
Visiting Assistant Professor                               (520)626-1780
SIE - University of Arizona  http://www.sie.arizona.edu/faculty/leolopes





More information about the Coin-discuss mailing list