1
function [L, D] = ldlrow (A)
5
% Compute the L*D*L' factorization of A, by rows. Returns
6
% full L and D matrices. This routine serves as an outline
7
% of the numerical factorization performed by ldl.c.
9
% Here is a diagram of how L is computed. "a" means an
10
% entry that is accessed at the kth step, and "c" means an
11
% entry that is computed. A "-" means neither accessed nor
12
% computed. A "1" means the value of the entry is L (the
13
% unit diagonal of L), and it is accessed at the kth step.
14
% A "." means the value is zero.
22
% c c c c c . . . <- kth row of L
35
% - - - - a - - - <- kth row of A
48
% . . . . c . . . <- kth row of D
54
% LDL Version 1.3, Copyright (c) 2006 by Timothy A Davis,
55
% University of Florida. All Rights Reserved. See README for the License.
67
% note the sparse triangular solve. For the sparse
68
% case, the pattern of y is the same as the pattern of
70
y = L (1:k-1, 1:k-1) \ A (1:k-1, k) ;
73
L (k, 1:k-1) = (y ./ D (1:k-1))' ;
76
% compute the diagonal
77
D (k) = A (k,k) - L (k, 1:k-1) * y ;