Expand description
Gaussian elimination: the algorithm every linear solver descends from.
To solve A x = b, subtract multiples of each row from the rows below it until A is upper
triangular, then solve the triangular system from the bottom up (back substitution). The
multiplier for row i at step k is a_ik / a_kk, so everything depends on the pivot
a_kk. A zero pivot stops the naive algorithm; a tiny one lets rounding errors grow without
bound. Partial pivoting swaps the row with the largest |a_ik| into the pivot position,
keeping every multiplier at most one in magnitude.
See the book entry Gaussian elimination and LU factorisation.
Functions§
- back_
substitute - Solves the upper triangular system
U x = c, last unknown first. - solve_
with_ partial_ pivoting - Solves
A x = bby elimination with partial pivoting: at stepkthe row with the largest|a_ik|(i ≥ k) is swapped into the pivot position. - solve_
without_ pivoting - Solves
A x = bby elimination without pivoting. Fails on a zero pivot and is unstable when a pivot is small; seesolve_with_partial_pivoting.