Struct 具有固定尺寸特征对象作为构件和容器的结构

Struct 具有固定尺寸特征对象作为构件和容器的结构,struct,eigen,lemon-graph-library,Struct,Eigen,Lemon Graph Library,我有一个固定大小的特征对象作为成员的结构,我想用它作为Lemon的边贴图: struct EdgeStatus { Matrix<float,3,4> Data; … EIGEN_MAKE_ALIGNED_OPERATOR_NEW }; ListGraph::EdgeMap<EdgeStatus> edgeMap(mygraph); struct EdgeStatus { 矩阵数据; … 特征值\u使\u对齐\u运算符\u新 }; ListGr

我有一个固定大小的特征对象作为成员的结构,我想用它作为Lemon的边贴图:

struct EdgeStatus
{
    Matrix<float,3,4> Data;
    …
    EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};

ListGraph::EdgeMap<EdgeStatus> edgeMap(mygraph);
struct EdgeStatus
{
矩阵数据;
…
特征值\u使\u对齐\u运算符\u新
};
ListGraph::EdgeMap 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
include/Eigen/src/Core/DenseStorage.h:56:Eigen::internal::plain_array::plain_array()
[当T=float、int Size=12、int matrixorarayoptions=0时]:断言`(重新解释强制转换(数组)&0xf)==0
&&“此处解释此断言:”http://eigen.tuxfamily.org/dox-devel/TopicUnalignedArrayAssert.html“****阅读此网页!!!*****”失败。
流产

我应该如何解决这个问题?(我已经包含了
EIGEN\u MAKE\u ALIGNED\u OPERATOR\u NEW
宏。)

我不知道LEMON库,但是如果ListGraph::EdgeMap允许您指定分配器,那么您必须使用我们的

否则,您必须放弃对成员的矢量化,如下所示:

struct EdgeStatus
{
  Matrix<float,3,4, Eigen::DontAlign> Data;
  // ...
};
struct EdgeStatus
{
矩阵数据;
// ...
};