Skip to main content

svd_decompose

Function svd_decompose 

Source
pub fn svd_decompose<T>(
    matrix: &Matrix<T, Dyn, Dyn, VecStorage<T, Dyn, Dyn>>,
    rtol: f64,
) -> SVDResult<T>
where T: ComplexField + RealField + Copy + ToPrimitive,
Expand description

Perform SVD decomposition using nalgebra with sorted singular values

Note: This computes ALL singular values, not a truncated SVD. The truncation happens after SVD computation based on rtol.

§Arguments

  • matrix - Input matrix (m × n)
  • rtol - Relative tolerance for rank determination (used for rank calculation, not SVD convergence)

§Returns

  • SVDResult - Truncated SVD result with U, S, V matrices and rank

§Panics

Panics if the matrix is empty, has a NaN or infinite entry, or the SVD iteration does not converge within its iteration limit (Error describes each case). tsvd reports these as errors.