1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
4
<LANGUAGE>eng</LANGUAGE>
6
<TYPE>Scilab Function</TYPE>
8
<SHORT_DESCRIPTION name="readmps"> reads a file in MPS format</SHORT_DESCRIPTION>
10
<CALLING_SEQUENCE_ITEM> mps= readmps (file-name,bounds [,maxsizes]); </CALLING_SEQUENCE_ITEM>
15
<PARAM_NAME>file-name</PARAM_NAME>
18
character string, path of the MPS file</SP>
22
<PARAM_NAME>bounds</PARAM_NAME>
25
<VERB>[lowbound,upbound]</VERB> , default lower ans upper bounds</SP>
29
<PARAM_NAME>maxsizes</PARAM_NAME>
31
<SP>: 3-vector <VERB>[maxm,maxn,maxnza]</VERB>
32
Maximum number of contraints and variables, maximum number of
33
nonzeros entries in the LP constraint matrix. If omitted readmps
34
reads the file once just to compute these numbers.</SP>
38
<PARAM_NAME>mps</PARAM_NAME>
40
<SP>: tlist with following fields</SP>
43
<PARAM_NAME>irobj</PARAM_NAME>
45
<SP>: integer (index of the objective row).</SP>
49
<PARAM_NAME>namec</PARAM_NAME>
51
<SP>: character string (Name of the objective).</SP>
55
<PARAM_NAME>nameb</PARAM_NAME>
57
<SP>: character string (Name of the right hand side).</SP>
61
<PARAM_NAME>namran</PARAM_NAME>
63
<SP>: character string (Name of the ranges section).</SP>
67
<PARAM_NAME>nambnd</PARAM_NAME>
69
<SP>: character string (Name of the bounds section).</SP>
73
<PARAM_NAME>name</PARAM_NAME>
75
<SP>: character string (Name of the LP problem).</SP>
79
<PARAM_NAME>rownames</PARAM_NAME>
81
<SP>: character string column vector (Name of the rows).
82
colnames : character string row vector (Name of the columns).</SP>
86
<PARAM_NAME>rowstat</PARAM_NAME>
88
<SP>: integer vector, row types:</SP>
91
<PARAM_NAME>1</PARAM_NAME>
93
<SP>row type is "="</SP>
97
<PARAM_NAME>2</PARAM_NAME>
99
<SP>: row type is ">="</SP>
103
<PARAM_NAME>3</PARAM_NAME>
105
<SP>: row type is "<="</SP>
109
<PARAM_NAME>4</PARAM_NAME>
111
<SP>: objective row</SP>
115
<PARAM_NAME>5</PARAM_NAME>
117
<SP>: other free row</SP>
124
<PARAM_NAME>rowcode</PARAM_NAME>
126
<SP>: real matrix <VERB>[hdrowcd,lnkrow]</VERB> with</SP>
129
<PARAM_NAME>hdrowcd</PARAM_NAME>
131
<SP>: real vector (Header to the linked list of rows with the same codes).</SP>
135
<PARAM_NAME>lnkrow</PARAM_NAME>
137
<SP>: integer vector (Linked list of rows with the same codes).</SP>
144
<PARAM_NAME>colcode</PARAM_NAME>
146
<SP>: real matrix <VERB>[hdcolcd,lnkcol]</VERB> with</SP>
149
<PARAM_NAME>hdcolcd</PARAM_NAME>
151
<SP>: integer vector (Header to the linked list of columns with the same codes).</SP>
155
<PARAM_NAME>lnkcol</PARAM_NAME>
157
<SP>: integer vector (Linked list of columns with the same codes).</SP>
164
<PARAM_NAME>rownmbs</PARAM_NAME>
166
<SP>: integer vector (Row numbers of nonzeros in columns of matrix A.)</SP>
170
<PARAM_NAME>colpnts</PARAM_NAME>
172
<SP>: integer vector (Pointers to the beginning of columns of matrix A).</SP>
176
<PARAM_NAME>acoeff</PARAM_NAME>
178
<SP>: real vector (Array of nonzero elements for each column).</SP>
182
<PARAM_NAME>rhs</PARAM_NAME>
184
<SP>:real vector ( Right hand side of the linear program).</SP>
188
<PARAM_NAME>ranges</PARAM_NAME>
190
<SP>: real vector of constraint ranges.</SP>
194
<PARAM_NAME>bounds</PARAM_NAME>
196
<SP>: real matrix <VERB>[lbounds,ubounds]</VERB> with</SP>
199
<PARAM_NAME>ubounds</PARAM_NAME>
201
<SP>: full column vector of upper bounds</SP>
205
<PARAM_NAME>lbounds</PARAM_NAME>
207
<SP>: full column vector of lower bounds</SP>
214
<PARAM_NAME>stavar</PARAM_NAME>
216
<SP>: full column vector of variable status</SP>
219
<PARAM_NAME>0</PARAM_NAME>
221
<SP>:standard (non negative) variable</SP>
225
<PARAM_NAME>1</PARAM_NAME>
227
<SP>: upper bounded variable</SP>
231
<PARAM_NAME>2</PARAM_NAME>
233
<SP>: lower bounded variable</SP>
237
<PARAM_NAME>3</PARAM_NAME>
239
<SP>: lower and upper bounded variable</SP>
243
<PARAM_NAME>4</PARAM_NAME>
245
<SP>: minus infinity type variable i.e -inf<x<=u</SP>
249
<PARAM_NAME>5</PARAM_NAME>
251
<SP>: plus infinity type variable i.e l<=x< inf</SP>
255
<PARAM_NAME>6</PARAM_NAME>
257
<SP>: fixed type variable i.e l=x=u</SP>
261
<PARAM_NAME>-k</PARAM_NAME>
263
<SP>: free variable</SP>
275
<P><VERB>readmps</VERB>.
276
Utility function: reads a file containing description of an LP problem
277
given in MPS format. It is an
278
interface with the program <VERB>rdmps1.f</VERB> of hopdm (J. Gondzio).
279
For a description of the variables, see the file rdmps1.f.</P>
281
MPS format is a standard ASCII medium for LP codes.
282
MPS format is described in more detail in Murtagh's book:</P>
284
Murtagh B. (1981). Advanced Linear Programming, McGrew-Hill,
290
//Let the LP problem:
292
// min XONE + 4 YTWO + 9 ZTHREE
294
// LIM1: XONE + YTWO < = 5
295
// LIM2: XONE + ZTHREE > = 10
296
// MYEQN: - YTWO + ZTHREE = 7
309
' XONE COST 1 LIM1 1'
311
' YTWO COST 4 LIM1 1'
313
' ZTHREE COST 9 LIM2 1'
316
' RHS1 LIM1 5 LIM2 10'
323
mputl(txt,TMPDIR+'/test.mps')
325
P=readmps(TMPDIR+'/test.mps',[0 10^30])
326
//Convert it to linpro format
328
//Solve it with linpro
329
[x,lagr,f]=linpro(LP(2:$))
334
<LINK>mps2linpro</LINK>