Skip to main content

SVD

Trait SVD 

Source
pub trait SVD<T, D: Dim> {
    type SingularValue;

    // Required methods
    fn svd<L: Layout>(
        &self,
        a: &mut Slice<T, (D, D), L>,
    ) -> Result<SVDDecomp<T, Self::SingularValue, D>, SVDError>;
    fn svd_thin<L: Layout>(
        &self,
        a: &mut Slice<T, (D, D), L>,
    ) -> Result<SVDDecomp<T, Self::SingularValue, D>, SVDError>;
    fn svd_s<L: Layout>(
        &self,
        a: &mut Slice<T, (D, D), L>,
    ) -> Result<Array<Self::SingularValue, (D,)>, SVDError>;
    fn svd_write<L: Layout, Ls: Layout, Lu: Layout, Lvt: Layout>(
        &self,
        a: &mut Slice<T, (D, D), L>,
        s: &mut Slice<Self::SingularValue, (D,), Ls>,
        u: &mut Slice<T, (D, D), Lu>,
        vt: &mut Slice<T, (D, D), Lvt>,
    ) -> Result<(), SVDError>;
    fn svd_write_s<L: Layout, Ls: Layout>(
        &self,
        a: &mut Slice<T, (D, D), L>,
        s: &mut Slice<Self::SingularValue, (D,), Ls>,
    ) -> Result<(), SVDError>;
}
Expand description

Singular value decomposition for matrix factorization and analysis

Required Associated Types§

Source

type SingularValue

Scalar type used for singular values.

Singular values are mathematically real. Backends choose their representation; some current backends use the matrix scalar type T.

Required Methods§

Source

fn svd<L: Layout>( &self, a: &mut Slice<T, (D, D), L>, ) -> Result<SVDDecomp<T, Self::SingularValue, D>, SVDError>

Compute full SVD with new allocated matrices

Source

fn svd_thin<L: Layout>( &self, a: &mut Slice<T, (D, D), L>, ) -> Result<SVDDecomp<T, Self::SingularValue, D>, SVDError>

Compute thin SVD with new allocated matrices

Source

fn svd_s<L: Layout>( &self, a: &mut Slice<T, (D, D), L>, ) -> Result<Array<Self::SingularValue, (D,)>, SVDError>

Compute only singular values with new allocated matrix

Source

fn svd_write<L: Layout, Ls: Layout, Lu: Layout, Lvt: Layout>( &self, a: &mut Slice<T, (D, D), L>, s: &mut Slice<Self::SingularValue, (D,), Ls>, u: &mut Slice<T, (D, D), Lu>, vt: &mut Slice<T, (D, D), Lvt>, ) -> Result<(), SVDError>

Compute SVD, overwriting existing matrices

Source

fn svd_write_s<L: Layout, Ls: Layout>( &self, a: &mut Slice<T, (D, D), L>, s: &mut Slice<Self::SingularValue, (D,), Ls>, ) -> Result<(), SVDError>

Compute only singular values, overwriting existing matrix

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§