|
|
◆ zgesvd()
| void zgesvd |
( |
char |
jobu, |
|
|
char |
jobvt, |
|
|
int |
m, |
|
|
int |
n, |
|
|
int |
lda, |
|
|
doublecomplex |
a[], |
|
|
double |
s[], |
|
|
int |
ldu, |
|
|
doublecomplex |
u[], |
|
|
int |
ldvt, |
|
|
doublecomplex |
vt[], |
|
|
doublecomplex |
work[], |
|
|
int |
lwork, |
|
|
double |
rwork[], |
|
|
int * |
info |
|
) |
| |
(Simple driver) Singular value decomposition (SVD) of a complex matrix
- Purpose
- This routine computes the singular value decomposition (SVD) of a complex m x n matrix A, optionally computing the left and/or right singular vectors. The SVD is written where SIGMA is an m x n matrix which is zero except for its min(m, n) diagonalelements, U is an m x m unitary matrix, and V is an n x n unitary matrix. The diagonal elements of SIGMA 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^H, not V.
- Parameters
-
| [in] | jobu | Specifies options for computing all or part of the matrix U:
= 'A': All m columns of U are returned in array u[][].
= 'S': The first min(m, n) columns of U (the left singular vectors) are returned in the array u[][].
= 'O': The first min(m, n) columns of U (the left singular vectors) are overwritten on the array a[][].
= 'N': No columns of U (no left singular vectors) are computed. |
| [in] | jobvt | Specifies options for computing all or part of the matrix V^H:
= 'A': All n rows of V^H are returned in the array vt[][].
= 'S': The first min(m, n) rows of V^H (the right singular vectors) are returned in the array vt[][].
= 'O': The first min(m, n) rows of V^H (the right singular vectors) are overwritten on the array a[][].
= 'N': No rows of V^H (no right singular vectors) are computed. |
| [in] | m | Number of rows of the input matrix A. (m >= 0) (If m = 0, returns without computation) |
| [in] | n | Number of columns of the input matrix A. (n >= 0) (If n = 0, returns without computation) |
| [in] | lda | Leading dimension of the two dimensional array a[][]. (lda >= max(1, m)) |
| [in,out] | a[][] | Array a[la][lda] (la >= n)
[in] m x n matrix A.
[out] jobu = 'O': a[][] is overwritten with the first min(m, n) columns of U (the left singular vectors, stored columnwise).
jobvt = 'O': a[][] is overwritten with the first min(m, n) rows of V^H (the right singular vectors, stored rowwise).
jobu != 'O' and jobvt != 'O': The contents of a[][] are destroyed. |
| [out] | s[] | Array s[ls] (ls >= min(m, n))
The singular values of A, sorted so that s[i] >= s[i+1]. |
| [in] | ldu | Leading dimension of the two dimensional array u[][]. (ldu >= 1 if jobu = 'O' or 'N', ldu >= m if jobu = 'A' or 'S') |
| [out] | u[][] | Array u[lu][ldu] (lu >= m (if jobu = 'A'), lu >= min(m, n) (if jobu = 'S'))
jobu = 'A': u[][] contains the m x m unitary matrix U.
jobu = 'S': u[][] contains the first min(m, n) columns of U (the left singular vectors, stored columnwise).
jobu = 'N' or 'O': u[][] is not referenced. |
| [in] | ldvt | Leading dimension of the two dimensional array vt[][]. (ldvt >= 1 if jobvt = 'O' or 'N', ldvt >= n if jobvt = 'A', ldvt >= min(m, n) if jobvt = 'S') |
| [out] | vt[][] | Array vt[lvt][ldvt] (lvt >= n)
jobvt = 'A': vt[][] contains the n x n unitary matrix V^H.
jobvt = 'S': vt[][] contains the first min(m, n) rows of V^H (the right singular vectors, stored rowwise).
jobvt = 'N' or 'O': vt[][] is not referenced. |
| [out] | work[] | Array work[lwork]
Work array
On exit, if info = 0, work[0] returns the optimal lwork. |
| [in] | lwork | The dimension of the array work[] (lwork >= max(1, 2*min(m, n) + max(m, n)))
For good performance, lwork must generally be larger.
If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[] array, and returns the value in work[0]. |
| [out] | rwork[] | Array rwork[lrwork] (lrwork >= 5*min(m, n))
Work array.
If info > 0, rwork[0 to min(m, n)-2] contains the unconverged super-diagonal elements of an upper bidiagonal matrix B whose diagonal is in s[] (not necessarily sorted). B satisfies A = U * B * V^H, so it has the same singular values as A, and singular vectors related by U and V^H. |
| [out] | info | = 0: Successful exit
= -1: The argument jobu had an illegal value (jobu != 'A', 'S', 'O' nor 'N')
= -2: The argument jobvt had an illegal value (jobvt != 'A', 'S', 'O' nor 'N')
= -3: The argument m had an illegal value (m < 0)
= -4: The argument n had an illegal value (n < 0)
= -5: The argument lda had an illegal value (lda < max(1, m))
= -8: The argument ldu had an illegal value (ldu too small)
= -10: The argument ldvt had an illegal value (ldvt too small)
= -13: The argument lwork had an illegal value (lwork too small)
> 0: If zbdsqr did not converge, info specifies how many super-diagonals of an intermediate bidiagonal form B did not converge to zero. See the description of rwork[] above for details. |
- Reference
- LAPACK
|