由于固定尺寸成员而引起的EIGEN运行时断言
Eigen runtime assertion due to fixed size members
运行程序时,我目前正在检索以下特征主张:
test_engine:/usr/include/eigen3/eigen/src/core/densestorage.h:128:eigen :: internal :: internal :: plain_array :: plain_array :: plain_array(([with t = double;int size = 16;int matrixorarrayOptions = 0]:断言`(reinterpret_cast(eigen_unaligned_array_assert_assert_workaround_gcc47(array((&(31((== 0&&&"此处解释了此断言:" http://eigen.tuxfamily.org/dox-devel/group __topicunalignedArrayAssert.html" ****阅读此网页!!! ********************************>
导致此断言的代码的确切行是:
std::shared_ptr<Reference> ptr_tmp = std::make_shared<ReferenceLinCart>(cart_traj);
其中Reference
和ReferenceLinCart
在公共标题文件中定义为:
struct Reference {
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
virtual ~Reference() {}
}
struct ReferenceLinCart : Reference {
Eigen::Transform<double, 3, Eigen::Affine> T_start;
Eigen::Transform<double, 3, Eigen::Affine> T_goal;
EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
描述中的链接为我提供了有关静态大小结构成员的信息,这就是为什么我添加了EIGEN_MAKE_ALIGNED_OPERATOR_NEW
标志。
使用的G 编译标志为:-march =本机-funroll -loops -Std = C 11 -ofast -wall
不幸的是,我仍在检索相同的运行时断言。关于如何摆脱这一点的任何建议?
这是因为make_shared
不符合请求的对齐方式,也不使用operator new
进行分配。您需要使用Allocate_shared与对齐分配器(例如Eigen::aligned_Allocator
(。
用C 17编译代码,错误(内存分配器(已修复
- CMake-按正确顺序将项目与C运行时对象文件链接
- 我在c++代码中生成了一个运行时#3异常
- 为什么在运行时没有向我们提供有关分段错误的更多信息?
- 删除指向指针的指针是运行时错误吗
- 如何用参数值调用函数(仅在运行时已知)
- 为什么即使使用-cudart-static进行编译,库用户仍然需要链接到cuda运行时
- 是否可以在编译时初始化数组,以便在运行时不会花费时间?
- c++中的指针和运行时错误
- 在运行时处理类型擦除的数据-如何不重新发明轮子
- 有没有一种方法可以测量c++程序的运行时内存使用情况
- 建议在运行时将带有类实例的列表从c++导入qml
- 无法理解此 return 语句的功能,没有它就会发生运行时错误
- 如何在GTK程序运行时禁用屏幕保护程序/电源管理/屏幕消隐
- 在同一模拟中使用静脉和静脉_ inet内容时出现运行时错误
- 读取文件时运行时的未知行为
- 函数在Windows或Linux上运行时表现不同
- 在声明中合并两个常量"std::set"(不是在运行时)
- AWS Lambda C++运行时权限被拒绝
- 通过switch和static_cast访问多态对象的运行时类型
- 由于固定尺寸成员而引起的EIGEN运行时断言