New user self-registration is disabled due to spam. Please email eigen-core-team @ lists.tuxfamily.org if you need an account.
Before reporting a bug, please make sure that your Eigen version is up-to-date!
Bug 1704 - Eigen_assert fails when instantiating an Eigen::ConjugateGradient object with fixed-size matrices
Summary: Eigen_assert fails when instantiating an Eigen::ConjugateGradient object with...
Status: NEW
Alias: None
Product: Eigen
Classification: Unclassified
Component: General (show other bugs)
Version: 3.3 (current stable)
Hardware: x86 - 64-bit Mac OS
: Normal Crash
Assignee: Nobody
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-01 08:30 UTC by Peter Listov
Modified: 2019-05-01 08:30 UTC (History)
3 users (show)



Attachments

Description Peter Listov 2019-05-01 08:30:44 UTC
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.

Note You need to log in before you can comment on or make changes to this bug.