Skip to main content

thomas_solve

Function thomas_solve 

Source
pub fn thomas_solve(
    sub: &[f64],
    diag: &[f64],
    sup: &[f64],
    rhs: &[f64],
) -> Result<Vec<f64>, SolveError>
Expand description

Solves a tridiagonal system with the Thomas algorithm.

diag and rhs have length n; sub (below-diagonal) and sup (above-diagonal) have length nāˆ’1. Numerically stable for diagonally dominant or symmetric positive-definite systems.