[FlopCpp] index in computation

Michael Chen vancouver.michael at gmail.com
Tue Mar 3 10:32:28 EST 2009


Thanks! With the Constant(), index computing is pretty easty to code!

Sincerely Yours,
Michael Chen

On Tue, Mar 3, 2009 at 2:10 AM, Tim Hultberg <Tim.Hultberg at eumetsat.int>wrote:

>  Havent checked if it works, but I would try
>
>
>
>   balance(k) =
>
>      z(k) == sum(K(i), (Constant(k)-Constant(i))*x(i) );
>
>
>
> Tim
>
>
>
> *From:* flopcpp-bounces at list.coin-or.org [mailto:
> flopcpp-bounces at list.coin-or.org] *On Behalf Of *Michael Chen
> *Sent:* Tuesday, March 03, 2009 6:06 AM
> *To:* flopcpp at list.coin-or.org
> *Subject:* [FlopCpp] index in computation
>
>
>
> Dear there,
>
> I am wondering how to express this constraint in flopcpp:
> const int L = 3;
> MP_set K(L);
> MP_variable z(K);
> Mp_variable x(K);
> MP_constraint balance(K);
>
> and here is the constraint in question:
> for k=1,...,K, balance(k):
> z(k) = sum_{i=1}^k ( k - i ) * x(i);
>
> The problem is that FlopC++ doesn't seem to allow MP_set in direct
> computation (k - i).
>
> Sincerely Yours,
> Michael
>
>
>
>
> --
> Best regards,
> Michael Chen
>



-- 
Best regards,
Michael Chen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://list.coin-or.org/pipermail/flopcpp/attachments/20090303/418fa9ad/attachment.html 


More information about the FlopCpp mailing list