2
LDLSPARSE LDL' factorization of a real, sparse, symmetric matrix
5
[L, D, Parent, fl] = ldlsparse (A)
6
[L, D, Parent, fl] = ldlsparse (A, P)
7
[x, fl] = ldlsparse (A, [ ], b)
8
[x, fl] = ldlsparse (A, P, b)
10
Let I = speye (size (A,1)). The factorization is (L+I)*D*(L+I)' = A or A(P,P).
11
A must be sparse, square, and real. Only the diagonal and upper triangular
12
part of A or A(P,P) are accessed. L is lower triangular with unit diagonal,
13
but the diagonal is not returned. D is a diagonal sparse matrix. P is either
14
a permutation of 1:n, or an empty vector, where n = size (A,1). If not
15
present, or empty, then P=1:n is assumed. Parent is the elimination tree of
16
A or A(P,P). If positive, fl is the floating point operation count, or
17
negative if any entry on the diagonal of D is zero.
19
In the x = ldlsparse (A, P, b) usage, the LDL' factorization is not returned.
20
Instead, the system A*x=b is solved for x, where both b and x are dense.
22
If a zero entry on the diagonal of D is encountered, the LDL' factorization is
23
terminated at that point. If there is no fl output argument, an error occurs.
24
Otherwise, fl is negative, and let d=-fl. D(d,d) is the first zero entry on
25
the diagonal of D. A partial factorization is returned. Let B = A, or A(P,P)
26
if P is present. Let F = (L+I)*D*(L+I)'. Then F (1:d,1:d) = B (1:d,1:d).
27
Rows d+1 to n of L and D are all zero.
29
See also chol, ldl, ldlsymbol, symbfact, etree
32
Testing ldlsparse and ldlsymbol:
33
norm (LDL'-PAP') = 6.51562e-15
34
residual 3.55986e-15 for ldlsparse, flops 14813.0
35
residual 3.86691e-15 for ldlsparse solve
36
residual 3.64202e-15 for ldlrow.m
37
norm (LDL'-PAP') = 6.63575e-15
38
residual 2.96267e-15 for ldlsparse, flops 14813.0
39
residual 3.53833e-15 for ldlsparse solve
41
Original matrix: nz in L: 2206 flop count: 81044
42
Permuted matrix: nz in L: 893 flop count: 14813
44
ldldemo: all tests passed