Cholesky decomposition

In linear algebra, the Cholesky decomposition or Cholesky is a decomposition of a Hermitian, positive-definite matrix into the product of a lower triangular matrix and its conjugate transpose.

Cholesky 分解是把一个对称正定的矩阵表示成一个下三角矩阵L和其转置的乘积的分解。

wiki

https://en.wikipedia.org/wiki/Cholesky_decomposition

MATLAB

https://www.mathworks.com/help/matlab/ref/chol.html?s_tid=gn_loc_drop#responsive_offcanvas

Cplusplus

https://eigen.tuxfamily.org/dox/classEigen_1_1LLT.html

#include <iostream>
#include <vector>
#include <Eigen/Dense>
using namespace std;
using namespace Eigen; int main()
{
MatrixXd A(3,3);
A << 4,-1,2, -1,6,0, 2,0,5;
cout << "The matrix A is" << endl << A << endl;
LLT<MatrixXd> lltOfA(A); // compute the Cholesky decomposition of A //cout << "lltofA" << endl << lltOfA(A) << endl; MatrixXd L = lltOfA.matrixL(); // retrieve factor L in the decomposition
// The previous two lines can also be written as "L = A.llt().matrixL()"
cout << "The Cholesky factor L is" << endl << L << endl;
cout << "To check this, let us compute L * L.transpose()" << endl;
cout << L * L.transpose() << endl;
cout << "This should equal the matrix A" << endl;
}

MATLAB Cholesky分解

>> A = [4 -1 2 ; -1 6 0 ; 2 0 5 ]

A =

   4  -1   2
-1 6 0
2 0 5 >> L = chol(A,'lower') L = 2.00000 0.00000 0.00000
-0.50000 2.39792 0.00000
1.00000 0.20851 1.98910 >> B = L * L' B = 4.0000e+00 -1.0000e+00 2.0000e+00
-1.0000e+00 6.0000e+00 -2.5602e-17
2.0000e+00 -2.5602e-17 5.0000e+00 >>

最新文章

  1. 2012-2013 ACM-ICPC Northeastern European Regional Contest (NEERC 12)
  2. SynchronousQueue类
  3. DGV换行操作
  4. 14.约瑟夫环问题[JosephusProblem]
  5. 是否可以继承String类?
  6. OpenStack 多台计算节点时的问题
  7. union与struct以及大小端
  8. 《Python CookBook2》 第一章 文本 - 改变多行文本字符串的缩进 &amp;&amp; 扩展和压缩制表符(此节内容待定)
  9. top 10 js mvc
  10. deque用法 和与vector的区别
  11. MVVM模式应用 之的RelayCommand的使用
  12. 关于JS、JQuery、CSS的小知识点
  13. Python中TKinter模块中的Label组件
  14. puts fputs printf的区别
  15. poj 3264 Balanced Lineup(线段树、RMQ)
  16. Js内存泄露问题总结
  17. Java基础之异常
  18. MAC OSX下用pip安装lxml时遇到xmlversion.h not found的解决办法
  19. 你不知道的JavaScript--Item20 作用域与作用域链(scope chain)
  20. thymeleaf的配置

热门文章

  1. 74th LeetCode Weekly Contest Preimage Size of Factorial Zeroes Function
  2. form组件之modelForm
  3. Xshell添加快捷按钮
  4. sf01_什么是数据结构
  5. mysql 操作数据库创建,增删改查
  6. ajax请求状态码为0的解决办法
  7. centos7基本环境搭建
  8. Hive学习(三)Hive的Java客户端操作
  9. inventor安装失败怎样卸载安装inventor 2016?
  10. maya2017安装失败如何卸载重装