Function engram::linalg::lu

source ·
pub fn lu(t: &Tensor) -> Option<(Tensor, Tensor)>
Expand description

LU decomposition of a square matrix. Returns the product of the lower triangular matrix and an upper triangular matrix.

§Examples

let t = tensor![[2.0, -1.0, 0.0], [-1.0, 2.0, -1.0], [0.0, -1.0, 2.0]];
let (l, u) = linalg::lu(&t).unwrap();