|
| | svd_decomposition (const matrix< T > &a, svd_method method=svd_method::divide_and_conquer, bool full=false) |
| | Decomposes a.
|
| |
| | svd_decomposition (matrix< T > &&a, svd_method method=svd_method::divide_and_conquer, bool full=false) |
| | Decomposes a in its own storage, an expiring matrix's elements taken over: its scaled copy is made in place, one matrix less at the peak.
|
| |
| const vector< double > & | singular_values () const noexcept |
| | The singular values, descending.
|
| |
| const matrix< T > & | u () const &noexcept |
| | The left singular vectors U (columns): m × k, or m × m full.
|
| |
| matrix< T > | u () && |
| | U, moved out of an expiring decomposition (v and the singular values stay).
|
| |
| const matrix< T > & | v () const &noexcept |
| | The right singular vectors V (columns): n × k, or n × n full.
|
| |
| matrix< T > | vh () const |
| | Vᴴ (k × n, or n × n full), so that A = U Σ Vᴴ reads u() * diag(singular_values()) * vh() (full, Σ padded with zeros to m × n).
|
| |
|
| void | factor (const matrix< T > &a, svd_method method, bool full) |
| | Decomposes an m × n a with m ≥ n into u_, singular_values_ and v_, U square when full.
|
| |
| void | factor (matrix< T > &&a, svd_method method, bool full) |
| | factor of an expiring matrix, its elements scaled in place.
|
| |
| void | factor_scaled (const T *source, buffer< T > entries, std::size_t rows, std::size_t cols, svd_method method, bool full) |
| | The decomposition of the rows × cols matrix at source (row-major), its scaled copy written into entries, which may hold the source itself (each element read before it is written).
|
| |
|
| static matrix< T > | applied_left_vectors (const buffer< T > &left, const std::vector< detail::reflector_block< T > > &blocks, const std::vector< T > &phases, std::size_t rows, std::size_t cols, std::size_t width) |
| | U = Q [D L; 0] (rows × width): the left vectors left of R (cols × cols), each row times its diagonal's phase phases (D, as detail::householder_qr rotates Q), and where U is square the identity past them, Q's columns past cols; Q the product of the reflectors blocks (detail::apply_q).
|
| |
| static matrix< T > | left_vectors (buffer< T > q, buffer< T > left, std::size_t rows, std::size_t cols, std::size_t width) |
| | U from the Householder q (rows × width) and the left vectors left of R (cols × cols): Q times them, and when Q is complete (width = rows) its columns past cols after them.
|
| |
| static double | largest_cosine (const buffer< T > &x, const buffer< T > &basis, std::size_t n, std::size_t count) |
| | The largest |⟨b, x⟩| over the first count columns b of the n × n basis.
|
| |
| static void | orthogonalise (buffer< T > &x, const buffer< T > &basis, std::size_t n, std::size_t count) |
| | Removes from x its components along the first count columns of the n × n basis.
|
| |
template<field T>
class numerical::svd_decomposition< T >
The singular value decomposition A = U Σ Vᴴ of an m × n matrix.
- Template Parameters
-
| T | The scalar element type (double or std::complex<double>). |
With k = min(m, n): the k singular values, descending; U (m × k) and V (n × k) with orthonormal columns, also where A is rank-deficient. Computed after a Householder QR of A (of Aᴴ when m < n): by default R is reduced to bidiagonal form and the bidiagonal decomposed by divide and conquer (svd_method::divide_and_conquer), the method of LAPACK's dgesdd, most of its work in matrix products, or by implicit-shift QR (svd_method::bidiagonal_qr, dgesvd's); either way each singular value to an absolute accuracy of the largest times the machine epsilon. One-sided Jacobi on R (svd_method::jacobi) gives every singular value to high relative accuracy — the small ones of a graded matrix too — at several times the cost. vh is Vᴴ, the third factor NumPy's svd returns. Full (full true, NumPy's full_matrices=True), U is m × m and V n × n: the columns past k are an orthonormal basis of the complement, the rest of the complete Householder Q of the larger side.
Definition at line 1600 of file svd.hpp.