readmps — reads a file in MPS format
mps= readmps (file-name,bounds [,maxsizes]);
a string, the name of the mps file
2-vector
[lowbound,upbound]
, default lower and upper bounds
3-vector [maxm,maxn,maxnza]
Maximum number of contraints and variables, maximum number of
nonzeros entries in the LP constraint matrix. If omitted readmps
reads the file once just to compute these numbers.
tlist with following fields
integer (index of the objective row).
character string (Name of the objective).
character string (Name of the right hand side).
character string (Name of the ranges section).
character string (Name of the bounds section).
character string (Name of the LP problem).
character string column vector (Name of the rows).
character string row vector (Name of the columns).
integer vector, row types:
row type is "="
row type is ">="
row type is "<="
objective row
other free row
real matrix [hdrowcd,lnkrow]
with
real vector (Header to the linked list of rows with the same codes).
integer vector (Linked list of rows with the same codes).
real matrix [hdcolcd,lnkcol]
with
integer vector (Header to the linked list of columns with the same codes).
integer vector (Linked list of columns with the same codes).
integer vector (Row numbers of nonzeros in columns of matrix A.)
integer vector (Pointers to the beginning of columns of matrix A).
real vector (Array of nonzero elements for each column).
real vector ( Right hand side of the linear program).
real vector of constraint ranges.
real matrix [lbounds,ubounds]
with
full column vector of upper bounds
full column vector of lower bounds
full column vector of variable status
standard (non negative) variable
upper bounded variable
lower bounded variable
lower and upper bounded variable
minus infinity type variable i.e -inf<x<=u
plus infinity type variable i.e l<=x< inf
fixed type variable i.e l=x=u
free variable
Reads a file containing description of an LP problem
given in MPS format and returns a tlist
which describes the problem. It is an
interface with the program rdmps1.f
of hopdm (J. Gondzio).
For a description of the variables, see the file rdmps1.f.
MPS format is a standard ASCII medium for LP codes. MPS format is described in more detail in Murtagh's book:
Murtagh B. (1981). Advanced Linear Programming, McGrew-Hill, New York, 1981.
//Let the LP problem: //objective: // min XONE + 4 YTWO + 9 ZTHREE //constraints: // LIM1: XONE + YTWO < = 5 // LIM2: XONE + ZTHREE > = 10 // MYEQN: - YTWO + ZTHREE = 7 //Bounds // 0 < = XONE < = 4 // -1 < = YTWO < = 1 //Generate MPS file txt=['NAME TESTPROB' 'ROWS' ' N COST' ' L LIM1' ' G LIM2' ' E MYEQN' 'COLUMNS' ' XONE COST 1 LIM1 1' ' XONE LIM2 1' ' YTWO COST 4 LIM1 1' ' YTWO MYEQN -1' ' ZTHREE COST 9 LIM2 1' ' ZTHREE MYEQN 1' 'RHS' ' RHS1 LIM1 5 LIM2 10' ' RHS1 MYEQN 7' 'BOUNDS' ' UP BND1 XONE 4' ' LO BND1 YTWO -1' ' UP BND1 YTWO 1' 'ENDATA']; mputl(txt,TMPDIR+'/test.mps') //Read the MPS file P=readmps(TMPDIR+'/test.mps',[0 10^30]) disp(P)