In numerical analysis and linear algebra, lower–upper (LU) decomposition or factorization factors a matrix as the product of a lower triangular matrix and an upper triangular matrix (see matrix multiplication and matrix decomposition). The product sometimes includes a permutation matrix as well. LU decomposition can be viewed as the matrix form of Gaussian elimination. Computers usually solve square systems of linear equations using LU decomposition, and it is also a key step when inverting a matrix or computing the determinant of a matrix. It is also sometimes referred to as LR decomposition (factors into left and right triangular matrices). The LU decomposition algorithm for general matrices was introduced by the Polish astronomer Tadeusz Banachiewicz in 1938.
Definitions
Let A be a square matrix. An LU factorization refers to expression of A into product of two factors – a lower triangular matrix L and an upper triangular matrix U such that A = LU. Sometimes factorization is impossible without prior reordering of A to prevent division by zero or uncontrolled growth of rounding errors. Hence alternative expression becomes PAQ = LU, where in formal notation permutation matrix factors P and Q indicate permutation of rows (or columns) of A. In theory P (or Q) is obtained by permutations of rows (or columns) of the identity matrix; in practice the corresponding permutations are applied directly to rows (or columns) of A. Matrix A of size n has n2 coefficients while two triangle matrices combined contain n(n + 1) coefficients, and therefore n coefficients of matrices LU are not independent. The convention is to set L unitriangular, i.e. with all n main diagonal elements equal to one. However, setting instead U matrix unitriangular reduces to the same procedure after transpose of matrix product (cf. properties of matrix transposition): B=A𝖳=(LU)𝖳=U𝖳L𝖳. After transposition, UT is lower triangle while LT is upper unitriangular factor of B. This demonstrates also, that operations on rows (e.g. pivoting) are equivalent to those on columns of a transposed matrix, and in general choice of row or column algorithm offers no advantage. In the lower triangular matrix all elements above the main diagonal are zero, in the upper triangular matrix, all the elements below the diagonal are zero. For example, for a 3 × 3 matrix A, its LU decomposition looks like this: [a11a12a13a21a22a23a31a32a33]=[ℓ1100ℓ21ℓ220ℓ31ℓ32ℓ33][u11u12u130u22u2300u33]. Without a proper ordering or permutations in the matrix, the factorization may fail to materialize. For example, it is easy to verify (by expanding the matrix multiplication) that a11=ℓ11u11. If a11=0, then at least one of ℓ11 and u11 has to be zero, which implies that either L or U is singular. This is impossible if A is nonsingular (invertible). In terms of operations, zeroing/elimination of remaining elements of first column of A involves division of a21,a31 with a11, impossible if it is 0. This is a procedural problem. It can be removed by simply reordering the rows of A so that the first element of the permuted matrix is nonzero. The same problem in subsequent factorization steps can be removed the same way. For numerical stability against rounding errors/division by small numbers it is important to select a11 of large absolute value (cf. pivoting).
LU through recursion The above example of 3 × 3 matrices demonstrates that matrix product of top row and leftmost columns of involved matrices plays special role for LU to succeed. Let us mark consecutive versions of matrices with (0),(1),… and then let us write matrix product A≡A(0)=L(0)U(0) in such way that these rows and columns are separated from the rest. In doing so we shall use block matrix notation, such that e.g. a≡a11 is an ordinary number, 𝐰𝖳≡(a12,a13)𝖳 is a row vector and 𝐯=(a21,a31) is a column vector and A′ is sub-matrix of matrix A(0) without top row and leftmost column. Then we can replace A(0)=L(0)U(0) with a block matrix product. Namely it turns out that one can multiply matrix blocks in such way as if they were ordinary numbers, i.e. row times column, except that now their components are sub-matrices, sometimes reduced to scalars or vectors. Thus u𝐥 denotes a vector obtained from 𝐥 after multiplication of each component by a number u, 𝐥𝐮𝖳 is an outer product of vectors 𝐥,𝐮, i.e. a matrix which first column is u12𝐥, next is u13𝐥 and so on for all components of 𝐮 and L(1)U(1) is a product of sub-matrices of L(0),U(0) (a𝐰𝖳𝐯A′)=(1𝟎𝖳𝐥L(1))(u𝐮𝖳𝟎U(1))=(u𝐮𝖳u𝐥𝐥𝐮𝖳+L(1)U(1)) From equality of first and last matrices follow final u=a, 𝐮=𝐰, 𝐥=(1/a)𝐯 while matrix A′ becomes updated/replaced with A(1)≡L(1)U(1)= A′−𝐥𝐮𝖳. Now comes the crucial observation: nothing prevents us to treat A(1) the same way as we did with A(0), repeatedly. If dimension of A is n × n, after n− 1 such steps all columns 𝐯 form sub-diagonal part of triangle matrix L and all pivots a combined with rows 𝐰𝖳 form upper triangle matrix U, as required. In the above example n = 3 so only two steps suffice. The above procedure demonstrates that at no step the top diagonal pivot element a of consecutive sub-matrices can be zero. To avoid it columns or rows may be swapped so that a becomes nonzero. Such procedure involving permutation is called LUP, decomposition with pivoting. Permutation of columns corresponds to matrix product AQ(0) where Q(0) is a permutation matrix, i.e. the identity matrix I after the same column permutation. After all steps such LUP decomposition applies to AQ(0)⋯Q(n−1)≡AQ=LU. Present computation scheme and similar in Cormen et al. are examples of recurrence algorithms. They demonstrate two general properties of LU factorization:
Recurrence algorithms are not overly costly in terms of algebraic operations yet they suffer from practical disadvantage due to need to update and store most elements of A at each step. It will be seen that by reordering calculations it is possible to dispose with storage of intermediate values.
… excerpt ends here. Continue reading the full article.


