因为在看PCA,看到了矩阵运算库Engine。
官网教程:http://eigen.tuxfamily.org/dox/group__TutorialMatrixClass.html
Eigen简单上手使用
要实现相应的功能只需要包含头相应的头文件即可:
Core |
#include <Eigen/Core>
|
Matrix and Array classes, basic linear algebra (including triangular and selfadjoint products), array manipulation |
Geometry |
#include <Eigen/Geometry>
|
Transform, Translation, Scaling, Rotation2D and 3D rotations (Quaternion, AngleAxis) |
LU |
#include <Eigen/LU>
|
Inverse, determinant, LU decompositions with solver (FullPivLU, PartialPivLU) |
Cholesky |
#include <Eigen/Cholesky>
|
LLT and LDLT Cholesky factorization with solver |
Householder |
#include <Eigen/Householder>
|
Householder transformations; this module is used by several linear algebra modules |
SVD |
#include <Eigen/SVD>
|
SVD decomposition with least-squares solver (JacobiSVD) |
QR |
#include <Eigen/QR>
|
QR decomposition with solver (HouseholderQR, ColPivHouseholderQR, FullPivHouseholderQR) |
Eigenvalues |
#include <Eigen/Eigenvalues>
|
Eigenvalue, eigenvector decompositions (EigenSolver, SelfAdjointEigenSolver,ComplexEigenSolver) |
Sparse |
#include <Eigen/Sparse>
|
Sparse matrix storage and related basic linear algebra (SparseMatrix, DynamicSparseMatrix,SparseVector) |
#include <Eigen/Dense>
|
Includes Core, Geometry, LU, Cholesky, SVD, QR, and Eigenvalues header files | |
#include <Eigen/Eigen>
|
Includes Dense and Sparse header files (the whole Eigen library) |
基本的矩阵运算只需要包含Dense即可