Gaussian elimination, LU, and LDL
9/12/2026
For some projects I am working on, I wanted to understand sparse factorizations better, but first I needed to get the dense case straight. This is the first of three notes collecting the material I found most useful on the topic.
None of the material is new, and all of it is covered more fully in Trefethen and Bau (1997) and Golub and Van Loan (2013). The error analysis I quote without proof is developed carefully in Higham (2002).
Gaussian elimination is a factorization
Suppose . One step of Gaussian elimination uses the pivot to clear the first column below the diagonal. Partition
With , the elimination step is
The trailing matrix is the Schur complement of the pivot. Write for the unit lower triangular matrix that produced it. Repeating the step on each successive Schur complement produces and an upper triangular with , so
Each inverse elimination matrix is unit lower triangular, and so is their product . Its subdiagonal entries are exactly the multipliers used along the way. LU is therefore not a construction layered on top of Gaussian elimination. It is a record of the elimination.
Once the factorization is in hand, solving is two triangular solves,
The factorization costs flops for a dense matrix, and each solve costs . This asymmetry is the reason to keep the factors and reuse them rather than form .
Existence is an algebraic condition. If every leading principal submatrix of order less than is nonsingular, then has an LU factorization with unit lower triangular , and that factorization is unique when is nonsingular. Nothing in the condition is numerical. A pivot can be nonzero and still be small enough to produce large multipliers and a poor factorization in floating point.
Pivoting bounds the multipliers, not the growth
Dense LU normally uses partial pivoting. Step selects the largest-magnitude entry of column at or below the diagonal, exchanges its row with row , and only then eliminates. The search costs comparisons, or over the whole factorization.
The resulting factorization has the form
where collects the row exchanges. Because the pivot has maximal magnitude in its column, every multiplier satisfies . This says nothing about the entries created in . Those are measured separately. Write for the entries present at the start of step , so that . The growth factor is
Wilkinson (1961) showed that partial pivoting admits , and the bound is attained. Nor is exponential growth only a textbook artifact. Wright (1993) collects problems from applications on which partial pivoting fails. Growth is nonetheless modest in many practical problems, and Trefethen and Schreiber (1990) give a statistical account of why.
A factorization algorithm is backward stable if its computed factors exactly factor a nearby matrix, with relative perturbation of order unit roundoff up to dimension-dependent constants. The standard backward-error statement keeps the two effects separate. The computed factors satisfy
where is unit roundoff, the absolute values and inequality are entrywise, and hides dimension-dependent constants. The product is ordinary matrix multiplication. Partial pivoting controls . Element growth controls . LU with partial pivoting is therefore backward stable when growth is moderate. It is not unconditionally backward stable in the strong sense that Householder QR is.
To see how the row exchanges collect into , return to the individual steps. Each contributes a permutation and an elimination. Let be the transposition applied at step and the elimination matrix that follows it. The reduction to upper triangular form reads
This is not yet in the form , because the permutations are interleaved with the eliminations. They can be pulled out to the right. Write , where is the th standard basis vector and holds the multipliers of step , with nonzeros only below entry . If , then exchanges two rows whose indices both exceed . It therefore fixes and only reorders the entries of :
The conjugate is another elimination matrix in the same column, holding the same multipliers in a different order. Applying this repeatedly walks each transposition to the right, past every elimination matrix standing between it and . Writing for conjugated by all the transpositions that follow it,
so with and we recover the familiar
Nothing about the elimination changed. The exchanges were chosen one step at a time, during the factorization, and only afterwards collected into a single permutation applied to up front. This is also why can be built in place. Each carries the multipliers of step permuted by the exchanges that came later. That is exactly what an implementation does when it applies each row swap to the multipliers already stored.
Solving now permutes the right-hand side first, so the triangular solves become and .
Complete pivoting trades a more expensive search for stronger growth control. It searches the entire trailing matrix and applies both row and column permutations. Its growth bound is subexponential, but the search costs comparisons, the same order as the arithmetic itself.
Rook pivoting alternates row and column searches until a candidate is maximal in magnitude in both its active row and its active column. It buys growth control close to complete pivoting at a search cost usually closer to partial pivoting, as Foster (1997) quantifies.
Which of these strategies is affordable for a sparse matrix is a separate question, because every exchange also changes the structure of the factors. I take that up in the next note.
Symmetry turns LU into LDL
Now suppose and elimination proceeds without exchanges. Each successive Schur complement remains symmetric. In the partition above , so the Schur complement is
which is again symmetric. The elimination step can therefore be written with transposed factors on either side:
Repeating this identity on the Schur complement and recording the scalar pivots in gives
with unit lower triangular and diagonal. This is Gaussian elimination with the symmetry left in. It stores one triangular factor instead of two and costs flops, roughly half of general LU.
Written column by column, the factorization is a sum of rank-one terms. If denotes the th column of , so that and sits below it, then
Each elimination step removes one term. The terms that remain are supported on the trailing block, where they sum to the Schur complement. This is the right-looking view of the algorithm, and it is the one to hold onto for sparsity. The pattern of decides which entries of the trailing matrix a single pivot can reach, and therefore how many new nonzeros, or fill, it creates.
For a symmetric positive definite matrix, every pivot is positive and no pivoting is required. The Schur complement identity proves it in one line. If
then and, for every nonzero ,
The Schur complement is again positive definite, so the argument repeats on it.
The scalar LDL recurrence is left-looking. It builds column from the columns already finished rather than updating the trailing block as each pivot is eliminated:
LDL avoids square roots and keeps the signs of the pivots explicit. The inertia of a symmetric matrix is the triple of counts of its positive, negative, and zero eigenvalues. In exact arithmetic, and whenever the unpivoted factorization exists, the signs of the pivots give the inertia of by Sylvester's law.
Symmetry alone does not make unpivoted elimination safe. A nonsingular symmetric indefinite matrix can have a zero or tiny diagonal pivot, and there is no guarantee that any diagonal entry is usable. The smallest example is
which is symmetric and nonsingular with no nonzero diagonal entry at all. The remedy is to widen what counts as a pivot, and this matrix is its own pivot. A stable factorization then has the form
where is block diagonal with and blocks, following Bunch and Parlett (1971).
Choosing these blocks involves the same search-cost tradeoff as LU pivoting. The Bunch–Kaufman rule uses at most two column searches per step and bounds element growth, but not the entries of . Bounded Bunch–Kaufman and symmetric rook pivoting search further to control the multipliers as well, as analyzed by Ashcraft, Grimes, and Lewis (1998).
The permutation here acts on both sides. Unlike LU row pivoting, a symmetric factorization may only reorder rows and columns together. That constraint is what will make symmetric pivoting hard to reconcile with an ordering chosen for sparsity.
Solving from these factors mirrors the LU case with one step inserted in the middle:
The middle solve is diagonal, or block diagonal once pivots appear, and costs either way.
Cholesky is scaled LDL
For every is positive, so the pivots can be split as and absorbed into the triangular factors:
where is lower triangular with positive diagonal . This is the Cholesky factorization, and the positive diagonal makes it unique. I name the factor following Golub and Van Loan, since already names the unit lower triangular factor and would suggest an upper triangular one.
Cholesky costs the same flops as LDL, plus square roots. It is backward stable without pivoting provided the computation completes: the computed factor satisfies
up to dimension-dependent constants. Positive definiteness removes the stability reason to pivot. Permutations remain essential in sparse problems, but only to reduce fill.
The distinction appears when a pivot is nonpositive. A nonpositive proves in exact arithmetic that is not positive definite. LDL records a negative pivot and continues. Cholesky meets it as a negative argument to a square root and stops. A zero pivot before the last column makes the scalar LDL recurrence break down, since it divides by . A zero final pivot requires no division and does not prevent an LDL factorization, though the matrix is singular.
In floating point, even an exactly SPD matrix sufficiently close to singularity can produce a nonpositive computed pivot and cause Cholesky to stop. A small negative value may therefore reflect roundoff, or an input that is only numerically semidefinite. Silently clipping it changes the problem, so a regularization or diagonal shift belongs in the model rather than in a solver.
The normal equations deserve the same caution. When has full column rank, is SPD, but its 2-norm condition number is . Cholesky is stable only for the matrix it is handed, not for the one that matrix came from. Björck (1996) is the standard account.
The difference that matters for what follows is that the square root demands positivity and LDL does not. Unpivoted LDL asks only that the leading principal submatrices of order less than be nonsingular. It exposes the inertia, and with a symmetric permutation and blocks it covers every nonsingular symmetric matrix. Cholesky is the special case in which the pivots happen to be positive. That is why the rest of this series is written in terms of LDL.
Block elimination is the same identity
The scalar formulas hide the form that high-performance implementations actually use. Partition an SPD matrix after a leading block:
First factor , then solve , and finally factor the Schur complement
This is block Cholesky. It is the same step as before with a leading submatrix in place of a scalar pivot. For block LDL, first factor , then solve for and form the Schur complement:
Factoring completes the block LDL factorization. In both versions, most of the work is the matrix–matrix trailing update, which is why blocked dense implementations reach level-3 BLAS speed.
Sparse multifrontal methods run on the same identity. There the leading block is a group of columns eliminated together, and the update is not applied to right away. It is held as a dense contribution block and assembled into a later frontal matrix, following Duff and Reid (1983) and the account in Liu (1992). Block elimination is the reason a sparse factorization can spend most of its time inside dense kernels. I take this up in the third note.
Left-looking, right-looking, and multifrontal algorithms differ mainly in when they assemble and apply Schur-complement updates. In exact arithmetic, for a fixed ordering, they produce the same factor. Their memory traffic and their access to dense kernels differ a great deal.