Skip to content

num::svd_truncated

Defined in header <linear/svd/svd.hpp>

svd_result svd_truncated(const mat<real> &A, idx k, idx oversampling = 10,
                         rng_state *rng = nullptr);

Compute a truncated SVD by random sampling: \(A \approx U_k \Sigma_k V_k^T\).

Exceptions

  • std::invalid_argument: If \(k\) is out of range.