Function det
pub fn det<T, C>(ctx: &mut C, tensor: &Tensor<T>) -> Result<Tensor<T>, Error>where
T: KernelLinalgScalar + ScaleTensorByRealSameShape<C>,
C: TensorLinalgContextFor<T> + TensorScalarContextFor<Standard<T>> + TensorScalarContextFor<Standard<<T as LinalgScalar>::Real>> + TensorMetadataContextFor,
<T as LinalgScalar>::Real: Scalar + NumCast + One + 'static,
<C as TensorMetadataContextFor>::MetadataBackend: TensorMetadataPrims<Context = C>,
<C as TensorScalarContextFor<Standard<<T as LinalgScalar>::Real>>>::ScalarBackend: TensorMetadataCastPrims<<T as LinalgScalar>::Real, Context = C>,
<C as TensorLinalgContextFor<T>>::Backend: 'static,Expand description
Compute the determinant of a square matrix.
ยงExamples
use tenferro_linalg::det;
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(&[1.0, 0.0, 0.0, 2.0], &[2, 2], col).unwrap();
let d = det(&mut ctx, &a).unwrap();
assert_eq!(d.ndim(), 0);