本征库-矩阵的伪逆(Matlab-Pinv) [英] Eigen Library - Pseudo-Inverse of Matrix (Matlab - pinv)
问题描述
我正在尝试使用本征库找到矩阵的伪逆.他们有一个确实可以实现它的类,但是我不知道该如何编写脚本的语法.
I am trying to find the pseudo-inverse of a matrix using the Eigen Library. They have a class that does implement it, however I do not know how to put script the syntax.
这就是它在网站上的显示方式( https://eigen.tuxfly .org/dox/classEigen_1_1CompleteOrthogonalDecomposition.html#ab2fd4c81aa1cd8bc917c7f135505cb7f ):
This is how it is shown on the website (https://eigen.tuxfamily.org/dox/classEigen_1_1CompleteOrthogonalDecomposition.html#ab2fd4c81aa1cd8bc917c7f135505cb7f):
const Inverse Eigen :: CompleteOrthogonalDecomposition< MatrixType> :: pseudoInverse()const
const Inverse Eigen::CompleteOrthogonalDecomposition< MatrixType >::pseudoInverse ( ) const
推荐答案
这是CompleteOrthogonalDecomposition
类的方法.因此,在使用矩阵之前,必须对矩阵进行分解.例如
It's a method of the CompleteOrthogonalDecomposition
class. So you have to perform that decomposition of a matrix before you use it. For example
#include <Eigen/QR>
Eigen::MatrixXd A = ... // fill in A
Eigen::MatrixXd pinv = A.completeOrthogonalDecomposition().pseudoInverse();
这篇关于本征库-矩阵的伪逆(Matlab-Pinv)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!