Re: [eigen] nesting

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


On Thu, Feb 4, 2010 at 5:55 PM, Gael Guennebaud
<gael.guennebaud@xxxxxxxxx> wrote:
> 1 - remove all evaluation at nesting time, and simply build the complete
> expression tree
> 2 - at evaluation time, you send your complete expression to a template
> evaluator which will recursively analyze your expression from the top,
> reorder some subexpression, and evaluate some sub expressions when needed.
> Such an analyzer/evaluator would look like the current ei_blas_traits...
> Some examples of what could be done with such an approach:

Sounds really cool though it will take some time to implement
something like this. You will also need to touch existing expressions
to add some information to them or to get access to the nested types.

Right now, I think we need a temporary fix - literally. The copying
has a lot of impact. Consider the example taken from the forum:

P.noalias() -= lr_P * ( mu_vJ * vJ.transpose() + mu_vK * vK.transpose())

This simple computation will create 6 (!) temporaries.

2 for CwiseBinaryOp +, these ones are actually ok
2 for CwiseUnaryOp *, a copy of the expression above that is nesting
the two matrices by value
2 for CwiseBinaryOp -, another copy

- Hauke



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/