C++矩阵处理工具Eigen类浅析

参考

http://eigen.tuxfamily.org/dox/classEigen_1_1Matrix.html

1.Matrix 矩阵

矩阵类多用于单列vector和单行的vector,多用于密集型矩阵或者vectors容器。Vector是只有一列的矩阵,row-vector是只有一行的矩阵。可以定义为固定大小或者动态大小。

template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols>
class Eigen::Matrix< _Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols >

The matrix class, also used for vectors and row-vectors.

The Matrix class is the work-horse for all dense (note) matrices and vectors within Eigen. Vectors are matrices with one column, and row-vectors are matrices with one row.

The Matrix class encompasses both fixed-size and dynamic-size objects (note).

The first three template parameters are required:(类型,行、列)

Template Parameters
_Scalar@anchor matrix_tparam_scalar Numeric type, e.g. float, double, int or std::complex<float>. User defined sclar types are supported as well (see here).
_Rows Number of rows, or Dynamic
_Cols Number of columns, or Dynamic


2.定义类型

Typedefs

typedef Matrix< std::complex
< double >, 2, 2 > 
Matrix2cd
 
typedef Matrix< std::complex
< float >, 2, 2 > 
Matrix2cf
 
typedef Matrix< double, 2, 2 >  Matrix2d
 
typedef Matrix< float, 2, 2 >  Matrix2f
 
typedef Matrix< int, 2, 2 >  Matrix2i
 
typedef Matrix< std::complex
< double >, 2, Dynamic > 
Matrix2Xcd
 
typedef Matrix< std::complex
< float >, 2, Dynamic > 
Matrix2Xcf
 
typedef Matrix< double, 
2, Dynamic > 
Matrix2Xd
 
typedef Matrix< float, 2, Dynamic >  Matrix2Xf
 
typedef Matrix< int, 2, Dynamic >  Matrix2Xi
 
typedef Matrix< std::complex
< double >, 3, 3 > 
Matrix3cd
 
typedef Matrix< std::complex
< float >, 3, 3 > 
Matrix3cf
 
typedef Matrix< double, 3, 3 > 
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值