Struct nalgebra::linalg::SVD

source ·
pub struct SVD<T: ComplexField, R: DimMin<C>, C: Dim>where
    DefaultAllocator: Allocator<T, DimMinimum<R, C>, C> + Allocator<T, R, DimMinimum<R, C>> + Allocator<T::RealField, DimMinimum<R, C>>,
{ pub u: Option<OMatrix<T, R, DimMinimum<R, C>>>, pub v_t: Option<OMatrix<T, DimMinimum<R, C>, C>>, pub singular_values: OVector<T::RealField, DimMinimum<R, C>>, }
Expand description

Singular Value Decomposition of a general matrix.

Fields

u: Option<OMatrix<T, R, DimMinimum<R, C>>>

The left-singular vectors U of this SVD.

v_t: Option<OMatrix<T, DimMinimum<R, C>, C>>

The right-singular vectors V^t of this SVD.

singular_values: OVector<T::RealField, DimMinimum<R, C>>

The singular values of this SVD.

Implementations

Computes the Singular Value Decomposition of matrix using implicit shift. The singular values are not guaranteed to be sorted in any particular order. If a descending order is required, consider using new instead.

Attempts to compute the Singular Value Decomposition of matrix using implicit shift. The singular values are not guaranteed to be sorted in any particular order. If a descending order is required, consider using try_new instead.

Arguments
  • compute_u − set this to true to enable the computation of left-singular vectors.
  • compute_v − set this to true to enable the computation of right-singular vectors.
  • eps − tolerance used to determine when a value converged to 0.
  • max_niter − maximum total number of iterations performed by the algorithm. If this number of iteration is exceeded, None is returned. If niter == 0, then the algorithm continues indefinitely until convergence.

Computes the rank of the decomposed matrix, i.e., the number of singular values greater than eps.

Rebuild the original matrix.

This is useful if some of the singular values have been manually modified. Returns Err if the right- and left- singular vectors have not been computed at construction-time.

Computes the pseudo-inverse of the decomposed matrix.

Any singular value smaller than eps is assumed to be zero. Returns Err if the right- and left- singular vectors have not been computed at construction-time.

Solves the system self * x = b where self is the decomposed matrix and x the unknown.

Any singular value smaller than eps is assumed to be zero. Returns Err if the singular vectors U and V have not been computed.

converts SVD results to Polar decomposition form of the original Matrix: A = P' * U.

The polar decomposition used here is Left Polar Decomposition (or Reverse Polar Decomposition) Returns None if the singular vectors of the SVD haven’t been calculated

Computes the Singular Value Decomposition of matrix using implicit shift. The singular values are guaranteed to be sorted in descending order. If this order is not required consider using new_unordered.

Attempts to compute the Singular Value Decomposition of matrix using implicit shift. The singular values are guaranteed to be sorted in descending order. If this order is not required consider using try_new_unordered.

Arguments
  • compute_u − set this to true to enable the computation of left-singular vectors.
  • compute_v − set this to true to enable the computation of right-singular vectors.
  • eps − tolerance used to determine when a value converged to 0.
  • max_niter − maximum total number of iterations performed by the algorithm. If this number of iteration is exceeded, None is returned. If niter == 0, then the algorithm continues indefinitely until convergence.

Sort the estimated components of the SVD by its singular values in descending order. Such an ordering is often implicitly required when the decompositions are used for estimation or fitting purposes. Using this function is only required if new_unordered or try_new_unorderd were used and the specific sorting is required afterward.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
The archived version of the pointer metadata for this type.
Converts some archived metadata to the pointer metadata for itself.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Deserializes using the given deserializer

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Gets the layout of the type.
The type for metadata in pointers and references to Self.
Should always be Self
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Checks if self is actually part of its subset T (and can be converted to it).
Use with care! Same as self.to_subset but without any property checks. Always succeeds.
The inclusion map: converts self to the equivalent element of its superset.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.