next up previous contents
Next: Converting AMPL nl Files Up: OSModelInterfaces Previous: OSModelInterfaces   Contents

Converting MPS Files

The MPS standard is still a popular format for representing linear and integer programming problems. In OSModelInterfaces, there is a class OSmps2osil that can be used to convert files in MPS format into the OSiL standard. It is used as follows.

OSmps2osil *mps2osil = NULL;
DefaultSolver *solver  = NULL;
solver = new CoinSolver();
solver->sSolverName = "cbc";
mps2osil = new OSmps2osil(  mpsFileName);
mps2osil->createOSInstance() ;
solver->osinstance = mps2osil->osinstance;
solver->solve();

The OSmps2osil class constructor takes a string which should be the file name of the instance in MPS format. The constructor then uses the CoinUtils library to read and parse the MPS file. The class method createOSInstance then builds an in-memory osintance object that can be used by a solver.



Kipp Martin 2008-01-16