Eigen库中参数ComputeFullU,ComputeThinU,ComputeFullV,ComputeThinV的应用

对于 J = U Σ V T J=U \Sigma V^T J=UΣVT在Eigen库中进行奇异值分解 :

JacobiSVD<MatrixXd> svd(J, ComputeFullV| ComputeFullU);
    U = svd.matrixU();
    V = svd.matrixV();
    A = svd.singularValues(); 

其中A为 Σ \Sigma Σ 对角线元素;

对于以下构造函数的输入参数

JacobiSVD(const MatrixType& matrix, unsigned int computationOptions = 0)

第一个参数为要进行计算的矩阵,第二个参数有四个取值:
#ComputeFullU, #ComputeThinU,#ComputeFullV, #ComputeThinV.
它们的含义为:
在这里插入图片描述

说明文档中提示:
This JacobiSVD decomposition computes only the singular values by default. If you want U or V, you need to ask for them explicitly.

另外,对于square matric 与 thin matric的区别:
Thin unitaries are only available if your matrix type has a Dynamic number of columns (for example MatrixXf).

You can ask for only thin U or V to be computed, meaning the following. In case of a rectangular n-by-p matrix, letting m be the smaller value among n and p, there are only m singular vectors; the remaining columns of U and V do not correspond to actual singular vectors. Asking for thin U or V means asking for only their m first columns to be formed. So U is then a n-by-m matrix, and V is then a p-by-m matrix. Notice that thin U and V are all you need for (least squares) solving.

参考文献【3】Python与C++中SVD(奇异值分解)得到的右奇异值不同 给出了一些对比运行结果,可以参考;

参考地址:
【1】https://eigen.tuxfamily.org/dox/group__enums.html#ggae3e239fb70022eb8747994cf5d68b4a9aa7fb4e98834788d0b1b0f2b8467d2527
【2】http://eigen.tuxfamily.org/dox-devel/classEigen_1_1JacobiSVD.html
【3】http://www.pythonheidong.com/blog/article/65726/

  • 9
    点赞
  • 17
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值