Open markusgft opened 4 years ago
Hi @markusgft, What do you mean by:
in my applications, this helps to greatly reduce the number of temporary expressions and therefore increases speed!
I assume you mean using those on plain Eigen types since manif
does not provide these functionalities.
Altho interesting, I'm afraid this won't happen anytime soon. Indeed, Eigen has many tricks up its sleeves and one of them is the use of 'expressions template'. You may have previously noticed that, e.g., calling the function my_eigen_matrix.inverse()
does not actually return a type Eigen::Matrix
but rather an Eigen::Inverse< XprType >
expression. It is a temporary object that holds the computation of the inverse function and only performs it when Eigen::Inverse< XprType >::eval
is called (either by the user or Eigen e.g. on assignment). The .noalias
is a different story but relies on the same mechanism.
No need to say that manif
does not employ expression template. And the reason is simply that it is a fairly complicated technique that I don't fully master. I have a local branch on which I started this effort, but it is partial and does not actually addresses the points you are raising. Furthermore it requires a deep redesign of the library.
Also, note that we are using noalias()
internally.
To summarize, I'd love to get there, but currently I can't.
Thanks for your comments and insights! I believe that this would be automatically resolved in case that #142 gets as far as to introducing direct inheritance of the tangent-vector types from the Eigen::Matrix class!
I believe that this would be automatically resolved in case that #142 gets as far as to introducing direct inheritance of the tangent-vector types from the Eigen::Matrix class!
Well, only for tangents and only partially ^^.
Sure, only partially! Of course I base my judgement on the limited scope of my application - but within that application, the solution proposed in the other thread would resolve a great many of my issues. Thanks again, and keep up the great work!
Well, only for tangents and only partially ^^.
Since most of the calculus performed by solvers and optimizers is done in the tangent space (that is, all state errors, perturbations, increments, optimal steps, residuals, Jacobians, and covariances are in the tangent space), this "only" means that most of the problems are solved by letting the tangent inherit from Matrix<T,size,1>
I'd say.
To insist on this argument, the tangent space is THE vector space, and therefore the place where vectorial calculus is done, hence the place where Eigen shines.
Dear all, I am wondering whether manif should adopt the (anti) aliasing helper functions native to Eigen. In particular, I believe that Eigens
.eval()
and.noalias()
could be relevant and attractive for manif. For instance, in my applications, this helps to greatly reduce the number of temporary expressions and therefore increases speed!