[FlopCpp] Sets in FlopC++
Tim Hultberg
Tim.Hultberg at eumetsat.int
Wed Apr 25 05:29:12 EDT 2007
Hello Shankar,
you can accomplish the same in FLOPC++ by using a two-dimensional
subset:
MP_set A(nbrA);
MP_set B(nbrB);
MP_subset<2> AB(A,B);
now insert elements in to get AB = {(a,b) in A*B | b in B[a]}
Then in expressions where A is bound (to a) and B is free, AB(A,B)
gives you the elements in B[a]
(as for example in
Constraint(A) = sum(AB(A,B), x[B]) <= h(A);
)
If you have any further doubts or problems doing this in practice dont
hesitate to ask again.
Cheers, Tim
>>> Dharmashankar Subramanian <dharmash at us.ibm.com> 25/04/2007 03:11
>>>
Hello Group,
Can someone please point out how to define sets that are indexed by the
elements of a given set?
For example, in AMPL, one may have:
set A;
set B{A};
In other words, the above AMPL syntax allows us to associate a set
B[a],
corresponding to each element a belongin to set A.
How may one accomplish the same, using FLOPC++?
Thanks,
Shankar
-------------------------------------------------------------
Dharmashankar Subramanian
Research Staff Member,
Analytic Models & Architecture
Math Sciences Department
Route 134, IBM T.J. Watson Research Center,
Yorktown Heights, NY 10598
Phone: 914-945-1588
More information about the FlopCpp
mailing list