|
| From: | Leenders, Bob \(RTIO\) |
| Subject: | [Help-glpk] ordered sets query |
| Date: | Fri, 19 Oct 2007 16:23:49 +0400 |
I have a piece of AMPL code I am trying
to rewrite in MATHPROG that uses ord()
subject to g1{k in TT, i in Pat1[k], j in Patt1[k]:ord(i)=ord(j)}:
-10<=sum{(i,t) in PatP1[k]}
R[i]*x[i,t]-sum{(j,s) in PatPP1[k]} R[j]*x[j,s] <=10;
The ord part looks at the ordered set (Pat1[k], Patt1[k]) and matches those two
set
members individually.
So instead of that ord(i) and (j) it looks
like I need another parameter param ref{i in
1..card(S)}, symbolic, in S;
And param
a{S};... a[ref[i]]
... # means a[i-th element of S].
I need some
wayto say a[ref[i]]=a[ref[j]].
Any thoughts as to how to rewrite the initial
statement?
Bob
This email (including all attachments) is the sole property of Rio Tinto
Limited and may be confidential. If you are not the intended recipient, you
must not use or forward the information contained in it. This message may not
be reproduced or otherwise republished without the written consent of the
sender. If you have received this message in error, please delete the e-mail
and notify the sender.
|
I have a piece of AMPL code I am trying
to rewrite in MATHPROG that uses ord() subject to g1{k in TT, i in Pat1[k], j in Patt1[k]:ord(i)=ord(j)}: -10<=sum{(i,t) in PatP1[k]}
R[i]*x[i,t]-sum{(j,s) in PatPP1[k]} R[j]*x[j,s] <=10; The ord part looks at the ordered set (Pat1[k], Patt1[k]) and matches those two set
members individually. So instead of that ord(i) and (j) it looks
like I need another parameter param ref{i in
1..card(S)}, symbolic, in S; And param
a{S}; I need some
way to say a[ref[i]]=a[ref[j]]. Any thoughts as to how to rewrite the initial
statement? Bob This email (including all attachments) is the sole property of Rio Tinto Limited and may be confidential. If you are not the intended recipient, you must not use or forward the information contained in it. This message may not be reproduced or otherwise republished without the written consent of the sender. If you have received this message in error, please delete the e-mail and notify the sender.
|
| [Prev in Thread] | Current Thread | [Next in Thread] |