mps1 - <= ub[j< set zork:= setof{i in I1(i,ctype[i s...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
# AMPL model for an MPS file: this one preserves row order. # Use the awk script "m2a" to turn an MPS file into suitable data. # set Aij dimen 2; #constraint matrix indices set I1; # to allow empty rows set J := setof{(i,j) in Aij} j; #columns param A{Aij}; #constraint matrix nonzeros # param b{I1} default 0; #right-hand side param db{I1}; #for ranges # set ctypes := {'N', 'L', 'E', 'G', 'LR', 'GR'}; s param ctype{I1} symbolic within ctypes; p param lb{J} default 0; param ub{J} default Infinity; p var x{j in J} >= if lb[j] <= -1.7e38 then -Infinity else lb[j]
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: <= ub[j]; < set zork := setof{i in I1} (i,ctype[i]); s c{i in I1: ctype[i] != 'N'}: c (if ctype[i] == 'N' || ctype[i] == 'L' then -Infinity else if ctype[i] == 'G' || ctype[i] == 'GR' || ctype[i] == 'E' then b[i] else b[i] - db[i]) e <= sum{(i,j) in Aij} A[i,j]*x[j] <= < (if ctype[i] == 'N' || ctype[i] == 'G' then Infinity else if ctype[i] == 'L' || ctype[i] == 'LR' || ctype[i] == 'E' then b[i] else b[i] + db[i]); e minimize Obj{(i,'N') in zork}: sum{(i,j) in Aij} A[i,j]*x[j];...
View Full Document

Ask a homework question - tutors are online