Re: [eigen] Interesting C++ standard proposal

[ Thread Index | Date Index | More Archives ]


(browsing through unanswered mails ...)

On 11.09.2013 09:00, Hauke Heibel wrote:
I just thought some of you might be interested in this proposal:

Yes, that looks interesting, but as you said, even if this gets accepted it will take a long time until we can profit from it. Until then, we must rely on Gael to implement the expression-evaluator and educate our users that storing expression trees is often not the most efficient solution (but that depends on the expression and how often it is used).

MatrixXd A, B, C, X, Y, Z;

auto A_plus_B = A+B;  // usually ok (not always ...)
auto A_times_B= A*B;  // in many cases (A*B).eval() is better

X = A_plus_B + C; // more efficient than evaluating A+B.
Y.noAlias() = C + A_times_B; // currently fails, but efficient later.

// fails at the moment and inefficient (product gets evaluated twice):
Z.noAlias() = A_times_B + A_times_B.transpose();


Dipl.-Inf., Dipl.-Math. Christoph Hertzberg
Cartesium 0.049
Universität Bremen
Enrique-Schmidt-Straße 5
28359 Bremen

Tel: +49 (421) 218-64252

Mail converted by MHonArc 2.6.19+