Skip to content
fn

lapack_svd_f32

void lapack_svd_f32(const float * A, int m, int n, bool full_matrices, float * U, float * S, float * Vt, int * info)

Single-precision singular value decomposition via divide-and-conquer.

Computes A=U diag(S) VTA = U \, \mathrm{diag}(S) \, V^T. When full_matrices is false the thin SVD is returned: U∈Rm×kU \in \mathbb{R}^{m \times k}, VT∈Rk×nV^T \in \mathbb{R}^{k \times n}, k=min⁡(m,n)k = \min(m, n). When true the full matrices (U∈Rm×mU \in \mathbb{R}^{m \times m}, VT∈Rn×nV^T \in \mathbb{R}^{n \times n}) are returned.

Math

A=U Σ VT,Σ=diag(S)A = U \, \Sigma \, V^T, \quad \Sigma = \mathrm{diag}(S)

References

LAPACK sgesdd_ (divide-and-conquer driver).

Parameters

Aconst float*
Row-major m×nm \times n input.
m, nint
Matrix dimensions.
full_matricesbool
Controls thin vs full SVD as described above.
Ufloat*
Output UU matrix (row-major).
Sfloat*
Output singular values in descending order, length min⁡(m,n)\min(m, n).
Vtfloat*
Output VTV^T matrix (row-major).
infoint*
LAPACK status (> 0 = SVD did not converge).