c++ - 我们可以创建一个特征矩阵 vector 吗?

标签 c++ vector eigen

是否可以创建特征矩阵 vector ?

例如,我运行以下行,

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

有人愿意启发我如何正确初始化特征矩阵 vector 吗?请注意,我考虑过使用 Eigen 动态大小矩阵作为替代方案,但我不想要这个。

最佳答案

根据 documentation , 你必须

#include <Eigen/StdVector>

和使用

std::vector<Matrix<double,4,1>, Eigen::aligned_allocator<Matrix<double,4,1> > >

关于c++ - 我们可以创建一个特征矩阵 vector 吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31159196/

相关文章:

c++ - 在 C++ 中使用 WriteProcessMemory() 与多级指针和偏移量?

c++ - 如何解决eclipse中cplex的目录问题?

android - 使用 Android 原生 Binder 发送自定义对象

c++ - 创建模板类的 std::vector ?

c++ - 随机发生器从 vector 中选择一个数字并将其删除

c++:应用于 vector 的STL算法也适用于其他容器对象?

c++ - Boost::uBLAS 与 Eigen

c++ - 在 PCL 构建中关闭 Eigen Alignment

c++ - 带有 std::map::const_iterator 的模板化类中的嵌套结构?

c++ - map 特征复制矩阵