When instantiating an Eigen::ConjugateGradient object with fixed-size matrices, an eigen_assert fails at construction. One can easily reproduce the problem when building with assertions enabled ("Debug" mode, NDEBUG not defined): #include <Eigen/Dense> #include <Eigen/IterativeLinearSolvers> int main() { Eigen::ConjugateGradient<Eigen::MatrixXd> cg2; // works fine Eigen::ConjugateGradient<Eigen::Matrix3d> cg1; // fails } The assert: Assertion failed: ((!(RowsAtCompileTime!=Dynamic) || (rows==RowsAtCompileTime)) && (!(ColsAtCompileTime!=Dynamic) || (cols==ColsAtCompileTime)) && (!(RowsAtCompileTime==Dynamic && MaxRowsAtCompileTime!=Dynamic) || (rows<=MaxRowsAtCompileTime)) && (!(ColsAtCompileTime==Dynamic && MaxColsAtCompileTime!=Dynamic) || (cols<=MaxColsAtCompileTime)) && rows>=0 && cols>=0 && "Invalid sizes when resizing a matrix or array."), function resize, file /usr/local/include/eigen3/Eigen/src/Core/PlainObjectBase.h, line 285. The aforementioned code works fine in the "Release" mode.
-- 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/1704.