![]() Registered Member ![]()
|
hi all
I am starting to find that the technique of ET is very interesting thus and am looking into how it is used in practical library. I hope someone can help me here. Most of the articles online are about optimising the following addition expression
which ET can transform it into something like
by walking the expression tree
This optimisation is rather for element-wise operation. Now suppose that I have the follow matrices computation (not exactly Eigen notation)
What kind of optimisations are performed here at compiled time? |
![]() Registered Member ![]()
|
Eigen evaluates matrix-matrix product immediately. So in the case of an expression involving only matrix-matrix products, such as in your last example, Eigen's ETs won't make a big difference: they will only help ensure that no redundant copy of matrices is performed (as would be the case if operator* returned a new matrix by value).
If you are sure that you want matrix products to be lazy i.e. not evaluate immediately, you can do:
but be very careful: this can be a very bad idea as the complexity of evaluating such a chained lazy product can be far worse than the complexity of the default i.e. evaluating each product immediately!!
Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list! |
Registered users: Bing [Bot], blue_bullet, Google [Bot], rockscient, Yahoo [Bot]