首页 > 其他分享 >Eigen模板类The Matrix class

Eigen模板类The Matrix class

时间:2023-02-09 12:00:10浏览次数:71  
标签:typedef Matrix 数据类型 向量 class 模板 Eigen

for Dense Matrix and array manipulation

Eigen中所有矩阵(matrices)和向量(vectors)都是Matrix模板类的实例化对象,其中向量为矩阵的特殊情况,一行或者一列。

关注Matrix模板类的前三个参数

Matrix<typename Scalar, int RowsAtCompileTime, int ColsAtCompileTime>, <数据类型, 行数, 列数>

  • 数据类型Scalar
  • RowsAtCompileTimeColsAtCompileTime

常用数据类型:

Eigen::Matrix3f:3x3方阵,数据类型:float

typedef Matrix<float, 4, 4> Matrix4f; shape: (4, 4), dtype: float

typedef Matrix<float, Dynamic, 2> MatrixX2f; shape: (N, 2), dtype: float

Vectors向量

Eigen中向量为矩阵的特殊形式,即一行或者一列。其中列向量更为常见(有时缩写为向量)
举例:
typedef Matrix<float, 3, 1> Vector3f; (列)向量:shape(3, 1)

typedef Matrix<int, 1, 2> RowVector2i; 行向量

Eigen中的特殊值Dynamic

CMake

https://blog.csdn.net/geerniya/article/details/103202562
header-only

参考资料

标签:typedef,Matrix,数据类型,向量,class,模板,Eigen
From: https://www.cnblogs.com/Todd-Qi/p/17080304.html

相关文章