pub fn rsvd_ndarray<T>(
a: &Array2<T>,
k: usize,
) -> LapackResult<RandomizedSvdResult<T>>Expand description
Computes a randomized SVD approximation of a matrix.
Uses randomized projections to compute a rank-k approximation efficiently, particularly useful for large matrices where only the top singular values are needed.
§Arguments
a- The input matrix (m×n)k- Target rank (number of singular values to compute)
§Returns
Truncated SVD with k singular values and vectors
§Algorithm
Uses the Halko-Martinsson-Tropp randomized algorithm:
- Generate random test matrix Ω
- Compute Y = A × Ω to sample column space
- QR factorize Y to get orthonormal basis Q
- Project B = Q^T × A
- Compute full SVD of B
- Recover U = Q × Ũ