cholesky¶
- cholesky(x: array, /, *, upper: bool = False) array ¶
Returns the lower (upper) Cholesky decomposition x = LLᵀ (x = UᵀU) of a symmetric positive-definite matrix (or a stack of matrices)
x
, whereL
is a lower-triangular matrix or a stack of matrices (U
is an upper-triangular matrix or a stack of matrices).Note
Whether an array library explicitly checks whether an input array is a symmetric positive-definite matrix (or a stack of matrices) is implementation-defined.
- Parameters:
x (array) – input array having shape
(..., M, M)
and whose innermost two dimensions form square symmetric positive-definite matrices. Should have a floating-point data type.upper (bool) – If
True
, the result must be the upper-triangular Cholesky factorU
. IfFalse
, the result must be the lower-triangular Cholesky factorL
. Default:False
.
- Returns:
out (array) – an array containing the Cholesky factors for each square matrix. If
upper
isFalse
, the returned array must contain lower-triangular matrices; otherwise, the returned array must contain upper-triangular matrices. The returned array must have a floating-point data type determined by Type Promotion Rules and must have the same shape asx
.