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 ARn×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 lij1|l_{ij}| \leq 1, giving a growth factor g=maxijuij/maxijaijg = \max_{ij} |u_{ij}| / \max_{ij} |a_{ij}| bounded by 2n12^{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=ajjk=1j1jk2\ell_{jj} = \sqrt{a_{jj} - \sum_{k=1}^{j-1} \ell_{jk}^2} and ij=1jj(aijk=1j1ikjk)\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=51=2\ell_{22} = \sqrt{5 - 1} = 2, 32=(11)/2=0\ell_{32} = (1 - 1)/2 = 0, 33=610=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 mnm \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 aixi1+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/(biaici1)c_i' = c_i / (b_i - a_i c_{i-1}'), di=(diaidi1)/(biaici1)d_i' = (d_i - a_i d_{i-1}') / (b_i - a_i c_{i-1}'). Back substitution: xn=dnx_n = d_n', xi=dicixi+1x_i = d_i' - c_i' x_{i+1}. This arises in cubic spline interpolation and finite difference methods.