Boost logo

Proto :

Subject: Re: [proto] Manipulating an expression tree
From: Karsten Ahnert (karsten.ahnert_at_[hidden])
Date: 2011-04-10 04:59:35


On 04/08/2011 02:16 PM, Bart Janssens wrote:
> On Fri, Apr 8, 2011 at 2:11 PM, Karsten Ahnert
> <karsten.ahnert_at_[hidden]> wrote:
>> Thank you for your example. I have one question: how do you use (or assign
>> something to) the intermediate values in StoredMatrixExpression?
>
> Once the wrapping is done, every wrapped node (multiplies expressions
> in your case) will have the "value" member. This can be used from
> within any primitive transform or context, if you are working on the
> expression after it is transformed by WrapExpression. So instead of
> eval(your_expr) you would do something like
> eval(WrapExpression()(your_expr)) and then you can assume value exists
> when it is needed.

Ok, I think I understand how you replace the nodes, but I don't
understand how you parse the tree and how you access the value member.
Do you use contexts and eval()? Could you please show a small piece of
code? Thanks,

>
> Cheers,
>

-- 
Dr. Karsten Ahnert
Ambrosys GmbH - Gesellschaft für Management komplexer Systeme
Geschwister-Scholl-Str. 63a
D-14471 Potsdam
Tel: +4917682001688
Fax: +493319791300
Ambrosys GmbH - Gesellschaft für Management komplexer Systems
Gesellschaft mit beschränkter Haftung
Sitz der Gesellschaft: Geschwister-Scholl-Str. 63a, 14471 Potsdam
Registergericht: Amtsgericht Potsdam, HRB 21228 P
Geschäftsführer: Dr. Karsten Ahnert, Dr. Markus Abel

Proto list run by eric at boostpro.com