Compute the Cholesky factorization of a real or complex matrix: $A = L \cdot L^T $, or $A = U^T \cdot U$, where $A$ is symmetric or complex Hermitian, and $L$, $U$ are lower- or upper-triangular, respectively.
Based on LAPACK Cholesky factorization (*POTRF) routines.
[x] base implementation
[x] tests
[x] exclude unsupported xdp
[x] documentation
[x] submodule
[x] examples
[x] all pure subroutine interfaces
Prior art
Numpy: L = cholesky(a, /, *, upper=False)
Scipy: L = cholesky(a, lower=False, overwrite_a=False, check_finite=True)
L = chol(A, lower [, other_zeroed]): pure function interface
Only $L$ or $U$ is returned. The unused triangular region is zeroed out by default. However, if the user wants to save time, they can set the other_zeroed=.false. argument. In this case, the unused region will not be accessed at all, and will in general contain garbage. This option is to be used with caution part of the expert interface.
Compute the Cholesky factorization of a
real
orcomplex
matrix: $A = L \cdot L^T $, or $A = U^T \cdot U$, where $A$ is symmetric or complex Hermitian, and $L$, $U$ are lower- or upper-triangular, respectively. Based on LAPACK Cholesky factorization (*POTRF
) routines.xdp
pure subroutine
interfacesPrior art
L = cholesky(a, /, *, upper=False)
L = cholesky(a, lower=False, overwrite_a=False, check_finite=True)
Proposed implementation
call cholesky(A, lower [, other_zeroed] [, err])
: inplace pure subroutine interfacecall cholesky(A, chol, lower, [, other_zeroed] [, err])
: non-inplace pure subroutine interfaceL = chol(A, lower [, other_zeroed])
: pure function interfaceOnly $L$ or $U$ is returned. The unused triangular region is zeroed out by default. However, if the user wants to save time, they can set the
other_zeroed=.false.
argument. In this case, the unused region will not be accessed at all, and will in general contain garbage. This option is to be used with caution part of the expert interface.cc: @fortran-lang/stdlib @jalvesz @jvdp1