XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ zgesdd()

void zgesdd ( char  jobz,
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  iwork[],
int *  info 
)

(Divide and conquer 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, by using divide-and-conquer method. The SVD is written
A = U * SIGMA * V^H
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.

Note that the routine returns V^H, not V.
Parameters
[in]jobzSpecifies options for computing all or part of the matrix U and V^H:
= 'A': All m columns of U and all N rows of V^H are returned in the array u[][] and vt[][].
= 'S': The first min(m, n) columns of U and the first min(m, n) rows of V^H are returned in the array u[][] and vt[][].
= 'O': If m >= n, the first n columns of U are overwritten on the array a[][] and all rows of V^H are returned in the array vt[][]. Otherwise, all columns of U are returned in the array u[][] and the first m rows of V^H are overwritten in the array a[][].
= 'N': No columns of U or rows of V^H are computed.
[in]mNumber of rows of the input matrix A. (m >= 0) (If m = 0, returns without computation)
[in]nNumber of columns of the input matrix A. (n >= 0) (If n = 0, returns without computation)
[in]ldaLeading 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] jobz = 'O': a[][] is overwritten with the first n columns of U (the left singular vectors, stored columnwise) if m >= n. a[][] is overwritten with the first m rows of V^H (the right singular vectors, stored rowwise) otherwise.
  jobz != 'O': The contents of a[][] are destroyed.
[out]s[]Array s[ls] (ls >= min(m, n))
Singular values of A, sorted so that s[i] >= s[i+1].
[in]lduLeading dimension of the two dimensional array u[][]. (ldu >= m if jobz = 'S' or 'A' or jobz = 'O' and m < n. ldu >= 1 otherwise.)
[out]u[][]Array u[lu][ldu] (lu >= m if jobz = 'A' or jobz = 'O' and m < n. lu >= min(m, n) if jobz = 'S')
jobz = 'A' or jobz = 'O' and m < n: u[][] contains the m x m unitary matrix U.
jobz = 'S': u[][] contains the first min(m, n) columns of U (the left singular vectors, stored columnwise).
jobz = 'O' and m >= n or jobz = 'N': u[][] is not referenced.
[in]ldvtLeading dimension of the two dimensional array vt[][]. (ldvt >= n if jobz = 'A' or jobz = 'O' and m >= n. ldvt >= min(m, n) if jobz = 'S'. ldvt >= 1 otherwise.)
[out]vt[][]Array vt[lvt][ldvt] (lvt >= n)
jobz = 'A' or jobz = 'O' and m >= n: vt[][] contains the n x n unitary matrix V^H.
jobz = 'S': vt[][] contains the first min(m, n) rows of V^H (the right singular vectors, stored rowwise).
jobz = 'O' and m < n or jobz = 'N': vt[][] is not referenced.
[out]work[]Array work[lwork]
Work array.
On exit, if info = 0, work[0] returns the optimal lwork.
[in]lworkThe dimension of the array work[]. (lwork must be at least 1: lwork = max(1, lwork))
Let mx = max(m, n) and mn = min(m, n).
If jobz = 'N', lwork >= 2*mn + mx.
If jobz = 'O', lwork >= 2*mn*mn + 2*mn + mx.
If jobz = 'S', lwork >= mn*mn + 3*mn.
If jobz = 'A', lwork >= mn*mn + 2*mn + mx.
For good performance, lwork should generally be larger. A query is recommended.

If lwork = -1, a workspace query is assumed. The optimal size for the work[] array is calculated and stored in work[0], and no other work except argument checking is performed.
[out]rwork[]Array rwork[lrwork] (lrwork must be at least 1: lrwork = max(1, lrwork)))
Let mx = max(m, n) and mn = min(m, n). If jobz = 'N', lrwork >= 5*mn.
Else if mx >> mn, lrwork >= 5*mn*mn + 5*mn.
Else lrwork >= max(5*mn*mn + 5*mn, 2*mx*mn + 2*mn*mn + mn).
Double precision work array.
[out]iwork[]Array iwork[liwork] (liwork >= 8*min(m, n))
Integer work array.
[out]info= 0: Successful exit
= -1: The argument jobz had an illegal value (jobu != 'A', 'S', 'O' nor 'N')
= -2: The argument m had an illegal value (m < 0)
= -3: The argument n had an illegal value (n < 0)
= -4: The argument lda had an illegal value (lda < max(1, m))
= -5: The argument a had an illegal value (a[][] had a NAN entry)
= -7: The argument ldu had an illegal value (ldu too small)
= -9: The argument ldvt had an illegal value (ldvt too small)
= -12: The argument lwork had an illegal value (lwork too small)
> 0: dbdsdc did not converge. Updating process of divide and conquer failed.
Reference
LAPACK