使用Eigen3 的对象报错!

来源:互联网 发布:app制作软件下载 编辑:程序博客网 时间:2024/05/16 09:42

Assertion failed: (reinterpret_cast<size_t>(array) & 0xf) == 0 && "this assertion is explained here: " .....

file k:\eigen\eigen\src/Core/DenseStorage.h, line 69

解决方案:

http://eigen.tuxfamily.org/dox-devel/TopicUnalignedArrayAssert.html

简要说明,报错一般

1. 有 eigen3的对象作为struct的成员

2. STL容器

3.通过传值传递eigen3对象

4.编译器设计了不合适的数据对齐


如果遇到

#define EIGEN_DONT_ALIGN_STATICALLY
或者

#define EIGEN_DONT_VECTORIZE
#define EIGEN_DISABLE_UNALIGNED_ARRAY_ASSERT

关闭Vectorize不管用时候,可以参考下面的文章。这个貌似是一个BUG? 据说这个宏在develop branch里面是有效的。

http://comments.gmane.org/gmane.science.robotics.ros.user/8505