It seems that noalias() doesn't behave properly with Map<>ed matrices. (However, while this is broken in the current release -- 3.2.4 -- it appears to have been corrected in the development repository, so I'm working around it by using this.) Here is some repro code: #define EIGEN_NO_MALLOC #include <Eigen/Eigen> #include <cstdlib> int main() { using namespace Eigen; float* a = (float*)malloc(10 * 10 * sizeof(float)); float* b = (float*)malloc(10 * 10 * sizeof(float)); float* c = (float*)malloc(10 * 10 * sizeof(float)); Map<MatrixXf> ma(a, 10, 10); Map<MatrixXf> mb(b, 10, 10); Map<MatrixXf> mc(c, 10, 10); mc.noalias() = ma * mb; // fails with 3.2.4, succeeds with dev mc.noalias() += ma * mb; // fails with 3.2.4, succeeds with dev } Here is my compiler info: $ g++ --version Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/usr/include/c++/4.2.1 Apple LLVM version 6.1.0 (clang-602.0.49) (based on LLVM 3.6.0svn) Target: x86_64-apple-darwin14.3.0 Thread model: posix
This appears to be a duplicate of Bug 729. I manually backported the fix here: https://bitbucket.org/eigen/eigen/commits/a16528a7f459
-- 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/1012.