mpsi - <= ub[j]; v var ix{j in K} integer...

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 with 'MARKER' lines indicating integer # variables: like mps.mod, this is short, but it may # change the row order (which could affect pivot choice # by simplex-based solvers). # # Use the awk script "m2ai" 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 set K within J; #integer variables 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 diff K} >= 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: &lt;= ub[j]; v var ix{j in K} integer &gt;= if lb[j] &lt;= -1.7e38 then -Infinity else lb[j] &lt;= ub[j]; set zork := setof{i in I1} (i,ctype[i]); s var xx{j in J} = if j in K then ix[j] else x[j]; v minimize Obj{(i,'N') in zork}: sum{(i,j) in Aij} A[i,j]*xx[j]; m E{(i,'E') in zork}: sum{(i,j) in Aij} A[i,j]*xx[j] == b[i]; L{(i,'L') in zork}: sum{(i,j) in Aij} A[i,j]*xx[j] &lt;= b[i]; G{(i,'G') in zork}: sum{(i,j) in Aij} A[i,j]*xx[j] &gt;= b[i]; LR{(i,'LR') in zork}: b[i] - db[i] &lt;= sum{(i,j) in Aij} A[i,j]*xx[j] &lt;= b[i]; GR{(i,'GR') in zork}: b[i] + db[i] &gt;= sum{(i,j) in Aij} A[i,j]*xx[j] &gt;= b[i]; G option linelim 1;...
View Full Document

This note was uploaded on 04/01/2011 for the course CO 370 taught by Professor Henry during the Winter '11 term at Waterloo.

Ask a homework question - tutors are online