Hi All, I found that certain sparse matrix expressions had compilation errors for Eigen 3.3.x. A minimal example is given below: ===================================================================== #include <Eigen/Core> #include <Eigen/SparseCore> typedef Eigen::SparseMatrix<double> SpMat; using Eigen::VectorXd; int main() { SpMat m(10, 10); VectorXd v(10); VectorXd res1 = (m * v.asDiagonal()) * v; // fine VectorXd res2 = (m.adjoint() * v.asDiagonal()) * v; // fails on Eigen 3.3.x, OK with Eigen 3.2.y return 0; } ===================================================================== OS: Fedora 25 64-bit Compiler: GCC 6.2 Note that to reproduce this error one needs to turn on OpenMP with more than one thread. The error message is ===================================================================== ./Eigen/src/SparseCore/SparseDenseProduct.h:49:31: error: ‘Eigen::internal::sparse_time_dense_product_impl<Eigen::Product<Eigen::Transpose<const Eigen::SparseMatrix<double> >, Eigen::DiagonalWrapper<const Eigen::Matrix<double, -1, 1> >, 0>, Eigen::Matrix<double, -1, 1>, Eigen::Matrix<double, -1, 1>, double, 1, true>::LhsEval {aka struct Eigen::internal::evaluator<Eigen::Product<Eigen::Transpose<const Eigen::SparseMatrix<double> >, Eigen::DiagonalWrapper<const Eigen::Matrix<double, -1, 1> >, 0> >}’ has no member named ‘nonZerosEstimate’ if(threads>1 && lhsEval.nonZerosEstimate() > 20000) ===================================================================== , which points to https://bitbucket.org/eigen/eigen/src/0f635ff77c5800471a308879efdf1f4312b1ff63/Eigen/src/SparseCore/SparseDenseProduct.h?at=default&fileviewer=file-view-default#SparseDenseProduct.h-49. It seems that for some reason the "adjoint" version lacks the necessary member function. Thank you. Best, Yixuan
Works for me using gcc 4.9, 5, 6, clang 3.4 to 3.9, Apple's clang. Using either 3.3.0, 3.3.1, 3.3.2. Please make sure you are not mixing two different versions of Eigen.
Oh, did you compile with the -fopenmp flag? At least Clang<3.8 has no OpenMP support, right?
I missed this details. Fixed: Devel: https://bitbucket.org/eigen/eigen/commits/8b1a2b5b0ec9/ 3.2: https://bitbucket.org/eigen/eigen/commits/aeba495019d1/
Great. Thank you Gael!
-- 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/1379.