Skip to main content

tridiagonal_solve

Function tridiagonal_solve 

Source
pub fn tridiagonal_solve<T: LinalgScalar>(
    dl: &[T],
    d: &[T],
    du: &[T],
    b: &[T],
    batch: usize,
    m: usize,
    n: usize,
    perturb_singular: bool,
) -> Vec<T>
Expand description

Solves A x = b for each tridiagonal A of the batch (batch systems of m equations with n right-hand sides each): dl, d, and du are [batch, m], b is [batch, m, n].

Without perturb_singular, the elimination is LAPACK’s gtsv, and singular systems (a zero pivot) give NaNs, as JAX’s lowering makes of gtsv’s error. With perturb_singular, it is jaxlib’s perturbed elimination.

§Panics

Panics if the lengths of the buffers do not match the sizes.