There is an inhomogeneity between AMPL and MathProg in the way sets of
ordered pairs are being iterated over by two (or more) sum{} statements
which are linked by an iterator variable.

Consider the following sample:
---------------------------

set A :={1..5};
set B :={"b1", "b2", "b3", "b4", "b5"};

set D within {A,B} := {(1,"b2"), (1,"b3"), (1,"b5"), (3,"b3")};

var X {D};

minimize z:
 sum{a in (1..5)} sum {(a,b) in D} X[1,b];

---------------------------

AMPL generates:

MIN   X[1,b2] + 2 X[1,b3] + X[1,b5] 

MathProg generates:

MIN   5 X[1,b2] + 5 X[1,b3] + 5 X[1,b5] 

Obviously AMPL links the inner and outer sum{} statements by variable 'a'
and MathProg doesn't.

Bug or feature?

Dr. Peter Ingerfeld
MOPS Optimierungssysteme GmbH & Co KG






_______________________________________________
Help-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to