vsoftco
vsoftco

Reputation: 56547

Assertion failed Eigen debug mode

I suddenly realized that when compiling my program (that uses Eigen) using debug mode (-g3 -DDEBUG), I am getting a runtime assertion error

Assertion failed: (v == T(Value)), function variable_if_dynamic, file /Users/vlad/eigen_3.2.2/Eigen/src/Core/util/XprHelper.h, line 53

I cannot figure out where exactly is this happening and why. I also used EIGEN_MAKE_ALIGNED_OPERATOR_NEW in my only class that uses Eigen members, as I thought it may be an alignment issue, but still it doesn't solve the problem. Did anyone bumped into this before? The release version compiles and runs just fine, the assert appears only in debug mode.

Upvotes: 4

Views: 3887

Answers (1)

ggael
ggael

Reputation: 29205

This is not related to alignment, but to a mismatch between a compile-time and runtime value meaning you probably has something like this in your code:

Matrix<double,3,Dynamic> mat(4,5);

where the runtime number of rows 4 does not match the compile-time number of rows 3. A debugger will help you to find the incriminating line.

Upvotes: 9

Related Questions