Skip to main content

Module gaussian_elimination

Module gaussian_elimination 

Source
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 = b by elimination with partial pivoting: at step k the row with the largest |a_ik| (i ≥ k) is swapped into the pivot position.
solve_without_pivoting
Solves A x = b by elimination without pivoting. Fails on a zero pivot and is unstable when a pivot is small; see solve_with_partial_pivoting.