ldl_factor_ex(A: Tensor, hermitian: bool = False, check_errors: bool = False)LDL factorization with an explicit status.
Variant of ldl_factor that returns the factors of a matrix
whose is singular too, with an info code following
LAPACK sytrf:
info == 0— is non-singular.info == k > 0— , a block, is the first one that is exactly zero (or NaN), 1-based. The factorization is complete, butldl_solvewould divide by that block.
Parameters
Symmetric / Hermitian matrix of shape
(*, n, n).hermitian(bool, keyword - only)= FalseAs
ldl_factor. Default False.check_errors(bool, keyword - only)= FalseIf
True, raise LinAlgError for the first failed matrix
instead of reporting it through info.Returns
LD, pivots : TensorThe packed factor (*, n, n) and int32 pivots (*, n),
as ldl_factor returns them.
Notes
LD differentiates as ldl_factor's does — the reference
framework does not differentiate it. A matrix whose info is
non-zero receives no gradient, as a failed matrix of the other
*_ex variants does.
Examples
>>> import lucid
>>> from lucid.linalg import ldl_factor_ex
>>> LD, piv, info = ldl_factor_ex(lucid.zeros(2, 2))
>>> int(info)
1