Skip to content

Commit b225a85

Browse files
authored
Clarify pros, cons and limitations of Cholesky and LDLt (#621)
I find it worth pointing out explicitly in the docs that LDLt, which mathematically looks like a drop-in replacement for Cholesky that does away with the positive definiteness requirement, comes with the following caveats: * It fails for a lot of matrices (for example, `ldlt(Symmetric(sprandn(1000, 1000, p)))` basically never succeeds for any relevant sparsity `p`) due to the requirement that all leading principal minors be well-conditioned * In CHOLMOD, `ldlt` is significantly slower than `cholesky` as it does not have a supernodal implementation So I made some docstring edits to clarify the relationship and tradeoffs between `cholesky` and `ldlt`. Citation for these claims: pages 106-107 in the CHOLMOD user guide at https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/v7.10.3/CHOLMOD/Doc/CHOLMOD_UserGuide.pdf
1 parent 3d42644 commit b225a85

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/solvers/cholmod.jl

+10
Original file line numberDiff line numberDiff line change
@@ -1563,6 +1563,9 @@ Setting the optional `shift` keyword argument computes the factorization of
15631563
it should be a permutation of `1:size(A,1)` giving the ordering to use
15641564
(instead of CHOLMOD's default AMD ordering).
15651565
1566+
See also [`ldlt`](@ref) for a similar factorization that does not require
1567+
positive definiteness, but can be significantly slower than `cholesky`.
1568+
15661569
# Examples
15671570
15681571
In the following example, the fill-reducing permutation used is `[3, 2, 1]`.
@@ -1728,6 +1731,10 @@ To include the effects of permutation, it is typically preferable to extract
17281731
`P'*L`) and `LtP = F.UP` (the equivalent of `L'*P`).
17291732
The complete list of supported factors is `:L, :PtL, :D, :UP, :U, :LD, :DU, :PtLD, :DUP`.
17301733
1734+
Unlike the related Cholesky factorization, the ``LDL'`` factorization does not
1735+
require `A` to be positive definite. However, it still requires all leading
1736+
principal minors to be well-conditioned and will fail if this is not satisfied.
1737+
17311738
When `check = true`, an error is thrown if the decomposition fails.
17321739
When `check = false`, responsibility for checking the decomposition's
17331740
validity (via [`issuccess`](@ref)) lies with the user.
@@ -1737,6 +1744,9 @@ Setting the optional `shift` keyword argument computes the factorization of
17371744
it should be a permutation of `1:size(A,1)` giving the ordering to use
17381745
(instead of CHOLMOD's default AMD ordering).
17391746
1747+
See also [`cholesky`](@ref) for a factorization that can be significantly
1748+
faster than `ldlt`, but requires `A` to be positive definite.
1749+
17401750
!!! note
17411751
This method uses the CHOLMOD[^ACM887][^DavisHager2009] library from [SuiteSparse](https://github.com/DrTimothyAldenDavis/SuiteSparse).
17421752
CHOLMOD only supports real or complex types in single or double precision.

0 commit comments

Comments
 (0)