ConceptComplete

Direct Methods for Linear Systems

Direct methods solve a linear system Ax=bAx = b in a finite number of operations. The cornerstone is Gaussian elimination, which factors AA into triangular matrices. Understanding pivoting strategies and operation counts is essential for practical implementation.


Gaussian Elimination and LU Factorization

Definition5.1LU Decomposition

An LU decomposition of A∈Rn×nA \in \mathbb{R}^{n \times n} is a factorization A=LUA = LU where LL is unit lower triangular (ℓii=1\ell_{ii} = 1) and UU is upper triangular. The system Ax=bAx = b reduces to solving Ly=bLy = b (forward substitution, O(n2)O(n^2)) then Ux=yUx = y (back substitution, O(n2)O(n^2)). The factorization costs 23n3+O(n2)\frac{2}{3}n^3 + O(n^2) flops.

Definition5.2Partial and Complete Pivoting

Partial pivoting selects the largest entry in the current column below the diagonal as pivot: PA=LUPA = LU where PP is a permutation matrix. Complete pivoting selects the largest entry in the entire remaining submatrix: PAQ=LUPAQ = LU. Partial pivoting suffices in practice and guarantees ∣lij∣≤1|l_{ij}| \leq 1, giving a growth factor g=max⁡ij∣uij∣/max⁡ij∣aij∣g = \max_{ij} |u_{ij}| / \max_{ij} |a_{ij}| bounded by 2n−12^{n-1} (though g=O(n2/3)g = O(n^{2/3}) in practice).


Cholesky Factorization

Definition5.3Cholesky Decomposition

For a symmetric positive definite (SPD) matrix AA, the Cholesky factorization is A=LLTA = LL^T where LL is lower triangular with positive diagonal entries. The algorithm computes ℓjj=ajj−∑k=1j−1ℓjk2\ell_{jj} = \sqrt{a_{jj} - \sum_{k=1}^{j-1} \ell_{jk}^2} and ℓij=1ℓjj(aij−∑k=1j−1ℓikℓjk)\ell_{ij} = \frac{1}{\ell_{jj}}\left(a_{ij} - \sum_{k=1}^{j-1} \ell_{ik}\ell_{jk}\right) for i>ji > j. The cost is 13n3\frac{1}{3}n^3 flops, half that of LU. No pivoting is needed: the factorization is always numerically stable for SPD matrices.

ExampleCholesky Example

For A=(422251216)A = \begin{pmatrix} 4 & 2 & 2 \\ 2 & 5 & 1 \\ 2 & 1 & 6 \end{pmatrix}: ℓ11=2\ell_{11} = 2, ℓ21=1\ell_{21} = 1, ℓ31=1\ell_{31} = 1, ℓ22=5−1=2\ell_{22} = \sqrt{5 - 1} = 2, ℓ32=(1−1)/2=0\ell_{32} = (1 - 1)/2 = 0, ℓ33=6−1−0=5\ell_{33} = \sqrt{6 - 1 - 0} = \sqrt{5}. Thus L=(200120105)L = \begin{pmatrix} 2 & 0 & 0 \\ 1 & 2 & 0 \\ 1 & 0 & \sqrt{5} \end{pmatrix}.


Banded and Sparse Systems

RemarkExploiting Sparsity

For banded matrices with bandwidth m≪nm \ll n, LU factorization costs O(m2n)O(m^2 n) instead of O(n3)O(n^3). Sparse direct solvers use fill-reducing orderings (minimum degree, nested dissection) to minimize the fill-in (new nonzeros created during factorization). Nested dissection achieves O(n3/2)O(n^{3/2}) fill-in for 2D problems and O(n2)O(n^2) for 3D, compared to O(n2)O(n^2) and O(n4/3)O(n^{4/3}) respectively for the dense case.

ExampleThomas Algorithm for Tridiagonal Systems

A tridiagonal system aixi−1+bixi+cixi+1=dia_i x_{i-1} + b_i x_i + c_i x_{i+1} = d_i is solved in O(n)O(n) operations by the Thomas algorithm (specialized LU without pivoting). Forward sweep: ci′=ci/(bi−aici−1′)c_i' = c_i / (b_i - a_i c_{i-1}'), di′=(di−aidi−1′)/(bi−aici−1′)d_i' = (d_i - a_i d_{i-1}') / (b_i - a_i c_{i-1}'). Back substitution: xn=dn′x_n = d_n', xi=di′−ci′xi+1x_i = d_i' - c_i' x_{i+1}. This arises in cubic spline interpolation and finite difference methods.