Skip to main content

solve_small_linear

Function solve_small_linear 

pub fn solve_small_linear(n: usize, a: &mut [f64], b: &mut [f64]) -> bool
Expand description

Solve a small N×N linear system A·x = b in-place.

For N=1: trivial division. For N=2: Cramer’s rule (no pivoting needed for well-conditioned 2×2). For N≥3: Gaussian elimination with partial pivoting.

Returns false if the system is singular (near-zero determinant/pivot).