nlcpy.linalg.cholesky

nlcpy.linalg.cholesky(a)[ソース]

Cholesky decomposition.

Return the Cholesky decomposition, L * L.H, of the square matrix a, where L is lower-triangular and .H is the conjugate transpose operator (which is the ordinary transpose if a is real-valued). a must be Hermitian (symmetric if real-valued) and positive-definite. Only L is actually returned.

Parameters
a(..., M, M) array_like

Hermitian (symmetric if all elements are real), positive-definite input matrix.

Returns
L(..., M, M) ndarray

Upper or lower-triangular Cholesky factor of a.

注釈

The Cholesky decomposition is often used as a fast way of solving Ax = b

(when A is both Hermitian/symmetric and positive-definite).

First, we solve for y in Ly = b, and then for x in L.Hx = y.

Examples

>>> import nlcpy as vp
>>> A = vp.array([[1,-2j],[2j,5]])
>>> A
array([[ 1.+0.j, -0.-2.j],
       [ 0.+2.j,  5.+0.j]])
>>> L = vp.linalg.cholesky(A)
>>> L
array([[1.+0.j, 0.+0.j],
       [0.+2.j, 1.+0.j]])
>>> vp.dot(L, vp.conjugate(L.T)) # verify that L * L.H = A
array([[1.+0.j, 0.-2.j],
       [0.+2.j, 5.+0.j]])