|
|
◆ zgesvdx()
| void zgesvdx |
( |
char |
jobu, |
|
|
char |
jobvt, |
|
|
char |
range, |
|
|
int |
m, |
|
|
int |
n, |
|
|
int |
lda, |
|
|
doublecomplex |
a[], |
|
|
double |
vl, |
|
|
double |
vu, |
|
|
int |
il, |
|
|
int |
iu, |
|
|
int * |
ns, |
|
|
double |
s[], |
|
|
int |
ldu, |
|
|
doublecomplex |
u[], |
|
|
int |
ldvt, |
|
|
doublecomplex |
vt[], |
|
|
doublecomplex |
work[], |
|
|
int |
lwork, |
|
|
double |
rwork[], |
|
|
int |
iwork[], |
|
|
int * |
info |
|
) |
| |
(Expert 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) diagonal elements, 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.
This routine uses an eigenvalue problem for obtaining the SVD, which allows for the computation of a subset of singular values and vectors.
Note that the routine returns V^H, not V.
- Parameters
-
| [in] | jobu | Specifies options for computing all or part of the matrix U.
= 'V': The first min(m, n) columns of U (the left singular vectors) or as specified by range are returned in the array u[][].
= '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.
= 'V': The first min(m, n) rows of V^H (the right singular vectors) or as specificed by range are returned in the array vt[][].
= 'N': No rows of V^H (no right singular vectors) are computed. |
| [in] | range | = 'A': All singular values will be found.
= 'V': All singular values in the half-open interval (vl, vu] will be found.
= 'I': The il-th through iu-th singular values will be found. |
| [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] The contents of a[][] are destroyed. |
| [in] | vl | range = 'V': The lower bound of the interval to be searched for singular values. (vu > vl)
range = 'A' or 'I': Not referenced. |
| [in] | vu | Range = 'V': The upper bound of the interval to be searched for singular values. (vu > vl)
range = 'A' or 'I': Not referenced. |
| [in] | il | range = 'I': The index of the smallest singular value to be returned. (1 <= il <= iu <= min(m, n), if min(m, n) > 0)
range = 'A' or 'V': Not referenced. |
| [in] | iu | range = 'I': The index of the largest singular value to be returned. (1 <= il <= iu <= min(m, n), if min(m, n) > 0)
range = 'A' or 'V': Not referenced. |
| [out] | ns | Total number of singular values found. (0 <= ns <= min(m, n))
range = 'A': ns = min(m, n).
range = 'I': ns = iu - il + 1. |
| [out] | s[] | Array s[ls] (ls >= min(m, n))
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 = 'N', ldu >= m if jobu = 'V') |
| [out] | u[][] | Array u[lu][ldu] (lu >= ns)
jobu = 'V': u[][] contains columns of U (the left singular vectors, stored columnwise) as specified by range.
jobu = 'N': u[][] is not referenced.
Note: The user must ensure that lu >= ns. If range = 'V', the exact value of ns is not known in advance and an upper bound must be used. |
| [in] | ldvt | Leading dimension of the two dimensional array vt[][]. (ldvt >= 1 if jobvt = 'N', ldvt >= ns if jobvt = 'V') |
| [out] | vt[][] | Array vt[lvt][ldvt] (lvt >= n)
jobvt = 'V': vt[][] contains the rows of V^H (the right singular vectors, stored rowwise) as specified by range.
jobvt = 'N': vt[][] is not referenced.
Note: The user must ensure that ldvt >= ns. If range = 'V', the exact value of ns is not known in advance and an upper bound must be used. |
| [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, min(m, n)*(min(m, n)+4)) for the paths: Path 1 (m much larger than n), Path 1t (n much larger than m), lwork >= max(1, min(m, n)*2+max(m, n)) for other cases)
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 >= max(1, min(m, n)*(min(m, n)*2 + 17)))
Work array. |
| [out] | iwork[] | Array iwork[liwork] (liwork >= 12*min(m, n))
Work array.
If info = 0, the first ns elements of iwork[] are zero. If info > 0, then iwork[] contains the indices of the eigenvectors that failed to converge. |
| [out] | info | = 0: Successful exit
= -1: The argument jobu had an illegal value (jobu != 'V' nor 'N')
= -2: The argument jobvt had an illegal value (jobvt != 'V' nor 'N')
= -3: The argument range had an illegal value (range != 'A', 'V' nor 'I')
= -4: The argument m had an illegal value (m < 0)
= -5: The argument n had an illegal value (n < 0)
= -6: The argument lda had an illegal value (lda < m)
= -8: The argument vl had an illegal value (vl < 0)
= -9: The argument vu had an illegal value (vu < vl)
= -10: The argument il had an illegal value (il < 1 or il > max(1, min(m, n)))
= -11: The argument iu had an illegal value (iu < min(min(m, n), il) or iu > min(m, n))
= -14: The argument ldu had an illegal value (ldu too small)
= -16: The argument ldvt had an illegal value (ldvt too small)
= -19: The argument lwork had an illegal value (lwork too small)
= i > 0: i eigenvectors failed to converge in zbdsvdx/zstevx.
= 2*n + 1: An internal error occurred in zbdsvx. |
- Reference
- LAPACK
|