Re: [proto] Manipulating an expression tree

2011-05-01 Thread Eric Niebler
On 4/15/2011 10:45 PM, Karsten Ahnert wrote: @All: Are somewhere more examples and docs for proto transforms. They are quite complicated and maybe a bit underrepresented in the official users guide. (Funny, I *know* I replied to this, but I don't see it in the archive. Sorry if y'all get this

Re: [proto] Manipulating an expression tree

2011-04-10 Thread Karsten Ahnert
On 04/08/2011 02:16 PM, Bart Janssens wrote: 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

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

Re: [proto] Manipulating an expression tree

2011-04-06 Thread Bart Janssens
On Wed, Apr 6, 2011 at 10:29 PM, Karsten Ahnert karsten.ahn...@ambrosys.de wrote: Is there a direct way to transform an expression tree into another one? For example, is it possible that every proto::plus node is transformed to it left child? I tried to solve this problem via protos build-in

Re: [proto] Manipulating an expression tree

2011-04-06 Thread Karsten Ahnert
Great! It works perfectly, alltough I don't understand the code completely yet. 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. Thanks, Karsten

Re: [proto] Manipulating an expression tree

2011-04-06 Thread Eric Niebler
(Please don't top-post. Rearranging...) On 4/7/2011 5:45 AM, Karsten Ahnert wrote: On 04/06/2011 10:53 PM, Bart Janssens wrote: On Wed, Apr 6, 2011 at 10:29 PM, Karsten Ahnert karsten.ahn...@ambrosys.de wrote: Is there a direct way to transform an expression tree into another one? For