![]() |
MAGMA
1.5.0
Matrix Algebra for GPU and Multicore Architectures
|
Functions | |
magma_int_t | magma_zgesdd (magma_vec_t jobz, magma_int_t m, magma_int_t n, magmaDoubleComplex *A, magma_int_t lda, double *s, magmaDoubleComplex *U, magma_int_t ldu, magmaDoubleComplex *VT, magma_int_t ldvt, magmaDoubleComplex *work, magma_int_t lwork, double *rwork, magma_int_t *iwork, magma_int_t *info) |
ZGESDD computes the singular value decomposition (SVD) of a complex M-by-N matrix A, optionally computing the left and right singular vectors, by using divide-and-conquer method. More... | |
magma_int_t | magma_zgesvd (magma_vec_t jobu, magma_vec_t jobvt, magma_int_t m, magma_int_t n, magmaDoubleComplex *A, magma_int_t lda, double *s, magmaDoubleComplex *U, magma_int_t ldu, magmaDoubleComplex *VT, magma_int_t ldvt, magmaDoubleComplex *work, magma_int_t lwork, double *rwork, magma_int_t *info) |
ZGESVD computes the singular value decomposition (SVD) of a complex M-by-N matrix A, optionally computing the left and/or right singular vectors. More... | |
magma_int_t magma_zgesdd | ( | magma_vec_t | jobz, |
magma_int_t | m, | ||
magma_int_t | n, | ||
magmaDoubleComplex * | A, | ||
magma_int_t | lda, | ||
double * | s, | ||
magmaDoubleComplex * | U, | ||
magma_int_t | ldu, | ||
magmaDoubleComplex * | VT, | ||
magma_int_t | ldvt, | ||
magmaDoubleComplex * | work, | ||
magma_int_t | lwork, | ||
double * | rwork, | ||
magma_int_t * | iwork, | ||
magma_int_t * | info | ||
) |
ZGESDD computes the singular value decomposition (SVD) of a complex M-by-N matrix A, optionally computing the left and right singular vectors, by using divide-and-conquer method.
The SVD is written
A = U * SIGMA * conjugate-transpose(V)
where SIGMA is an M-by-N matrix which is zero except for its min(m,n) diagonal elements, U is an M-by-M unitary matrix, and V is an N-by-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 VT = V**H, not V.
The divide and conquer algorithm makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on those binary machines without guard digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none.
[in] | jobz | magma_vec_t Specifies options for computing all or part of the matrix U:
|
[in] | m | INTEGER The number of rows of the input matrix A. M >= 0. |
[in] | n | INTEGER The number of columns of the input matrix A. N >= 0. |
[in,out] | A | COMPLEX*16 array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit,
|
[in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,M). |
[out] | s | DOUBLE PRECISION array, dimension (min(M,N)) The singular values of A, sorted so that S(i) >= S(i+1). |
[out] | U | COMPLEX*16 array, dimension (LDU,UCOL) UCOL = M if JOBZ = MagmaAllVec or JOBZ = MagmaOverwriteVec and M < N; UCOL = min(M,N) if JOBZ = MagmaSomeVec.
|
[in] | ldu | INTEGER The leading dimension of the array U. LDU >= 1; if JOBZ = MagmaSomeVec or MagmaAllVec or JOBZ = MagmaOverwriteVec and M < N, LDU >= M. |
[out] | VT | COMPLEX*16 array, dimension (LDVT,N)
|
[in] | ldvt | INTEGER The leading dimension of the array VT. LDVT >= 1; if JOBZ = MagmaAllVec or JOBZ = MagmaOverwriteVec and M >= N, LDVT >= N; if JOBZ = MagmaSomeVec, LDVT >= min(M,N). |
[out] | work | (workspace) COMPLEX*16 array, dimension (MAX(1,lwork)) On exit, if INFO = 0, WORK[1] returns the optimal lwork. |
[in] | lwork | INTEGER The dimension of the array WORK. Let x = max(M,N) and y = min(M,N). The optimal block size nb can be obtained through magma_get_dgesvd_nb(N). The threshold for x >> y currently is x >= int( y*17/9 ). Required size different than in LAPACK.* In most cases, these sizes should give optimal performance for both MAGMA and LAPACK.
|
rwork | (workspace) DOUBLE PRECISION array, dimension (MAX(1,LRWORK)) Let x = max(M,N) and y = min(M,N). These sizes should work for both MAGMA and LAPACK. If JOBZ = MagmaNoVec, LRWORK >= 5*y. If JOBZ != MagmaNoVec, if x >> y, LRWORK >= 5*y*y + 5*y; otherwise, LRWORK >= max( 5*y*y + 5*y, 2*x*y + 2*y*y + y ). For JOBZ = MagmaNoVec, some implementations seem to have a bug requiring LRWORK >= 7*y in some cases. | |
iwork | (workspace) INTEGER array, dimension (8*min(M,N)) | |
[out] | info | INTEGER
|
Based on contributions by Ming Gu and Huan Ren, Computer Science Division, University of California at Berkeley, USA
magma_int_t magma_zgesvd | ( | magma_vec_t | jobu, |
magma_vec_t | jobvt, | ||
magma_int_t | m, | ||
magma_int_t | n, | ||
magmaDoubleComplex * | A, | ||
magma_int_t | lda, | ||
double * | s, | ||
magmaDoubleComplex * | U, | ||
magma_int_t | ldu, | ||
magmaDoubleComplex * | VT, | ||
magma_int_t | ldvt, | ||
magmaDoubleComplex * | work, | ||
magma_int_t | lwork, | ||
double * | rwork, | ||
magma_int_t * | info | ||
) |
ZGESVD computes the singular value decomposition (SVD) of a complex M-by-N matrix A, optionally computing the left and/or right singular vectors.
The SVD is written
A = U * SIGMA * conjugate-transpose(V)
where SIGMA is an M-by-N matrix which is zero except for its min(m,n) diagonal elements, U is an M-by-M unitary matrix, and V is an N-by-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.
[in] | jobu | magma_vec_t Specifies options for computing all or part of the matrix U:
|
[in] | jobvt | magma_vec_t Specifies options for computing all or part of the matrix V**H:
|
[in] | m | INTEGER The number of rows of the input matrix A. M >= 0. |
[in] | n | INTEGER The number of columns of the input matrix A. N >= 0. |
[in,out] | A | COMPLEX_16 array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit,
|
[in] | lda | INTEGER The leading dimension of the array A. LDA >= max(1,M). |
[out] | s | DOUBLE_PRECISION array, dimension (min(M,N)) The singular values of A, sorted so that S(i) >= S(i+1). |
[out] | U | COMPLEX_16 array, dimension (LDU,UCOL) (LDU,M) if JOBU = MagmaAllVec or (LDU,min(M,N)) if JOBU = MagmaSomeVec.
|
[in] | ldu | INTEGER The leading dimension of the array U. LDU >= 1; if JOBU = MagmaSomeVec or MagmaAllVec, LDU >= M. |
[out] | VT | COMPLEX_16 array, dimension (LDVT,N)
|
[in] | ldvt | INTEGER The leading dimension of the array VT. LDVT >= 1;
|
[out] | work | (workspace) COMPLEX_16 array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the required LWORK. |
[in] | lwork | INTEGER The dimension of the array WORK. LWORK >= (M+N)*nb + 2*min(M,N). For optimum performance with some paths (m >> n and jobu=A,S,O; or n >> m and jobvt=A,S,O), LWORK >= (M+N)*nb + 2*min(M,N) + 2*min(M,N)**2 (see comments inside code). If LWORK = -1, then a workspace query is assumed; the routine only calculates the required size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. |
rwork | (workspace) DOUBLE_PRECISION array, dimension (5*min(M,N)) On exit, if INFO > 0, RWORK(1:MIN(M,N)-1) contains the unconverged superdiagonal elements of an upper bidiagonal matrix B whose diagonal is in S (not necessarily sorted). B satisfies A = U * B * VT, so it has the same singular values as A, and singular vectors related by U and VT. | |
[out] | info | INTEGER
|