PLU decomposition is LU decomposition with row permutation. It factors a row-reordered matrix into a lower triangular matrix and an upper triangular matrix.
The standard form is
Here is the original matrix, is a permutation matrix, is lower triangular, and is upper triangular. The factor records row exchanges. The factors and record Gaussian elimination after those row exchanges. PLU is used because ordinary LU may fail when a pivot is zero, while row exchanges can move a usable pivot into position.
76.1 Motivation
LU decomposition without pivoting assumes that the required pivots are nonzero. This assumption is too strong.
Consider
The first pivot is . Gaussian elimination cannot divide by this pivot. However, the matrix itself is not defective for solving linear systems. We can exchange the two rows:
This matrix is already upper triangular. The problem was the row order, not the matrix.
PLU decomposition separates these two issues. The permutation matrix chooses a workable row order. The triangular factors and then describe the elimination.
76.2 Permutation Matrices
A permutation matrix is obtained by rearranging the rows of the identity matrix. Each row contains exactly one , and each column contains exactly one . All other entries are .
For example,
exchanges the first two rows of a matrix. If
then
Left multiplication by a permutation matrix permutes rows. Right multiplication by a permutation matrix permutes columns. In PLU decomposition, the usual purpose of is row permutation.
76.3 The Factorization
A PLU decomposition has the form
The factors have the following roles.
| Factor | Meaning |
|---|---|
| Records row exchanges | |
| Records elimination multipliers | |
| Records the upper triangular result |
The matrix is orthogonal in the real case:
Therefore the equation
can also be written as
Some authors call this a PLU decomposition. Others reserve PLU for
The difference is only convention. The essential point is that a permutation factor is included with the triangular factors.
76.4 Why Pivoting Is Needed
Gaussian elimination proceeds by choosing a pivot, dividing by it, and using multiples of the pivot row to eliminate entries below it.
At step , the pivot is the entry in position of the current matrix. If this entry is zero, elimination cannot proceed. If it is very small, elimination can proceed algebraically, but the computation may be unstable in floating point arithmetic.
Pivoting exchanges rows so that a better pivot appears in the pivot position.
In partial pivoting, the pivot row is chosen from the current column. The usual rule is to choose the row whose candidate pivot has largest absolute value. This is the most common version in practical LU factorization.
76.5 Partial Pivoting
Suppose the elimination is at column . We examine the entries
Partial pivoting chooses an index such that
Then rows and are exchanged.
After the row exchange, the pivot is as large as possible within the remaining part of the current column. This does not guarantee perfect numerical behavior in every artificial example, but it is reliable in ordinary dense computations and widely used in numerical software.
76.6 A Simple Example
Let
Ordinary LU without pivoting fails because the first pivot is .
Exchange the two rows. The permutation matrix is
Then
This matrix is already upper triangular, so we may take
Thus
This example shows the purpose of . The permutation allows the triangular factorization to proceed.
76.7 A Three by Three Example
Let
The first pivot is , so we exchange the first row with the second row. This gives
Now eliminate the entry below the first pivot in row . The multiplier is
Subtract times row from row :
At the second pivot position, the pivot is . The entry below it is also . No row exchange is necessary.
The multiplier is
Subtract row from row :
The lower triangular factor is
The permutation matrix that exchanges the first two rows is
Therefore
Indeed,
76.8 Solving Systems with PLU
Suppose we want to solve
If
then multiply the equation by :
Since , this becomes
Introduce
Then solve the two triangular systems
and
Thus PLU solving has three stages:
| Stage | Operation |
|---|---|
| 1 | Permute the right-hand side: |
| 2 | Solve by forward substitution |
| 3 | Solve by backward substitution |
The row permutation must be applied to the right-hand side as well as the coefficient matrix.
76.9 Example: Solving a System
Let
We have
First compute
Since is the identity matrix,
Now solve
That is,
The second equation gives
so
The first equation gives
Substituting ,
so
Therefore
76.10 Determinants from PLU
PLU decomposition also gives an efficient determinant formula.
If
then
If is unit lower triangular, then
Since is triangular,
Therefore
The determinant of a permutation matrix is either or . Each row exchange changes the sign. If the factorization uses row exchanges, then
Thus
This formula is commonly used in numerical computation, often through the logarithm of the absolute determinant when the matrix is large or ill-scaled.
76.11 Invertibility
A square matrix is invertible exactly when all pivots in a complete PLU factorization are nonzero.
If
and , , and are all invertible, then is invertible. The permutation matrix is always invertible. A unit lower triangular matrix is invertible. Therefore the decisive condition is whether has nonzero diagonal entries.
Since is triangular,
if and only if
Equivalently,
for every .
76.12 Algorithm
The following algorithm computes a PLU decomposition using partial pivoting.
plu_decomposition(A):
n = number of rows of A
P = identity matrix of size n
L = zero matrix of size n by n
U = copy of A
for k = 1 to n:
pivot = k
for i = k to n:
if abs(U[i,k]) > abs(U[pivot,k]):
pivot = i
if U[pivot,k] == 0:
stop: matrix is singular
if pivot != k:
swap rows k and pivot in U
swap rows k and pivot in P
swap entries L[k,1:k-1] and L[pivot,1:k-1]
L[k,k] = 1
for i = k+1 to n:
L[i,k] = U[i,k] / U[k,k]
U[i,k:n] = U[i,k:n] - L[i,k] * U[k,k:n]
return P, L, UThe row swap in affects only columns already computed. This detail is important. Those entries store previous elimination multipliers, and their row order must remain consistent with the current row order.
76.13 Storage in Practice
Numerical libraries usually do not store , , and as three full dense matrices.
Instead, they commonly store:
| Object | Practical storage |
|---|---|
| A pivot vector | |
| Strict lower part of an array | |
| Upper part of the same array | |
| Diagonal of | Implicit ones |
The pivot vector records which rows were exchanged. The array that originally held is overwritten by the entries of and .
This storage method avoids unnecessary memory use. It also reflects the fact that and occupy complementary triangular parts of the matrix, except for the diagonal of , which is known to be all ones.
76.14 Operation Count
For a dense matrix, PLU decomposition with partial pivoting has the same leading arithmetic cost as ordinary LU:
operations, ignoring lower-order terms.
Pivot search and row exchanges add lower-order work. The search for pivots costs on the order of comparisons. Row exchanges also cost on the order of data movement.
Thus pivoting improves robustness without changing the leading cubic cost of dense LU factorization.
76.15 Numerical Stability
Pivoting is not only a device for avoiding zero pivots. It also helps control numerical error.
If a pivot is very small, the multipliers
can become very large. Large multipliers can magnify rounding errors and produce unreliable results.
Partial pivoting chooses a large available pivot in the current column. This keeps the multipliers bounded in magnitude by , since
after pivoting within the column.
This bound is one reason partial pivoting is effective in practice. It does not eliminate all possible instability, but it prevents the most immediate source of large elimination multipliers.
76.16 PLU and Row Echelon Form
PLU decomposition is closely related to row echelon form.
Gaussian elimination transforms a matrix into an upper triangular or row echelon matrix. PLU records the same process in factored form:
The matrix is the echelon-like result. The matrix stores the elimination multipliers. The matrix stores the row exchanges.
Thus PLU is not a different method from Gaussian elimination. It is Gaussian elimination with memory.
76.17 Comparison with LU
| Feature | LU | PLU |
|---|---|---|
| Form | ||
| Row exchanges | No | Yes |
| Handles zero pivots | Not generally | Usually, if a nonzero pivot exists |
| Numerical stability | Weaker | Stronger |
| Stored permutation | None | Pivot vector or |
| Common in software | Less common alone | Standard dense solver form |
Ordinary LU is useful when the matrix is known to allow elimination without row exchanges. PLU is the standard default for general dense matrices.
76.18 Common Conventions
There are several equivalent ways to write the same idea.
| Convention | Meaning |
|---|---|
| Permute rows of , then factor | |
| Move the permutation to the other side | |
| Use | |
| Alternative convention with defined differently |
When reading formulas, check which side of the permutation matrix appears on. The mathematical content is the same, but the stored permutation may represent either the performed row swaps or their inverse.
76.19 Summary
PLU decomposition extends LU decomposition by allowing row exchanges:
The permutation matrix records pivoting. The lower triangular matrix records elimination multipliers. The upper triangular matrix records the result of elimination.
PLU is the standard practical form of LU decomposition for general square matrices. It avoids zero pivots when possible, improves numerical stability, and provides an efficient way to solve systems:
It also gives direct access to determinant computation, invertibility tests, and reusable factorizations for multiple right-hand sides.