Registered Member
|
I've just started using Eigen for a project. Very impressed with it, and how well thought out everything is.
But I was wondering - is there any container to hold a lazy temporary expression? It could make code much more readable. Something like:
It wouldn't allow you to restructure in any major way, but it could make writing expressions much clearer to read, without adding any overhead, as n (in the above example) wouldn't be evaluated until it was included in another expression. Any thoughts? Can you already do this? And if not, would it, conceptually be possible with eigen's internal template structure? |
Moderator
|
yes, use the C++11 auto keyword:
auto n = VectorXf::LinSpaced(M, 0.0f, 1.0f); |
Registered Member
|
Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]