Skip to main content

Eig

Trait Eig 

Source
pub trait Eig<T, D0: Dim, D1: Dim> {
    type SpectralScalar;
    type RealScalar;

    // Required methods
    fn eig<L: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
    ) -> Result<EigDecomp<Self::SpectralScalar, D0, D1>, EigError>;
    fn eig_full<L: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
    ) -> Result<EigDecomp<Self::SpectralScalar, D0, D1>, EigError>;
    fn eig_values<L: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
    ) -> Result<Array<Self::SpectralScalar, (D0,)>, EigError>;
    fn eigh<L: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
    ) -> Result<EighDecomp<T, Self::RealScalar, D0, D1>, EigError>;
    fn schur<L: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
    ) -> Result<SchurDecomp<T, D0, D1>, SchurError>;
    fn schur_write<L: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
        t: &mut Slice<T, (D0, D1), Dense>,
        z: &mut Slice<T, (D0, D1), Dense>,
    ) -> Result<(), SchurError>;
    fn schur_complex<L: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
    ) -> Result<SchurDecomp<Self::SpectralScalar, D0, D1>, SchurError>;
    fn schur_complex_write<L: Layout>(
        &self,
        a: &mut Slice<T, (D0, D1), L>,
        t: &mut Slice<Self::SpectralScalar, (D0, D1), Dense>,
        z: &mut Slice<Self::SpectralScalar, (D0, D1), Dense>,
    ) -> Result<(), SchurError>;
}
Expand description

Eigenvalue decomposition operations of general and self-adjoint matrices.

Backends choose the spectral scalar model through associated types. General eigendecompositions and complex Schur decompositions use Self::SpectralScalar, while self-adjoint eigendecompositions use Self::RealScalar for eigenvalues and the input scalar T for eigenvectors.

Required Associated Types§

Source

type SpectralScalar

Spectral scalar type used for general eigenvalues/eigenvectors and complex Schur decompositions.

Source

type RealScalar

Real scalar type used for self-adjoint eigenvalues.

Required Methods§

Source

fn eig<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<EigDecomp<Self::SpectralScalar, D0, D1>, EigError>

Compute eigenvalues and right eigenvectors with new allocated matrices. The matrix A satisfies: A * v = λ * v where v are the right eigenvectors.

Source

fn eig_full<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<EigDecomp<Self::SpectralScalar, D0, D1>, EigError>

Compute eigenvalues and both left/right eigenvectors with new allocated matrices. The matrix A satisfies: A * vr = λ * vr and vl^H * A = λ * vl^H.

Source

fn eig_values<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<Array<Self::SpectralScalar, (D0,)>, EigError>

Compute only eigenvalues with a newly allocated vector.

Source

fn eigh<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<EighDecomp<T, Self::RealScalar, D0, D1>, EigError>

Compute eigenvalues and eigenvectors of a self-adjoint matrix.

Source

fn schur<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<SchurDecomp<T, D0, D1>, SchurError>

Compute Schur decomposition over the input scalar field.

Source

fn schur_write<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, t: &mut Slice<T, (D0, D1), Dense>, z: &mut Slice<T, (D0, D1), Dense>, ) -> Result<(), SchurError>

Compute Schur decomposition overwriting existing matrices.

Source

fn schur_complex<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, ) -> Result<SchurDecomp<Self::SpectralScalar, D0, D1>, SchurError>

Compute Schur decomposition over the spectral scalar field.

Source

fn schur_complex_write<L: Layout>( &self, a: &mut Slice<T, (D0, D1), L>, t: &mut Slice<Self::SpectralScalar, (D0, D1), Dense>, z: &mut Slice<Self::SpectralScalar, (D0, D1), Dense>, ) -> Result<(), SchurError>

Compute Schur decomposition over the spectral scalar field, overwriting existing matrices.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§