Skip to content

LDU test

  • A simple structured matrix with all entries below the main diagonal equal to zero.
  • Commonly used to test algorithms for solving linear systems because it admits an LDU decomposition.
  • LDU form lets you solve linear systems and compute matrix inverses efficiently by working with triangular and diagonal matrices.

An LDU (Lower Diagonal Unit) test matrix is a matrix with the property that all entries below the main diagonal are zero. Equivalently, all entries a[i,j] are zero whenever i > j.

An LDU test matrix is organized so that it can be factored into three components: a lower triangular matrix L, a diagonal matrix D, and an upper triangular matrix U. For a linear system A x = b built from an LDU test matrix, the system can be expressed as:

L[D[U[x]]]=bL[D[U[x]]] = b

or, equivalently, using matrix product notation when A admits an LDU decomposition,

A=LDU.A = L D U.

Because L and U are triangular and D is diagonal, many operations become efficient:

  • Solving A x = b reduces to forward and backward substitutions with triangular matrices and simple division by diagonal entries.
  • If A = L D U, the inverse can be formed as
A1=U1D1L1,A^{-1} = U^{-1} D^{-1} L^{-1},

and inverses of triangular and diagonal matrices are straightforward to compute.

Gaussian elimination applied to an LDU test matrix proceeds efficiently because the structure already places zeros below the main diagonal.

The following 4×4 matrix is an example of an LDU test matrix:

A=[1000230004500067]A = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 2 & 3 & 0 & 0 \\ 0 & 4 & 5 & 0 \\ 0 & 0 & 6 & 7 \end{bmatrix}

The linear system using this matrix is:

[1000230004500067][x1x2x3x4]=[b1b2b3b4]\begin{bmatrix} 1 & 0 & 0 & 0 \\ 2 & 3 & 0 & 0 \\ 0 & 4 & 5 & 0 \\ 0 & 0 & 6 & 7 \end{bmatrix} \begin{bmatrix} x_1 \\ x_2 \\ x_3 \\ x_4 \end{bmatrix} = \begin{bmatrix} b_1 \\ b_2 \\ b_3 \\ b_4 \end{bmatrix}

This system can be rewritten in LDU form:

L[D[U[x]]]=bL[D[U[x]]] = b

with

L=[1000210004100061],D=[1000030000500007],U=[1200034000560007].L = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 2 & 1 & 0 & 0 \\ 0 & 4 & 1 & 0 \\ 0 & 0 & 6 & 1 \end{bmatrix}, \qquad D = \begin{bmatrix} 1 & 0 & 0 & 0 \\ 0 & 3 & 0 & 0 \\ 0 & 0 & 5 & 0 \\ 0 & 0 & 0 & 7 \end{bmatrix}, \qquad U = \begin{bmatrix} 1 & 2 & 0 & 0 \\ 0 & 3 & 4 & 0 \\ 0 & 0 & 5 & 6 \\ 0 & 0 & 0 & 7 \end{bmatrix}.
  • Testing algorithms for solving linear systems of equations.
  • Enabling efficient solution of systems using Gaussian elimination due to the matrix structure.
  • Facilitating efficient computation of a matrix inverse when A = L D U, via A^{-1} = U^{-1} D^{-1} L^{-1}.
  • LDU decomposition
  • Lower triangular matrix
  • Diagonal matrix
  • Upper triangular matrix
  • Gaussian elimination
  • Matrix inverse