Created attachment 738 [details] VC14 log output I have the following code which does not compile Eigen 3.3-rc1 (it does with Eigen 3.2.9 though): #include <Eigen/Core> #include <Eigen/Geometry> #include <Eigen/LU> int main() { Eigen::Matrix3d K; K.setIdentity(); Eigen::Vector2d u; u.setZero(); (K.triangularView<Eigen::Upper>() * u.homogeneous()).hnormalized(); // Eigen::Matrix4d::Identity().lu().solve(Eigen::Vector3d::Ones().homogeneous()).hnormalized(); } I've attached the compiler output. The code was compiled using the following command-line: cl /W4 /EHsc test.cpp
For me it does not compile with 3.2. I get a static assertion: "THIS_METHOD_IS_ONLY_FOR_1x1_EXPRESSIONS"
You are right. I missed an .eval() in front of .hnormalized() (i.e. after the product). (K.triangularView<Eigen::Upper>() * u.homogeneous()).eval().hnormalized(); However, it would be nice if such expressions could be evaluated without an explicit .eval() call.
Alright, so in 3.2, what happened is that in this case u.homogeneous() gets evaluated into a Vector3d before the product takes place: K.triangularView<Eigen::Upper>() * (u.homogeneous()).eval() In 3.2, this was done implicitly, so the easy "fix" would be to do the same explicitly in 3.3 before we add a special optimized path.
Since this compiled in 3.2, here is a quick workaround for 3.3: https://bitbucket.org/eigen/eigen/commits/256ec6fa646e/
-- GitLab Migration Automatic Message -- This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1310.