pub fn tsvd<T>(
matrix: &Matrix<T, Dyn, Dyn, VecStorage<T, Dyn, Dyn>>,
config: TSVDConfig<T>,
) -> Result<SVDResult<T>, Error>Expand description
Main TSVD function using QR + SVD approach
Computes the truncated SVD using the algorithm:
- Apply QR decomposition to A to get Q and R
- Compute SVD of R
- Reconstruct final U and V matrices
§Arguments
matrix- Input matrix (m × n)config- TSVD configuration
§Returns
SVDResult- Truncated SVD result
§Errors
Error::EmptyInputif the matrix has no rows or no columnsError::InvalidParameterunless0 < config.rtol < 1(a NaN tolerance is rejected)Error::NonFiniteInputif an entry of the matrix is NaN or infiniteError::DecompositionFailedif the QR of the matrix overflows (its R factor has a non-finite entry) or the SVD iteration does not converge