本文介绍了如何在本征库中获得矩阵的等级?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何获取等级: //eigen.tuxfamily.org/index.php?title=Main_Page rel = nofollow>特征?

How to get rank of a matrix in eigen?

推荐答案

您需要将矩阵转换为排名揭示分解。例如 FullPivLU 。如果您有 matrix3f ,它看起来像这样:

You need to convert your matrix to a rank-revealing decomposition. For instance FullPivLU. If you have a matrix3f it looks like this :

FullPivLU<Matrix3f> lu_decomp(your_matrix);
auto rank = lu_decomp.rank();

编辑

分解矩阵是获得排名的最常见方法。但是,对于

Decomposing the matrix is the most common way to get the rank. Although, LU is not the most reliable way to achieve it for floating values as explained on the rank article on wikipedia

因此,使用 Eigen :: ColPivHouseholderQR< MatrixType>

这篇关于如何在本征库中获得矩阵的等级?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-27 17:07