This program implements a numerical method to solve a system of linear equations 𝐴𝑥=𝑏 using Gaussian elimination with scaled partial pivoting. In terms of numerical stability, scaled partial pivoting reduces errors that arise when matrix rows differ greatly in magnitude. The iterative residual vector refinement minimizes the error, keeping the solution more accurate, especially in ill-conditioned systems.
For a
The program consists of the following key components:
elimination
function - performs Gaussian elimination, transforming the matrix 𝐴 into an upper triangular form and solving for the unknown vector 𝑥 using back-substitutionsolveEquations
function - uses the result of elimination in an iterative refinement process to reduce the residual (error) until it is smaller than a given tolerance 𝜖scale
vector - helps in scaled partial pivoting by normalizing the rows for better numerical stability