Skip to main content

thomas_algorithm

Function thomas_algorithm 

Source
pub fn thomas_algorithm(a: &[f64], b: &[f64], c: &[f64], d: &[f64]) -> Vec<f64>
Expand description

Solves a tridiagonal system Ax = d using the Thomas algorithm.

ยงArguments

  • a - Sub-diagonal (length n-1), a[0] unused.
  • b - Main diagonal (length n).
  • c - Super-diagonal (length n-1), c[n-1] unused.
  • d - Right-hand side vector (length n).

Returns the solution vector x.