pub fn cholesky<T: KernelLinalgScalar, C>(
ctx: &mut C,
tensor: &Tensor<T>,
) -> Result<Tensor<T>>where
C: TensorLinalgContextFor<T>,
C::Backend: 'static,Expand description
Compute the Cholesky decomposition of a Hermitian positive-definite matrix.
ยงExamples
use tenferro_linalg::cholesky;
use tenferro_prims::CpuContext;
use tenferro_tensor::{MemoryOrder, Tensor};
let mut ctx = CpuContext::new(1);
let col = MemoryOrder::ColumnMajor;
let a = Tensor::<f64>::from_slice(&[4.0, 2.0, 2.0, 3.0], &[2, 2], col).unwrap();
let l = cholesky(&mut ctx, &a).unwrap();
assert_eq!(l.dims(), &[2, 2]);