我有一个结构,它有一个固定大小的 Eigen 对象作为成员,我想将其用作 Lemon 的边缘图:
struct EdgeStatus
{
Matrix<float,3,4> Data;
…
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
ListGraph::EdgeMap<EdgeStatus> edgeMap(mygraph);
代码编译得很好,但我得到一个运行时错误:
include/Eigen/src/Core/DenseStorage.h:56: Eigen::internal::plain_array<T, Size, MatrixOrArrayOptions, 16>::plain_array()
[with T = float, int Size = 12, int MatrixOrArrayOptions = 0]: Assertion `(reinterpret_cast<size_t>(array) & 0xf) == 0
&& "this assertion is explained here: " "http://eigen.tuxfamily.org/dox-devel/TopicUnalignedArrayAssert.html" " **** READ THIS WEB PAGE !!! ****"' failed.
Aborted
我应该如何解决这个问题?(我已经包含了EIGEN_MAKE_ALIGNED_OPERATOR_NEW
宏。)