Function peroxide::numerical::utils::tdma

source ·
pub fn tdma(
    a_input: Vec<f64>,
    b_input: Vec<f64>,
    c_input: Vec<f64>,
    y_input: Vec<f64>,
) -> Matrix
Expand description

TriDiagonal Matrix Algorithm (TDMA)

§Description

Solve tri-diagonal matrix system efficiently (O(n))

|b0 c0         | |x0|   |y0|
|a1 b1 c1      | |x1|   |y1|
|   a2 b2 c2   | |x2| = |y2|
|      ...     | |..|   |..|
|         am bm| |xm|   |ym|

§Caution

You should apply boundary condition yourself