![]() |
MAGMA
1.7.0
Matrix Algebra for GPU and Multicore Architectures
|
Functions | |
magma_int_t | magma_sgesdd (magma_vec_t jobz, magma_int_t m, magma_int_t n, float *A, magma_int_t lda, float *s, float *U, magma_int_t ldu, float *VT, magma_int_t ldvt, float *work, magma_int_t lwork, magma_int_t *iwork, magma_int_t *info) |
SGESDD computes the singular value decomposition (SVD) of a real M-by-N matrix A, optionally computing the left and right singular vectors, by using divide-and-conquer method. More... | |
magma_int_t | magma_sgesvd (magma_vec_t jobu, magma_vec_t jobvt, magma_int_t m, magma_int_t n, float *A, magma_int_t lda, float *s, float *U, magma_int_t ldu, float *VT, magma_int_t ldvt, float *work, magma_int_t lwork, magma_int_t *info) |
SGESVD computes the singular value decomposition (SVD) of a real M-by-N matrix A, optionally computing the left and/or right singular vectors. More... | |
magma_int_t magma_sgesdd | ( | magma_vec_t | jobz, |
magma_int_t | m, | ||
magma_int_t | n, | ||
float * | A, | ||
magma_int_t | lda, | ||
float * | s, | ||
float * | U, | ||
magma_int_t | ldu, | ||
float * | VT, | ||
magma_int_t | ldvt, | ||
float * | work, | ||
magma_int_t | lwork, | ||
magma_int_t * | iwork, | ||
magma_int_t * | info | ||
) |
SGESDD computes the singular value decomposition (SVD) of a real 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 * 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 orthogonal matrix, and V is an N-by-N orthogonal 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**T, 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 | REAL 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 | REAL array, dimension (min(M,N)) The singular values of A, sorted so that S(i) >= S(i + 1). |
[out] | U | REAL 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 | REAL 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) REAL array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK[0] 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_sgesvd_nb(N). The threshold for x >> y currently is x >= y*11/6. Required size different than in LAPACK.* In most cases, these sizes should give optimal performance for both MAGMA and LAPACK.
|
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_sgesvd | ( | magma_vec_t | jobu, |
magma_vec_t | jobvt, | ||
magma_int_t | m, | ||
magma_int_t | n, | ||
float * | A, | ||
magma_int_t | lda, | ||
float * | s, | ||
float * | U, | ||
magma_int_t | ldu, | ||
float * | VT, | ||
magma_int_t | ldvt, | ||
float * | work, | ||
magma_int_t | lwork, | ||
magma_int_t * | info | ||
) |
SGESVD computes the singular value decomposition (SVD) of a real 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 orthogonal matrix, and V is an N-by-N orthogonal 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**T, 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**T:
|
[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 | REAL 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 | REAL array, dimension (min(M,N)) The singular values of A, sorted so that S(i) >= S(i+1). |
[out] | U | REAL 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 | REAL array, dimension (LDVT,N)
|
[in] | ldvt | INTEGER The leading dimension of the array VT. LDVT >= 1;
|
[out] | work | (workspace) REAL array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK[0] returns the required LWORK. if INFO > 0, WORK(2:MIN(M,N)) 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. |
[in] | lwork | INTEGER The dimension of the array WORK. LWORK >= (M+N)*nb + 3*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 + 3*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. |
[out] | info | INTEGER
|