|
|
◆ WDgesvd()
| Function WDgesvd |
( |
Jobu As |
String, |
|
|
JobVt As |
String, |
|
|
M As |
Long, |
|
|
N As |
Long, |
|
|
A As |
Variant |
|
) |
| |
Singular value decomposition (SVD)
- Purpose
- WDgesvd computes the singular value decomposition (SVD) of a real M x N matrix A, optionally computing the left and/or right singular vectors. The SVD is written where Σ is an M x N matrix which is zero except for its min(M, N) diagonal elements, U is an M x M orthogonal matrix, and V is an N x N orthogonal matrix. The diagonal elements of Σ are the singular values of A. They are real and non-negative, and are returned in descending order. The first min(M, N) columns of U and V are the left and right singular vectors of A.
Note that the routine returns V^T, not V.
- Returns
- min(M, N)+1 x 1 (Jobu = "N", Jobvt = "N")
| Column 1 |
| Rows 1 to min(M, N) | Singular values (in descending order) |
| Row min(M, N)+1 | Return code |
M+1 x M+1 (Jobu = "A", Jobvt = "N")
| Column 1 | Columns 2 to M+1 |
| Rows 1 to M | Singular values (in descending order) (Rows 1 to min(M, N)) | Left orthogonal matrix U |
| Row M+1 | Return code | 0 |
N+1 x N+1 (Jobu = "N", Jobvt = "A")
| Column 1 | Columns 2 to N+1 |
| Rows 1 to N | Singular values (in descending order) (Rows 1 to min(M, N)) | Transpose of right orthogonal matrix V (V^T) |
| Row N+1 | Return code | 0 |
max(M,N)+1 x M+N+1 (Jobu = "A", Jobvt = "A")
| Column 1 | Columns 2 to M+1 | Columns M+2 to M+N+1 |
| Rows 1 to max(M,N) | Singular values (in descending order) (Rows 1 to min(M, N)) | Left orthogonal matrix U (Rows 1 to M) | Transpose of right orthogonal matrix V (V^T) (Rows 1 to N) |
| Row max(M,N)+1 | Return code | 0 | 0 |
Return code.
= 0: Successful exit.
= i > 0: i super-diagonals of an intermediate bidiagonal form did not converge to zero.
- Parameters
-
| [in] | Jobu | = "N": Do not compute left orthogonal matrix U.
= "A": Compute left orthogonal matrix U. |
| [in] | Jobvt | = "N": Do not compute transpose of right orthogonal matrix V (V^T).
= "A": Compute transpose of right orthogonal matrix V (V^T). |
| [in] | M | Number of rows of the input matrix A. (M >= 1) |
| [in] | N | Number of columns of the input matrix A. (N >= 1) |
| [in] | A | (M x N) M x N matrix A. |
- Reference
- LAPACK
- Example
- Compute singular values and left and right singular vectors of matrix A, where
( 1 6 11 )
( 2 7 12 )
A = ( 3 8 13 )
( 4 9 14 )
( 5 10 15 )
|