[FlopCpp] problem generalizing stampl.cpp
Michal Kaut
mail at michalkaut.net
Mon Nov 26 05:42:48 EST 2007
Hello,
I am trying to rewrite the stampl.cpp example to be able to handle
general trees. My problem is that I do no know what to do with the
objective function and the MP_expressions, which are currently written
as a fixed sum of the two children:
: Final_wealth = children[0]->Final_wealth + children[1]->Final_wealth;
Is there any way of writing this expression for a general number of
children? I do not have a problem assuming that the number of children
is known at the moment the Stage-objects are created.
(My idea was to define MP_set CHILDREN and write something like
: Final_wealth = sum(CHILDREN, children[(int) CHILDREN]->Final_wealth);
but I can't find anything that would work.)
Any idea would be greatly appreciated.
Thanks a lot in advance.
Regards,
Michal Kaut
More information about the FlopCpp
mailing list