A sequence of linear systems often changes only slightly from one solve to the next. If only the right-hand side changes, the existing factors can be used directly. If the matrix changes, we ask whether the new solve can be reduced to solves with the old matrix and a much smaller correction problem.
We derive this reduction for changes of rank one and then for changes of rank \(r\). A separate construction uses neighboring block interactions to keep elimination local. In both cases, the amount of work saved depends on which entries change and on the conditioning of the remaining solves.
Tridiagonal Systems
Low rank describes how a matrix changes. Banded structure describes which unknowns interact. A tridiagonal matrix couples each unknown only to its two neighbors. Gaussian elimination preserves this pattern when no row interchange is required, so the solve takes linear rather than cubic work.
Consider the equations \[
\begin{align}
a_i x_{i-1}+d_i x_i+c_i x_{i+1}=r_i,
\end{align}
\] with the missing endpoint terms omitted. Let \(\widetilde d_1=d_1\) and \(\widetilde r_1=r_1\). For \(i=2,...,n\), compute \[
\begin{align}
m_i&=\frac{a_i}{\widetilde d_{i-1}}, \\
\widetilde d_i&=d_i-m_i c_{i-1}, \\
\widetilde r_i&=r_i-m_i\widetilde r_{i-1}.
\end{align}
\] Backward substitution gives \[
\begin{align}
x_n=\frac{\widetilde r_n}{\widetilde d_n},\qquad
x_i=\frac{\widetilde r_i-c_i x_{i+1}}{\widetilde d_i},
\quad i=n-1,...,1.
\end{align}
\]
If every modified pivot \(\widetilde d_i\) is nonzero, the Thomas algorithm solves an \(n\times n\) tridiagonal system in \(O(n)\) operations and \(O(n)\) storage. The diagonal and right-hand side may be overwritten, so the additional storage can be constant when the input need not be retained.
The forward elimination loop visits \(i=2,...,n\). At each position it forms one multiplier, updates one diagonal entry, and updates one right-hand-side entry. Each operation involves a fixed number of scalars, independent of \(n\). Thus the entire forward loop costs at most a constant times \(n-1\) operations.
Back substitution starts with one division for the final unknown. Each preceding unknown is computed from one upper-diagonal coefficient, the next solution component, its right-hand-side entry, and its modified diagonal. Again the work per position is bounded by a constant. The backward loop therefore costs \(O(n)\) as well.
The data comprise \(n\) diagonal entries, \(n-1\) entries on each adjacent diagonal, and \(n\) right-hand-side entries. Their total count is \(4n-2\). Modified diagonal and right-hand-side entries can overwrite their old values because those old values are never needed by a later step. The input and output storage is therefore \(O(n)\), with only a constant number of extra scalar temporaries if overwriting is allowed.
These counts assume every required pivot is nonzero. The cost argument establishes neither the existence of those pivots nor numerical stability.
(Pivoting) The Thomas algorithm is unpivoted elimination. It is safe for important classes such as symmetric positive definite tridiagonal matrices, but a general tridiagonal matrix can have a zero or dangerously small pivot. In that case, use a tridiagonal solver with pivoting or a general banded factorization, even though pivoting may enlarge the band.
Block-Tridiagonal Systems
Many models place several unknowns at each location or time level. Grouping those unknowns produces a block-tridiagonal matrix. The scalar divisions in the Thomas algorithm become solves with dense diagonal blocks, and the scalar updates become matrix products.
A block-tridiagonal matrix has the form \[
\begin{align}
\bA=
\begin{pmatrix}
\bD_1 & \bU_1 \\
\bL_1 & \bD_2 & \bU_2 \\
& \ddots & \ddots & \ddots \\
&& \bL_{s-1} & \bD_s
\end{pmatrix}.
\end{align}
\] The diagonal blocks \(\bD_k\) are square. Neighboring blocks may have different sizes, so \(\bU_k\) and \(\bL_k\) may be rectangular.
Let \(\bS_1=\bD_1\). For \(k=1,...,s-1\), suppose \(\bS_k\) is nonsingular and compute \[
\begin{align}
\bM_k\bS_k=\bL_k,\qquad
\bS_{k+1}=\bD_{k+1}-\bM_k\bU_k.
\end{align}
\] If the final block \(\bS_s\) is also nonsingular, then \(\bA=\mathcal{L}\mathcal{U}\), where \(\mathcal{L}\) is block unit lower bidiagonal with blocks \(\bM_k\), and \(\mathcal{U}\) is block upper bidiagonal with diagonal blocks \(\bS_k\) and upper blocks \(\bU_k\).
We check every possible nonzero block of \(\mathcal L\mathcal U\). The lower factor has identity diagonal blocks and subdiagonal blocks \(\bM_k\). The upper factor has diagonal blocks \(\bS_k\) and superdiagonal blocks \(\bU_k\).
In position \((k,k+1)\), the only contributing product is \(\bI\bU_k\), which gives the required upper block. In position \((k+1,k)\), the only contributing product is \(\bM_k\bS_k\). The construction solves \(\bM_k\bS_k=\bL_k\), so this is the required lower block.
For the first diagonal position, the product is \(\bI\bS_1=\bD_1\). At a later diagonal position \(k\), two terms contribute: \[
\begin{align}
(\mathcal L\mathcal U)_{kk}
=\bS_k+\bM_{k-1}\bU_{k-1}.
\end{align}
\] The defining update \(\bS_k=\bD_k-\bM_{k-1}\bU_{k-1}\) makes this sum equal to \(\bD_k\).
A block farther from the diagonal cannot receive a contribution. In row \(i\), \(\mathcal L\) can have nonzero blocks only in columns \(i-1\) and \(i\). The corresponding rows of \(\mathcal U\) can reach only columns \(i-1\), \(i\), and \(i+1\). Hence their product is block tridiagonal. We have checked all its potentially nonzero blocks and found exactly those of \(\bA\). This proves the factorization.
Thomas as scalar block elimination. Take every block in the referenced result to have size one. Derive the three forward recurrences in the referenced result and the backward substitution formula. Identify the modified scalar pivot with the scalar Schur complement.
The equation \(\bM_k\bS_k=\bL_k\) should not be evaluated with an inverse. Instead, solve the transposed system \[
\begin{align}
\bS_k^T\bM_k^T=\bL_k^T
\end{align}
\] using the stored factorization of \(\bS_k\).
Partition the right-hand side into blocks \(\bb_k\). First compute \[
\begin{align}
\by_1&=\bb_1, \\
\by_k&=\bb_k-\bM_{k-1}\by_{k-1},\qquad k=2,...,s.
\end{align}
\] Then solve backward: \[
\begin{align}
\bS_s\bx_s&=\by_s, \\
\bS_k\bx_k&=\by_k-\bU_k\bx_{k+1},\qquad k=s-1,...,1.
\end{align}
\] The same recurrences accept several right-hand sides at once.
Transpose block solve. Starting from \(\bA=\mathcal{L}\mathcal{U}\) in the referenced result, derive the two sweeps for \(\bA^T\bx=\bb\). State the direction of each sweep and identify which stored off-diagonal block it uses.
(Work and storage) If there are \(s\) blocks of comparable size \(p\), the factorization costs \(O(sp^3)\) operations and stores \(O(sp^2)\) numbers. A solve with \(q\) right-hand sides costs \(O(sp^2q)\). Since the full order is \(n=sp\), the factorization cost is \(O(n^3/s^2)\). Unequal neighboring block sizes add rectangular products, so the largest block often controls the cost.
(Transpose and multiple right-hand sides) The factors also solve \(\bA^T\bx=\bb\). The transpose reverses the order of the two sweeps and interchanges the stored upper and lower blocks. Keep several right-hand sides together throughout the sweeps. This reuses memory and is usually faster than processing the columns separately.
The Symmetric Positive Definite Case
When the block-tridiagonal matrix is symmetric positive definite, block Cholesky removes the need for pivoting and stores only one off-diagonal side. The key fact is that every diagonal Schur complement remains positive definite.
Let \[
\begin{align}
\bA=\begin{pmatrix}\bD&\bB^T\\\bB&\bC\end{pmatrix}
\end{align}
\] be symmetric positive definite. Then \(\bD\) is positive definite, and the Schur complement \[
\begin{align}
\bC-\bB\bD^{-1}\bB^T
\end{align}
\] is positive definite.
For every nonzero \(\bx\), testing with \((\bx,\bzero)^T\) gives \[
\begin{align}
\begin{pmatrix}\bx\\\bzero\end{pmatrix}^T \bA \begin{pmatrix}\bx\\\bzero\end{pmatrix} = \bx^T\bD\bx > 0,
\end{align}
\] so \(\bD\) is positive definite and \(\bD^{-1}\) exists. The leading block \(\bD\) is symmetric because it is a principal block of the symmetric matrix. Thus \(\bD^{-1}\) is symmetric too, by transposing \(\bD\bD^{-1}=\bI\). This fact is used when transposing the chosen vector in the next expansion.
Now let \(\by \neq \bzero\), and choose \(\bx = -\bD^{-1}\bB^T\by\). Expanding the block quadratic form: \[
\begin{align}
\begin{pmatrix}\bx\\\by\end{pmatrix}^T
\begin{pmatrix}\bD&\bB^T\\\bB&\bC\end{pmatrix}
\begin{pmatrix}\bx\\\by\end{pmatrix}
&= \bx^T\bD\bx + \bx^T\bB^T\by + \by^T\bB\bx + \by^T\bC\by \\
&= (-\bD^{-1}\bB^T\by)^T\bD(-\bD^{-1}\bB^T\by) + 2(-\bD^{-1}\bB^T\by)^T\bB^T\by + \by^T\bC\by \\
&= \by^T\bB\bD^{-1}\bB^T\by - 2\by^T\bB\bD^{-1}\bB^T\by + \by^T\bC\by \\
&= \by^T(\bC - \bB\bD^{-1}\bB^T)\by.
\end{align}
\] Because \(\by \neq \bzero\), the compound vector \((\bx,\by)^T\) is nonzero. The positive definiteness of \(\bA\) implies that this quadratic form is strictly positive: \[
\begin{align}
\by^T(\bC - \bB\bD^{-1}\bB^T)\by > 0.
\end{align}
\] The Schur complement \(\bC - \bB\bD^{-1}\bB^T\) is therefore positive definite.
The Schur complement is symmetric because both \(\bC\) and \(\bB\bD^{-1}\bB^T\) are symmetric. The quadratic-form calculation proves strict positivity for every nonzero \(\by\). These two facts together prove that it is SPD and justify repeating the same elimination step on the trailing block.
Block Cholesky follows the same order as block LU. Factor \(\bS_k=\bF_k\bF_k^T\), solve \[
\begin{align}
\bC_k\bF_k^T=\bL_k,
\end{align}
\] and update \[
\begin{align}
\bS_{k+1}=\bD_{k+1}-\bC_k\bC_k^T.
\end{align}
\] The theorem above shows that every \(\bS_k\) remains positive definite. The stored factors form a block lower-bidiagonal Cholesky factor of \(\bA\).
Block Structure and Factor Reuse
A block order need not be visible in the original row numbering. Make an undirected graph with one vertex for each row and one edge for each nonzero connection. Choose one or more starting vertices and label every vertex by its distance from them. The labels at the ends of an edge differ by at most one. Grouping equal labels therefore produces a block-tridiagonal matrix.
(Block width) The sizes of the levels matter as much as their number. A poor starting set can place many rows in one level and create an expensive dense block. A useful ordering keeps the largest level small and avoids abrupt changes between neighboring level sizes. Before factorization, check that every nonzero lies in a diagonal block or one of the two neighboring block bands.
Local changes permit a second form of reuse. Suppose block \(j\) is the first one that changes. The factors before it remain valid, but the connection between blocks \(j-1\) and \(j\) touches the changed part. Keep the earlier factors, recompute this connection, and factor blocks \(j\) through the end. Keeping the old connection would give the wrong Schur complement.
(Choosing the reuse method) Use the stored factor directly when only the right-hand side changes. Use Sherman–Morrison or Woodbury when a few rows and columns change throughout the matrix. Recompute from the first changed block when the change begins late in the block order. Compute a fresh factorization when the change can no longer be described by a few vectors, the small Woodbury matrix becomes too sensitive to roundoff, or the block order no longer fits the matrix.
(Implementation details) A reusable solver should provide ordinary, transpose, and multiple-right-hand-side solves through the same interface. It should retain work arrays instead of allocating them inside every solve. It should compare the corrected solution with the original equations by a residual. Finally, it should report whether it reused a factorization or computed a new one. These details determine whether the algebraic shortcut reduces actual running time.
Further Exercises
Changed rows and columns. Work through the referenced result for two changed indices. Construct the two factors with at most four columns, show explicitly how the overlap of the changed rows and columns is counted once, and identify a case in which the actual rank is smaller than four.
Low-rank solve versus refactorization. Let \(\bA\) be a diagonally dominant dense matrix and change \(k\) rows and columns. Compare a fresh LU factorization with a Woodbury correction for several values of \(n\) and \(k\). Report the initial cost, the time per right-hand side, the relative residual, and the difference from a fresh solve. Find how many right-hand sides are needed before reuse saves time overall.
A two-block Cholesky solve. Consider \[
\begin{align}
\bD_1=\begin{pmatrix}4&1\\1&3\end{pmatrix},\qquad
\bL_1=\begin{pmatrix}-1&0\\0&-1\end{pmatrix},\qquad
\bD_2=\begin{pmatrix}3&1\\1&2\end{pmatrix},
\end{align}
\] with upper block \(\bL_1^T\). Compute the first Cholesky block, the scaled lower block, and the second Schur complement. Then solve the system with right-hand side \((1,0,0,1)^T\) and check the residual.
Graph-distance blocks. For the five-point grid graph on a \(3\times3\) lattice, label every vertex by its distance from a corner. List the block sizes and verify that every edge joins equal or adjacent levels. Repeat with the center vertex as the seed and compare the largest block.
Woodbury or partial refactorization. Construct a sequence of block-tridiagonal matrices in which the final two blocks change at every step. Implement both a low-rank correction and a refactorization that begins at the first changed block. Compare their cost and residual as the block size and update rank vary. Use the operation counts in this chapter to explain when one method becomes faster than the other.
Golub and Van Loan give the standard dense matrix treatment, while Davis develops the sparse direct viewpoint (Golub and Van Loan 2013; Davis 2006). Demmel and Higham are useful guides to deciding when an algebraically correct update may still be unsafe in floating-point arithmetic (Demmel 1997; Higham 2002).
Davis, Timothy A. 2006.
Direct Methods for Sparse Linear Systems.
Society for Industrial and Applied Mathematics.
https://doi.org/10.1137/1.9780898718881.
Demmel, James W. 1997.
Applied Numerical Linear Algebra.
Society for Industrial and Applied Mathematics.
https://doi.org/10.1137/1.9781611971446.
Golub, Gene H., and Charles F. Van Loan. 2013. Matrix Computations. 4th ed. Johns Hopkins University Press.
Higham, Nicholas J. 2002.
Accuracy and Stability of Numerical Algorithms. 2nd ed.
Society for Industrial and Applied Mathematics.
https://doi.org/10.1137/1.9780898718027.
Sherman, Jack, and Winifred J. Morrison. 1950.
“Adjustment of an Inverse Matrix Corresponding to a Change in One Element of a Given Matrix.” The Annals of Mathematical Statistics 21 (1): 124–27.
https://doi.org/10.1214/aoms/1177729893.
Woodbury, Max A. 1950. Inverting Modified Matrices. Memorandum Report 42. Statistical Research Group, Princeton University.