Back to LAPACK/BLAS
la.svdModule.svdCompact
Compute the compact (economy-size) SVD of a general m×n matrix A.
Syntax
la.svdModule.svdCompact(A, algorithm?)
Description
Compute the compact (economy-size) SVD of a general m×n matrix A. A = U * S * V^T This is equivalent to `svd(A, { mode: 'reduced' })` but with a simpler interface. For an m×n matrix with k = min(m, n): - U is m×k - S is k×k diagonal (returned as vector s of length k) - Vt is k×n
Parameters
| Name | Description |
|---|---|
| A | - Input matrix (m × n). Can be 2D array (row-major) or 1D array (column-major). |
| algorithm(optional) | - Which algorithm to use: 'gesvd' (more accurate) or 'gesdd' (faster) |
Returns
SVDResult