我们可以创建一个特征矩阵的向量吗
Can we create a vector of Eigen Matrix?
是否可以创建特征矩阵的向量?
例如,我运行以下行,
vector<Matrix<double,4,1>> vector_of_matrix;
但我收到以下错误,
error: template argument 3 is invalid
error: template argument 4 is invalid
error: template argument 6 is invalid
error: template argument 1 is invalid
有人想告诉我如何正确初始化特征矩阵的向量吗?注意,我已经考虑了特征动态大小矩阵作为一种替代方案,但我不希望这样。
根据文档,您必须
#include <Eigen/StdVector>
并使用
std::vector<Matrix<double,4,1>, Eigen::aligned_allocator<Matrix<double,4,1> > >
在指定模板结构时始终使用空格。否则c++将无法解析它。
vector<Matrix<double,4,1> > vector_of_matrix;
需要#include
所需的头<Eigen/Core>
和(C++标准)<vector>
。
根据编译器的使用年限,有必要在大于和小于符号之间留有空格(例如> >
而不是>>
,以避免编译器混淆)。较旧的标准要求这样做。
相关文章:
- C++ 中的特征向量计算
- 在其特征向量上投影点云
- 特征::向量;在函数中使用 Eigen::Matrix3f 的值初始化向量,大于 4 个条目
- 动态分配特征向量的模因
- 特征向量与法巴德
- 将特征向量序列化为 QDataStream
- 为什么特征向量这么慢?
- C++ 查找矩阵的特征值和特征向量
- 特征向量对数无效使用不完整类型的错误
- 使用 c++ 特征库中的特征向量() 只计算一个特征向量
- 将特征向量复制到 C 数组
- SymEigsShiftSolver of Spectra是否不返回特征向量?
- 包含特征向量的类的奇异大小
- 将特征数组转换为特征向量
- 特征:如何将"greater than"的结果(在ArrayXf上)转换为特征向量
- 计算Armadillo中复杂对称矩阵的有限特征向量的正确函数
- 近似大型对称矩阵的最高3个特征值和特征向量的快速方法
- 按升序对特征向量Xf进行排序
- 特征向量矩阵右除问题
- 动态分配随机特征向量Xd