LU Decomposition Calculator
Factor a square matrix as P·A = L·U using Doolittle elimination with partial pivoting.
Description
Factor a square matrix into pivoted lower- and upper-triangular matrices.
LU decomposition rewrites a square matrix as triangular factors, making repeated linear solves and determinant calculations more efficient. This calculator includes partial pivoting and reports the row permutation explicitly.
When to use LU Decomposition Calculator
- Inspect the factors used by Gaussian elimination
- Prepare triangular factors for repeated solves
- Verify a pivoted LU decomposition by matrix multiplication
How the calculation works
Doolittle elimination produces a unit lower-triangular matrix L and upper-triangular matrix U. Partial pivoting swaps rows to improve numerical behavior. The permutation array lists original row indices in pivoted order, so P·A = L·U.
P · A = L · U Interpreting the result
Reorder the input rows using `permutation`, then compare that matrix with L multiplied by U. L stores elimination multipliers and has ones on its diagonal; U contains the resulting upper-triangular system.
Important limitations
- The input must be square.
- Factors are rounded to twelve significant digits.
- A zero pivot can produce a valid singular factorization, but the factors cannot then support a unique solve.