Previous Up Next

2.48.1  Cholesky decomposition : cholesky

cholesky takes as argument a square symetric positive definite matrix M of size n.
cholesky returns a symbolic or numeric matrix P. P is a lower triangular matrix such that :

tran(P)*P=M

Input :

cholesky([[1,1],[1,5]])

Output :

[[1,0],[1,2]]

Input :

cholesky([[3,1],[1,4]])

Output :

[[sqrt(3),0],[(sqrt(3))/3,(sqrt(33))/3]]

Input :

cholesky([[1,1],[1,4]])

Output :

[[1,0],[1,sqrt(3)]]

Warning If the matrix argument A is not a symetric matrix, cholesky does not return an error, instead cholesky will use the symetric matrix B of the the quadratic form q corresponding to the (non symetric) bilinear form of matrix A.
Input :

cholesky([[1,-1],[-1,4]])

or :

cholesky([[1,-3],[1,4]])

Output :

[[1,0],[-1,sqrt(3)]]

Previous Up Next