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§
Sourcetype SpectralScalar
type SpectralScalar
Spectral scalar type used for general eigenvalues/eigenvectors and complex Schur decompositions.
Sourcetype RealScalar
type RealScalar
Real scalar type used for self-adjoint eigenvalues.
Required Methods§
Sourcefn eig<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
) -> Result<EigDecomp<Self::SpectralScalar, D0, D1>, EigError>
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.
Sourcefn eig_full<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>
Compute eigenvalues and both left/right eigenvectors with new allocated matrices.
The matrix A satisfies: A * vr = λ * vr and vl^H * A = λ * vl^H.
Sourcefn eig_values<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
) -> Result<Array<Self::SpectralScalar, (D0,)>, EigError>
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.
Sourcefn eigh<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
) -> Result<EighDecomp<T, Self::RealScalar, D0, D1>, EigError>
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.
Sourcefn schur<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
) -> Result<SchurDecomp<T, D0, D1>, SchurError>
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.
Sourcefn 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_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.
Sourcefn schur_complex<L: Layout>(
&self,
a: &mut Slice<T, (D0, D1), L>,
) -> Result<SchurDecomp<Self::SpectralScalar, D0, D1>, SchurError>
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.
Sourcefn 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>
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".