Skip to main content

Module svd

Module svd 

Source
Expand description

Thin singular value decomposition A = U·Σ·Vᵀ (via AᵀA eigendecomposition). Thin singular value decomposition A = U·Σ·Vᵀ of a row-major m×n matrix.

Computed from the symmetric eigendecomposition of AᵀA (right singular vectors + squared singular values), then U = A·V·Σ⁻¹. Builds on the engine’s GEMM-style accumulation and [super::eigen::symmetric_eigen] — the engine’s single eigen home, so there is no second Jacobi here.

Allocating (the outputs are inherently dynamic), but all scratch is local and the algorithm reads caller-owned input. The specialized lib keeps a thin facade.

Structs§

Svd
Result of a (thin) SVD A = U·Σ·Vᵀ. singular_values (length n, descending) is the diagonal of Σ; u is row-major m×n with left singular vectors as columns; v is row-major n×n with right singular vectors as columns. Reconstruction: A[i][j] = Σ_k u[i][k]·σ_k·v[j][k].

Functions§

svd
Singular value decomposition of a row-major m×n matrix. Singular values are returned in descending order. Returns SolversError::InvalidDimension for an empty/mis-sized input (and propagates eigen failures).