Reported by Steve Wolter: When taking the diagonal of a 1x1 matrix and multiplying it with a vector / row vector with an uneven number of cols / rows (e.g. 1x3 or 1x6 with floats), the last chunk's values are incorrect. I've got a minimal example that demonstrates the error with gcc Debian 6.3.0-18+deb9u1 (and older gcc's as well), and Eigen 3.3.4 & 3.3.1 & 3.3.2, but not with Eigen 3.2.9: #include <iostream> #include <Eigen/Core> int main() { Eigen::Matrix<float, 1, 1> a; a.fill(1); Eigen::Matrix<float, 1, Eigen::Dynamic> b(1, 3); b.fill(2); std::cerr << a * b << std::endl; // Correct result: 2 2 2 std::cerr << a.asDiagonal() * b << std::endl; // Incorrect result: 2 2 ~0 } I couldn't reproduce the error with any size of a except 1x1.
Fixed in default and 3.3: https://bitbucket.org/eigen/eigen/commits/a80ebf43e130c41 https://bitbucket.org/eigen/eigen/commits/90d7654f4a59a9b
*** Bug 1561 has been marked as a duplicate of this bug. ***
-- 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/1560.