Skip to main content

DeterminantHInto

Trait DeterminantHInto 

Source
pub trait DeterminantHInto {
    type Elem: Scalar;

    // Required methods
    fn deth_into(self) -> Result<<Self::Elem as Scalar>::Real>;
    fn sln_deth_into(
        self,
    ) -> Result<(<Self::Elem as Scalar>::Real, <Self::Elem as Scalar>::Real)>;
}
Expand description

An interface for calculating determinants of Hermitian (or real symmetric) matrices.

Required Associated Types§

Source

type Elem: Scalar

The element type of the matrix.

Required Methods§

Source

fn deth_into(self) -> Result<<Self::Elem as Scalar>::Real>

Computes the determinant of the Hermitian (or real symmetric) matrix.

Source

fn sln_deth_into( self, ) -> Result<(<Self::Elem as Scalar>::Real, <Self::Elem as Scalar>::Real)>

Computes the (sign, natural_log) of the determinant of the Hermitian (or real symmetric) matrix.

The natural_log is the natural logarithm of the absolute value of the determinant. If the determinant is zero, sign is 0 and natural_log is negative infinity.

To obtain the determinant, you can compute sign * natural_log.exp() or just call .deth_into() instead.

This method is more robust than .deth_into() to very small or very large determinants since it returns the natural logarithm of the determinant rather than the determinant itself.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl<A, S> DeterminantHInto for ArrayBase<S, Ix2>
where A: Scalar + Lapack, S: DataMut<Elem = A>,

Source§

type Elem = A

Source§

fn deth_into(self) -> Result<A::Real>

Source§

fn sln_deth_into(self) -> Result<(A::Real, A::Real)>

Implementors§