Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Assertion failed Eigen debug mode

Tags:

c++

eigen

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.

like image 754
vsoftco Avatar asked Sep 11 '25 13:09

vsoftco


1 Answers

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.

like image 123
ggael Avatar answered Sep 14 '25 01:09

ggael