Registered Member
|
Hi,
A question from a new Eigen user (not well versed in C++ either): I understand that Eigen can, for a few arrays a, b & x, turn a statement like
into a single for loop which does not create temporary arrays (and I hope writes elements directly into y). This is a huge advantage for large arrays. However, often I have the use case of evaluating multiple expressions, cwise, involving the same arrays, for example the two RHS of differential equations for a nonlinear oscillator:
In this case, is Eigen able to perform the two statements in a single for loop? If not, is there a shorter way to do this than writing the for loop by hand? Thanks for your advice. |
Moderator
|
Indeed, in such a case, if your vectors do not fit within L1, fusing the two loops might be useful, however, this is not possible in Eigen yet. If you write the loops yourself, then you will loose Eigen's explicit vectorization and so you might loose speed despite fewer cache misses.
|
Moderator
|
For the record I opened a feature request for discussion: http://eigen.tuxfamily.org/bz/show_bug.cgi?id=984
|
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]