Linear algebra functions.
The functions are often implemented as member functions of
Tensor, since it offers better
handling of generics.
use numeric::Tensor; let a = Tensor::new(vec![1.0_f64, 0.5, 1.5, -1.0]).reshape(&[2, 2]); let b = Tensor::ones(&); let x = a.solve(&b);
If passed a vector, creates a diagonal matrix with the vector as its diagonal. If passed a matrix, the diagonal is extracted and returned.