MCPcopy Create free account
hub / github.com/numpy/numpy / cholesky

Function cholesky

numpy/linalg/linalg.py:689–780  ·  view source on GitHub ↗

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) an

(a)

Source from the content-addressed store, hash-verified

687
688@array_function_dispatch(_unary_dispatcher)
689def cholesky(a):
690 """
691 Cholesky decomposition.
692
693 Return the Cholesky decomposition, `L * L.H`, of the square matrix `a`,
694 where `L` is lower-triangular and .H is the conjugate transpose operator
695 (which is the ordinary transpose if `a` is real-valued). `a` must be
696 Hermitian (symmetric if real-valued) and positive-definite. No
697 checking is performed to verify whether `a` is Hermitian or not.
698 In addition, only the lower-triangular and diagonal elements of `a`
699 are used. Only `L` is actually returned.
700
701 Parameters
702 ----------
703 a : (..., M, M) array_like
704 Hermitian (symmetric if all elements are real), positive-definite
705 input matrix.
706
707 Returns
708 -------
709 L : (..., M, M) array_like
710 Lower-triangular Cholesky factor of `a`. Returns a matrix object if
711 `a` is a matrix object.
712
713 Raises
714 ------
715 LinAlgError
716 If the decomposition fails, for example, if `a` is not
717 positive-definite.
718
719 See Also
720 --------
721 scipy.linalg.cholesky : Similar function in SciPy.
722 scipy.linalg.cholesky_banded : Cholesky decompose a banded Hermitian
723 positive-definite matrix.
724 scipy.linalg.cho_factor : Cholesky decomposition of a matrix, to use in
725 `scipy.linalg.cho_solve`.
726
727 Notes
728 -----
729
730 .. versionadded:: 1.8.0
731
732 Broadcasting rules apply, see the `numpy.linalg` documentation for
733 details.
734
735 The Cholesky decomposition is often used as a fast way of solving
736
737 .. math:: A \\mathbf{x} = \\mathbf{b}
738
739 (when `A` is both Hermitian/symmetric and positive-definite).
740
741 First, we solve for :math:`\\mathbf{y}` in
742
743 .. math:: L \\mathbf{y} = \\mathbf{b},
744
745 and then for :math:`\\mathbf{x}` in
746

Callers

nothing calls this directly

Calls 8

get_linalg_error_extobjFunction · 0.85
_makearrayFunction · 0.85
_assert_stacked_2dFunction · 0.85
_assert_stacked_squareFunction · 0.85
_commonTypeFunction · 0.85
isComplexTypeFunction · 0.85
wrapFunction · 0.85
astypeMethod · 0.80

Tested by

no test coverage detected