help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] how to defne an array (something like pointer to pointer


From: Maryam Ahmadi
Subject: Re: [Help-glpk] how to defne an array (something like pointer to pointer in C)
Date: Tue, 12 May 2009 05:19:27 -0700 (PDT)

thank you all,it worked well,but i have another question:

i have a parameter Ec: AB BC CD DE:=
AB 0 1 1 0
BC 1 0 1 1
CD 1 1 0 1
DE 0 1 1 0;

and it means that for example nodes AB and BC are connected, and AB and CD
are also connected. Ec has a 1 value for each two nodes that are connected.

the problem is that i want to define a var x like this:
var x {u in Vc, v in Vc} binary >=0; ""if (u,v) in Ec""
and we have: Vc := AB BC CD DE;

i mean i want to have var x just for those pairs of Vc that have value 1 in
Ec, i want to define something like this:
if EC[u,v]==1 then var x {u in Vc, v in Vc} binary >=0;

but i don't know how to write if clauses.

i'd be really grateful if you could help me with this problem too.

Many thanks.



-- 
View this message in context: 
http://www.nabble.com/how-to-defne-an-array-%28something-like-pointer-to-pointer-in-C%29-tp23479009p23501468.html
Sent from the Gnu - GLPK - Help mailing list archive at Nabble.com.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]