[FlopCpp] constraints over MP_Sets vs over MP_SubSets

Tim Hultberg Tim.Hultberg at eumetsat.int
Tue Mar 2 16:20:21 EST 2010


Hi Peter,
   I am not sure I understand the question {what is meant by indexing with an MP_variable?). Maybe you can make it clearer by adding an example?

In this example
    MP_set S(numS);          // Sources 
    MP_set D(numD);          // Destinations 
    MP_subset<2> Link(S,D);  // Transportation links (sparse subset of S*D)
    MP_variable x(Link);

 supply(S) =  sum( Link(S,D), x(Link) ) <= SUPPLY(S);

You could in a way index the variable x using S and D but you must do like this

supply(S) =  sum( D, x(Link(S,D)) ) <= SUPPLY(S);

This should work the same as above (I havent checked).
(The same would apply even for one dimensional subsets)

Maybe this adresses your question, but I am not sure.

Cheers, Tim


________________________________________
From: flopcpp-bounces at list.coin-or.org [flopcpp-bounces at list.coin-or.org] On Behalf Of Peter Sels [sels.peter at gmail.com]
Sent: 02 March 2010 11:46
To: flopcpp at list.coin-or.org
Subject: [FlopCpp] constraints over MP_Sets vs over MP_SubSets

Hello all,

1) Is it correct that in formulating FlopC++ constraints,
- when ranging over an MP_Set, one has to (can :) index the constraint
and variables in the constraint with [an MP_variable]
- when ranging over an MP_SubSet one has to index the constraint and
variables in the constraint with [an MP_SubSet [indexed by an
MP_Variable]]? Is this solely because of the guaranteed non-sparseness
of an MP_Set
and the (potential) sparseness of an MP_SubSet?


cheers,

--
Peter

_______________________________________________
FlopCpp mailing list
FlopCpp at list.coin-or.org
http://list.coin-or.org/mailman/listinfo/flopcpp




More information about the FlopCpp mailing list