coinRead

Read a MPS, QPS, GMPL, GAMS or LP file into Matlab

Syntax

prob = coinRead(filename)

prob = coinRead(filename,filetype)

prob = coinRead(filename,filetype,print)

Description

Read a LP, MILP or QP into Matlab. Nonlinear problems are not supported.

prob = coinRead(filename) reads the file specified by filename and creates an optiprob problem. If you supply only a filename the file must be on Matlab's path in order for this function to find it. Otherwise if you supply a full path + filename, it may reside anywhere on your PC. You must supply the file extension using this method.

prob = coinRead(filename,filetype) allows the user to enter just the filename (without an extension), and manually specify the file type (e.g. 'mps').

prob = coinRead(filename,filetype,print) will also print headings found plus any errors encountered during reading with print = 1. Note not all file types support text output, in which case it will be ignored.

Important Notes

Routines for reading MPS, QPS, GAMS and LP problems use CoinUtils.

Routines for reading GMPL problems use GLPK.

If the routine fails check the error messages by enabling print. If it still doesn't work the error may reside in the underlying code, in which case I cannot fix it. You may like to report this to the original authors. Also note the GAMS reader is new code and may not work for all GAMS files.

Examples

A number of small examples are supplied with the toolbox in the folder OPTI/Test Problems/ which can be used for testing.

Reading a MPS file

If a file extension is supplied, this dictates the file type.

>> prob = coinRead('testLP.mps')

Reading a QPS file

You may also supply the file type manually.

>> prob = coinRead('testQP','qps')