[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-glpk] Single index for multidimensional sets
From: |
Mate Hegyhati |
Subject: |
[Help-glpk] Single index for multidimensional sets |
Date: |
Tue, 17 Jul 2012 15:30:07 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux i686; rv:13.0) Gecko/20120615 Thunderbird/13.0.1 |
Dear All,
is it somehow possible to use a single index symbol for addressing an
n-tuple? In one of my problems I have a 3 dimensional set, that is used
as a basis for other sets, etc. I'm trying to do something like this:
set S1;
set S2;
set S3 := setof {s1 in S1, s2 in S2: s1!=s2} (s1,s2);
param p{s1 in S1, s2 in S2}, default 3;
var x{s3 in S3}; # this is, that should be (s1,s2) in S3
s.t. constraint1 {s3 in S3}: # similar here
x[s3]>=p[s3];
s.t. constraint2{s1 in S1, s2 in S2: s1<s2}:
x[s1,s2] >= 2 * p[s1,s2];
It is not working, and according to the manual, an index should match
the dimension of the set. Is it somehow possible to avoid writing
(s1,s2) everywhere?
Thank You very much in advance, best regards,
Mate Hegyhati
hegyhati.vcf
Description: Vcard
signature.asc
Description: OpenPGP digital signature
- [Help-glpk] Single index for multidimensional sets,
Mate Hegyhati <=