LU factorisation
For a square matrix $A\in \R^{n\times n}$ non-singular, find $L$ and $U$ so that $$ \begin{align*} A = LU \end{align*} $$ where
-
$L\in \R^{n\times n}$ is lower unitriangular (i.e. $l_{ij} = 0$ for $i<j$ and $l_{ii}=1$ for all $i$); and
-
$U\in \R^{n\times n}$ is upper triangular (i.e. $u_{ij} = 0$ for $i>j$) and non-singular ($u_{ii}\neq 0$ for all $i$).
Let $\v l_k$ be the columns of $L$ and $\v u_k^T$ be the rows of $U$. By matrix multiplication, $$ \begin{align*} A = \sum_{k=1}^{n} \v l_k \v u_k^T. \end{align*} $$
Let $A^{(0)} = A$.
-
Take $\v u_1^T=$ first row of $A^{(0)}$ and $\v l_1 = \frac{1}{A_{11}^{(0)}}\times$ first column of $A^{(0)}$. Then $$ \begin{align*} A^{(1)} := A^{(0)} - \v l_1 \v u_1^T = \pmat{0 & 0 & \ldots & 0 \\ 0 & * & \ldots & * \\ \vdots & \vdots & \ddots & \vdots \\ 0 & * & \ldots & * }. \end{align*} $$
-
Take $\v u_2^T=$ second row of $A^{(1)}$ and $\v l_2 = \frac{1}{A_{22}^{(1)}}\times$ second column of $A^{(1)}$. Then $$ \begin{align*} A^{(2)} := A^{(1)} - \v l_2 \v u_2^T = \pmat{0 & 0 & 0 & \ldots & 0 \\ 0 & 0 & 0 & \ldots & 0 \\ 0 & 0 & * & \ldots & * \\ \vdots & \vdots & \vdots & \ddots & \vdots \\ 0 & 0 & * & \ldots & * }. \end{align*} $$
And so on.
This takes $O(n^3)$ computations. With a better algorithm, we can get $O(n^{\log_2 7}) \approx O(n^{2.8})$.
Example (direct approach of LU factorisation)
The LU algorithm fails if $A_{kk}^{(k-1)} = 0$. To avoid this and to improve numerical stability, we exchange rows so that the element of largest magnitude in column $k$ is at the pivotal position $(k,k)$. This pre-multiplies a permutation matrix.
We obtain a factorisation $$ \begin{align*} PA = LU \implies A = P^T LU \end{align*} $$ where $P$ is the product of all permutation matrices multiplied.
-
Solving linear systems: to solve $A\v x = \v b$ where $A$ is non-singular and square, factorise $A=LU$ (in $O(n^3)$ time), solve $L\v y = \v b$ by forward substitution (in $O(n^2)$ time) and solve $U\v x = \v y$ by backward substitution (in $O(n^2)$ time).
This is better than Gaussian elimination ($O(n^3)$ time) if we need to solve $A\v x=\v b$ for the same $A$ but many different $\v b$.
-
Finding determinant of $A$: $\det A = \det L \det U = 1\cdot \prod_{i=1}^{n} u_{ii}$.
-
Inverting $A$: solve $A\v a\inv_k = \v e_k$ for each $k$.
A square matrix $A\in \R^{n\times n}$ is said to be strictly regular if all its principal minors (top left blocks of $A$, i.e. $A_1 = \pmat{a_{11}}, A_2 = \pmat{a_{11} & a_{12} \\ a_{21} & a_{22}}, \ldots, A_n = A$) are non-singular.
A square matrix $A\in \R^{n\times n}$ admits an LU factorisation iff $A$ is strictly regular.
-
Every non-singular matrix $A$ admits an LU factorisation with pivoting, i.e. $PA = LU$ for some permutation matrix.
LU factorisation is unique, i.e. if $L_1U_1=L_2U_2$ are two LU factorisations ($L_i$ lower unitriangular, $U_i$ non-singular and upper triangular), then $L_1=L_2$ and $U_1=U_2$.
$A\in \R^{n\times n}$ is strictly regular iff it admits a factorisation $A = LDU$, where $L$ is lower unitriangular, $D$ is non-singular and diagonal, and $U$ is upper unitriangular.
Moreover the factorisation is unique.
$A\in \R^{n\times n}$ is strictly regular and symmetric iff it admits a factorisation $A = LDL^T$ where $L$ is lower unitriangular and $D$ is non-singular and diagonal.
Moreover the factorisation is unique.
$A\in \R^{n\times n}$ is symmetric positive definite iff it admits a factorisation $A=LDL^T$ where $L$ is lower unitriangular and $D$ is diagonal with positive entries.
Moreover the factorisation is unique.
$A\in \R^{n\times n}$ is symmetric positive definite iff it admits a factorisation $A = LL^T$ where $L$ is lower triangular with a positive diagonal.
Moreover the factorisation is unique.
A square matrix $A\in \R^{n\times n}$ is said to be strictly diagonally dominant (by rows) if $$ \begin{align*} |a_{ii}| > \sum_{\substack{j=1 \\j\neq i}}^n |a_{ij}| \qquad \forall \text{row }i=1,\ldots,n. \end{align*} $$
If $A\in \R^{n\times n}$ is strictly diagonally dominant, then $A$ is strictly regular.
-
Therefore $A$ admits an LU factorisation.
For an $n\times n$ matrix $A$, for each row $i$ define $$ R_i = \sum_{j\neq i} |A_{ij}| $$ and define a disk $D_i(A_{ii}, R_i)\subset\C$ to be the circle with centre $A_{ii}$ and radius $R_i$.
Then every eigenvalues lie within a disk $D_i$ for some $i$.
A matrix is said to be sparse if most entries are zero. By contrast, a matrix with most entries non-zero is called dense.
A square matrix $A$ is a band matrix with bandwidth $2r+1$ if $a_{ij} = 0$ for $|i-j|>r$.
Let $A=LU$ be the LU factorisation of a sparse matrix $A$. Then
-
all leading zeros in the rows of $A$ to the left of the diagonal are inherited by $L$; and
-
all leading zeros in the columns of $A$ above the diagonal are inherited by $U$.
-
If $A$ is a band matrix, then $L$ and $U$ are also band matrices with the same bandwidth as $A$.
-
Sometimes if $A$ is sparse, we can try reordering its rows and columns to have more leading zeros, thus reducing the fill-in in $L$ and $U$.
The LU algorithm takes $O(nr^2)$ operations to factorise for a banded $A$ with bandwidth $r$. And to solve a linear system after factorisation, it takes $O(nr)$ operations.