Skip to main content

tridiagonal

Function tridiagonal 

Source
pub fn tridiagonal<T: LinalgScalar>(
    a: &[T],
    batch: usize,
    n: usize,
    lower: bool,
) -> (Vec<T>, Vec<T::LinalgReal>, Vec<T::LinalgReal>, Vec<T>)
Expand description

The reduction of each Hermitian (symmetric) n x n matrix of the batch to real tridiagonal form by a unitary similarity, as LAPACK’s sytrd (hetrd for complex types; the unblocked sytd2 and hetd2, which sytrd uses for matrices smaller than its crossover, 32 by default), reading only the lower (or upper) triangle.

Returns (a, d, e, taus) as JAX’s tridiagonal_p: a with the tridiagonal form on its diagonal and first subdiagonal (superdiagonal) and the Householder reflectors below (above) them, the other triangle untouched; the real diagonal d ([batch, n]), the real off-diagonal e ([batch, n - 1]), and the factors taus ([batch, n - 1]).

§Panics

Panics if a is not batch matrices of n x n.