[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] nesting
- From: Hauke Heibel <hauke.heibel@xxxxxxxxxxxxxx>
- Date: Thu, 4 Feb 2010 19:29:36 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=4oSaluMkR2BY6YIwynfeJl17Ew9xo9ID6YxeDwgeIcM=; b=n2+t9xGCb0BHfStKaayPekNtdod8J4m71Ux3J1KFsMuFx4QJe1rfB8b6mB65rj3+n0 8ESFFls+6LxDT/pYo1kU539Dn8aysutZ3kuvN1MhXVruug20heED5xLEKopgI/XdyFiQ /vowIco5Km6824PSGjGQmKeH/e3cmnDuQhX9s=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=o9vXm/iYt35FkQtaQHy6QFq8yNQ+3ASIgPI8czhufQvbKCqu8E3Q6jy1SJAoMkUsBj 0ndOie8IqiHUlhW1++Nj24V/5EGJABC/caJVoeTK2EtkSfnhT9d/DbvTbrVnqUdOHoWC X4d1WXxSLuGB2H3HPaQpY49WT6ThEEfQ/zR2U=
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