Re: [proto] Manipulating an expression tree

2011-04-08 Thread Karsten Ahnert
If you need to compute intermediate values, you can use a transform to build a parallel structure. Do you mean to build an entire new tree, or just to replace some nodes? If only some nodes have associated intermediate result, then you could just replace some nodes. Ok, this is a clear

Re: [proto] Manipulating an expression tree

2011-04-08 Thread Bart Janssens
On Thu, Apr 7, 2011 at 12:45 AM, Karsten Ahnert karsten.ahn...@ambrosys.de wrote: Another question is: can a node have a state. In my algorithm it would be nice, if every proto::multiplies node stores some intermediate values which are used during later evaluations of the tree. I did

Re: [proto] Manipulating an expression tree

2011-04-08 Thread Karsten Ahnert
Why not just write a transform that calculates one derivative and call it N times to get the Nth derivative? Yes, that may be easy if you need two or three higher derivatives. For my application I need 10 to 20 or even more. I guess that currently no compiler can handle such large trees. For

Re: [proto] Manipulating an expression tree

2011-04-08 Thread Karsten Ahnert
Thank you for your example. I have one question: how do you use (or assign something to) the intermediate values in StoredMatrixExpression? On Thu, Apr 7, 2011 at 12:45 AM, Karsten Ahnert karsten.ahn...@ambrosys.de wrote: Another question is: can a node have a state. In my algorithm it would

Re: [proto] Manipulating an expression tree

2011-04-08 Thread Bart Janssens
On Fri, Apr 8, 2011 at 2:11 PM, Karsten Ahnert karsten.ahn...@ambrosys.de 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

Re: [proto] Manipulating an expression tree

2011-04-08 Thread Thomas Heller
On Fri, Apr 8, 2011 at 2:03 PM, Karsten Ahnert karsten.ahn...@ambrosys.de wrote: Why not just write a transform that calculates one derivative and call it N times to get the Nth derivative? Yes, that may be easy if you need two or three higher derivatives. For my application I need 10 to 20