MAGMA 2.10.0
Matrix Algebra for GPU and Multicore Architectures
Loading...
Searching...
No Matches
gesvd: SVD using QR iteration

Functions

magma_int_t magma_cgesvd (magma_vec_t jobu, magma_vec_t jobvt, magma_int_t m, magma_int_t n, magmaFloatComplex *A, magma_int_t lda, float *s, magmaFloatComplex *U, magma_int_t ldu, magmaFloatComplex *VT, magma_int_t ldvt, magmaFloatComplex *work, magma_int_t lwork, float *rwork, magma_int_t *info)
 CGESVD computes the singular value decomposition (SVD) of a complex M-by-N matrix A, optionally computing the left and/or right singular vectors.
 
magma_int_t magma_cgesvj_blocked_expert_batched (magma_vec_t jobu_org, magma_vec_t jobv_org, magma_int_t morg, magma_int_t norg, magmaFloatComplex **dA_array, magma_int_t ldda, float **dS_array, magmaFloatComplex **dU_array, magma_int_t lddu, magmaFloatComplex **dV_array, magma_int_t lddv, magma_int_t *dinfo_array, magma_int_t nb, magma_int_t max_sweeps, magma_int_t heevj_max_sweeps, float heevj_tol, float heevj_tol_min, float heevj_tol_scal, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 CGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_cgesvj_expert_batched (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, magmaFloatComplex **dA_array, magma_int_t ldda, float **dS_array, magmaFloatComplex **dU_array, magma_int_t lddu, magmaFloatComplex **dV_array, magma_int_t lddv, magma_int_t *dinfo_array, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 CGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_cgesvj_expert_batched_strided (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, magmaFloatComplex_ptr dA, magma_int_t ldda, magma_int_t strideA, magmaFloat_ptr dS, magma_int_t strideS, magmaFloatComplex_ptr dU, magma_int_t lddu, magma_int_t strideU, magmaFloatComplex_ptr dV, magma_int_t lddv, magma_int_t strideV, magmaInt_ptr dinfo_array, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 CGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_cgesvj_batched (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, magmaFloatComplex **dA_array, magma_int_t ldda, float **dS_array, magmaFloatComplex **dU_array, magma_int_t lddu, magmaFloatComplex **dV_array, magma_int_t lddv, magma_int_t *dinfo_array, magma_int_t batchCount, magma_queue_t queue)
 CGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_cgesvj_batched_strided (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, magmaFloatComplex_ptr dA, magma_int_t ldda, magma_int_t strideA, magmaFloat_ptr dS, magma_int_t strideS, magmaFloatComplex_ptr dU, magma_int_t lddu, magma_int_t strideU, magmaFloatComplex_ptr dV, magma_int_t lddv, magma_int_t strideV, magmaInt_ptr dinfo_array, magma_int_t batchCount, magma_queue_t queue)
 CGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_cgesvj_qr_expert_batched (magma_vec_t jobu_org, magma_vec_t jobv_org, magma_int_t morg, magma_int_t norg, magmaFloatComplex **dA_array, magma_int_t ldda, float **dS_array, magmaFloatComplex **dU_array, magma_int_t lddu, magmaFloatComplex **dV_array, magma_int_t lddv, magma_int_t *info_array, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 CGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A, optionally computing the left and/or right singular vectors.
 
magma_int_t magma_dgesvd (magma_vec_t jobu, magma_vec_t jobvt, magma_int_t m, magma_int_t n, double *A, magma_int_t lda, double *s, double *U, magma_int_t ldu, double *VT, magma_int_t ldvt, double *work, magma_int_t lwork, magma_int_t *info)
 DGESVD computes the singular value decomposition (SVD) of a real M-by-N matrix A, optionally computing the left and/or right singular vectors.
 
magma_int_t magma_dgesvj_blocked_expert_batched (magma_vec_t jobu_org, magma_vec_t jobv_org, magma_int_t morg, magma_int_t norg, double **dA_array, magma_int_t ldda, double **dS_array, double **dU_array, magma_int_t lddu, double **dV_array, magma_int_t lddv, magma_int_t *dinfo_array, magma_int_t nb, magma_int_t max_sweeps, magma_int_t heevj_max_sweeps, double heevj_tol, double heevj_tol_min, double heevj_tol_scal, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 DGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_dgesvj_expert_batched (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, double **dA_array, magma_int_t ldda, double **dS_array, double **dU_array, magma_int_t lddu, double **dV_array, magma_int_t lddv, magma_int_t *dinfo_array, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 DGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_dgesvj_expert_batched_strided (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, magmaDouble_ptr dA, magma_int_t ldda, magma_int_t strideA, magmaDouble_ptr dS, magma_int_t strideS, magmaDouble_ptr dU, magma_int_t lddu, magma_int_t strideU, magmaDouble_ptr dV, magma_int_t lddv, magma_int_t strideV, magmaInt_ptr dinfo_array, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 DGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_dgesvj_batched (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, double **dA_array, magma_int_t ldda, double **dS_array, double **dU_array, magma_int_t lddu, double **dV_array, magma_int_t lddv, magma_int_t *dinfo_array, magma_int_t batchCount, magma_queue_t queue)
 DGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_dgesvj_batched_strided (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, magmaDouble_ptr dA, magma_int_t ldda, magma_int_t strideA, magmaDouble_ptr dS, magma_int_t strideS, magmaDouble_ptr dU, magma_int_t lddu, magma_int_t strideU, magmaDouble_ptr dV, magma_int_t lddv, magma_int_t strideV, magmaInt_ptr dinfo_array, magma_int_t batchCount, magma_queue_t queue)
 DGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_dgesvj_qr_expert_batched (magma_vec_t jobu_org, magma_vec_t jobv_org, magma_int_t morg, magma_int_t norg, double **dA_array, magma_int_t ldda, double **dS_array, double **dU_array, magma_int_t lddu, double **dV_array, magma_int_t lddv, magma_int_t *info_array, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 DGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A, optionally computing the left and/or right singular vectors.
 
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.
 
magma_int_t magma_sgesvj_blocked_expert_batched (magma_vec_t jobu_org, magma_vec_t jobv_org, magma_int_t morg, magma_int_t norg, float **dA_array, magma_int_t ldda, float **dS_array, float **dU_array, magma_int_t lddu, float **dV_array, magma_int_t lddv, magma_int_t *dinfo_array, magma_int_t nb, magma_int_t max_sweeps, magma_int_t heevj_max_sweeps, float heevj_tol, float heevj_tol_min, float heevj_tol_scal, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 SGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_sgesvj_expert_batched (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, float **dA_array, magma_int_t ldda, float **dS_array, float **dU_array, magma_int_t lddu, float **dV_array, magma_int_t lddv, magma_int_t *dinfo_array, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 SGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_sgesvj_expert_batched_strided (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, magmaFloat_ptr dA, magma_int_t ldda, magma_int_t strideA, magmaFloat_ptr dS, magma_int_t strideS, magmaFloat_ptr dU, magma_int_t lddu, magma_int_t strideU, magmaFloat_ptr dV, magma_int_t lddv, magma_int_t strideV, magmaInt_ptr dinfo_array, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 SGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_sgesvj_batched (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, float **dA_array, magma_int_t ldda, float **dS_array, float **dU_array, magma_int_t lddu, float **dV_array, magma_int_t lddv, magma_int_t *dinfo_array, magma_int_t batchCount, magma_queue_t queue)
 SGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_sgesvj_batched_strided (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, magmaFloat_ptr dA, magma_int_t ldda, magma_int_t strideA, magmaFloat_ptr dS, magma_int_t strideS, magmaFloat_ptr dU, magma_int_t lddu, magma_int_t strideU, magmaFloat_ptr dV, magma_int_t lddv, magma_int_t strideV, magmaInt_ptr dinfo_array, magma_int_t batchCount, magma_queue_t queue)
 SGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_sgesvj_qr_expert_batched (magma_vec_t jobu_org, magma_vec_t jobv_org, magma_int_t morg, magma_int_t norg, float **dA_array, magma_int_t ldda, float **dS_array, float **dU_array, magma_int_t lddu, float **dV_array, magma_int_t lddv, magma_int_t *info_array, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 SGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A, optionally computing the left and/or right singular vectors.
 
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.
 
magma_int_t magma_zgesvj_blocked_expert_batched (magma_vec_t jobu_org, magma_vec_t jobv_org, magma_int_t morg, magma_int_t norg, magmaDoubleComplex **dA_array, magma_int_t ldda, double **dS_array, magmaDoubleComplex **dU_array, magma_int_t lddu, magmaDoubleComplex **dV_array, magma_int_t lddv, magma_int_t *dinfo_array, magma_int_t nb, magma_int_t max_sweeps, magma_int_t heevj_max_sweeps, double heevj_tol, double heevj_tol_min, double heevj_tol_scal, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 ZGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_zgesvj_expert_batched (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, magmaDoubleComplex **dA_array, magma_int_t ldda, double **dS_array, magmaDoubleComplex **dU_array, magma_int_t lddu, magmaDoubleComplex **dV_array, magma_int_t lddv, magma_int_t *dinfo_array, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 ZGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_zgesvj_expert_batched_strided (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, magmaDoubleComplex_ptr dA, magma_int_t ldda, magma_int_t strideA, magmaDouble_ptr dS, magma_int_t strideS, magmaDoubleComplex_ptr dU, magma_int_t lddu, magma_int_t strideU, magmaDoubleComplex_ptr dV, magma_int_t lddv, magma_int_t strideV, magmaInt_ptr dinfo_array, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 ZGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_zgesvj_batched (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, magmaDoubleComplex **dA_array, magma_int_t ldda, double **dS_array, magmaDoubleComplex **dU_array, magma_int_t lddu, magmaDoubleComplex **dV_array, magma_int_t lddv, magma_int_t *dinfo_array, magma_int_t batchCount, magma_queue_t queue)
 ZGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_zgesvj_batched_strided (magma_vec_t jobu, magma_vec_t jobv, magma_int_t morg, magma_int_t norg, magmaDoubleComplex_ptr dA, magma_int_t ldda, magma_int_t strideA, magmaDouble_ptr dS, magma_int_t strideS, magmaDoubleComplex_ptr dU, magma_int_t lddu, magma_int_t strideU, magmaDoubleComplex_ptr dV, magma_int_t lddv, magma_int_t strideV, magmaInt_ptr dinfo_array, magma_int_t batchCount, magma_queue_t queue)
 ZGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_zgesvj_qr_expert_batched (magma_vec_t jobu_org, magma_vec_t jobv_org, magma_int_t morg, magma_int_t norg, magmaDoubleComplex **dA_array, magma_int_t ldda, double **dS_array, magmaDoubleComplex **dU_array, magma_int_t lddu, magmaDoubleComplex **dV_array, magma_int_t lddv, magma_int_t *info_array, void *device_work, int64_t *device_lwork, magma_int_t batchCount, magma_queue_t queue)
 ZGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A, optionally computing the left and/or right singular vectors.
 
magma_int_t magma_cgesvj_batched_small_sm (magma_vec_t jobu, magma_vec_t jobv, magma_int_t m, magma_int_t n, magmaFloatComplex **dA_array, magma_int_t ldda, float **dS_array, magmaFloatComplex **dU_array, magma_int_t lddu, magmaFloatComplex **dV_array, magma_int_t lddv, magma_int_t *info_array, magma_int_t batchCount, magma_queue_t queue)
 CGESVJ computes the singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_dgesvj_batched_small_sm (magma_vec_t jobu, magma_vec_t jobv, magma_int_t m, magma_int_t n, double **dA_array, magma_int_t ldda, double **dS_array, double **dU_array, magma_int_t lddu, double **dV_array, magma_int_t lddv, magma_int_t *info_array, magma_int_t batchCount, magma_queue_t queue)
 DGESVJ computes the singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_sgesvj_batched_small_sm (magma_vec_t jobu, magma_vec_t jobv, magma_int_t m, magma_int_t n, float **dA_array, magma_int_t ldda, float **dS_array, float **dU_array, magma_int_t lddu, float **dV_array, magma_int_t lddv, magma_int_t *info_array, magma_int_t batchCount, magma_queue_t queue)
 SGESVJ computes the singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 
magma_int_t magma_zgesvj_batched_small_sm (magma_vec_t jobu, magma_vec_t jobv, magma_int_t m, magma_int_t n, magmaDoubleComplex **dA_array, magma_int_t ldda, double **dS_array, magmaDoubleComplex **dU_array, magma_int_t lddu, magmaDoubleComplex **dV_array, magma_int_t lddv, magma_int_t *info_array, magma_int_t batchCount, magma_queue_t queue)
 ZGESVJ computes the singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.
 

Detailed Description

Function Documentation

◆ magma_cgesvd()

magma_int_t magma_cgesvd ( magma_vec_t jobu,
magma_vec_t jobvt,
magma_int_t m,
magma_int_t n,
magmaFloatComplex * A,
magma_int_t lda,
float * s,
magmaFloatComplex * U,
magma_int_t ldu,
magmaFloatComplex * VT,
magma_int_t ldvt,
magmaFloatComplex * work,
magma_int_t lwork,
float * rwork,
magma_int_t * info )

CGESVD 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 VT = V**H, not V.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaAllVec: all M columns of U are returned in array U:
  • = MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are returned in the array U;
  • = MagmaOverwriteVec: the first min(m,n) columns of U (the left singular vectors) are overwritten on the array A;
  • = MagmaNoVec: no columns of U (no left singular vectors) are computed.
[in]jobvtmagma_vec_t Specifies options for computing all or part of the matrix V**H:
  • = MagmaAllVec: all N rows of V**H are returned in the array VT;
  • = MagmaSomeVec: the first min(m,n) rows of V**H (the right singular vectors) are returned in the array VT;
  • = MagmaOverwriteVec: the first min(m,n) rows of V**H (the right singular vectors) are overwritten on the array A;
  • = MagmaNoVec: no rows of V**H (no right singular vectors) are computed.
    JOBVT and JOBU cannot both be MagmaOverwriteVec.
[in]mINTEGER The number of rows of the input matrix A. M >= 0.
[in]nINTEGER The number of columns of the input matrix A. N >= 0.
[in,out]ACOMPLEX array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit,
  • if JOBU = MagmaOverwriteVec, A is overwritten with the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBVT = MagmaOverwriteVec, A is overwritten with the first min(m,n) rows of V**H (the right singular vectors, stored rowwise);
  • if JOBU != MagmaOverwriteVec and JOBVT != MagmaOverwriteVec, the contents of A are destroyed.
[in]ldaINTEGER The leading dimension of the array A. LDA >= max(1,M).
[out]sREAL array, dimension (min(M,N)) The singular values of A, sorted so that S(i) >= S(i+1).
[out]UCOMPLEX array, dimension (LDU,UCOL) (LDU,M) if JOBU = MagmaAllVec or (LDU,min(M,N)) if JOBU = MagmaSomeVec.
  • If JOBU = MagmaAllVec, U contains the M-by-M unitary matrix U;
  • if JOBU = MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec or MagmaOverwriteVec, U is not referenced.
[in]lduINTEGER The leading dimension of the array U. LDU >= 1; if JOBU = MagmaSomeVec or MagmaAllVec, LDU >= M.
[out]VTCOMPLEX array, dimension (LDVT,N)
  • If JOBVT = MagmaAllVec, VT contains the N-by-N unitary matrix V**H;
  • if JOBVT = MagmaSomeVec, VT contains the first min(m,n) rows of V**H (the right singular vectors, stored rowwise);
  • if JOBVT = MagmaNoVec or MagmaOverwriteVec, VT is not referenced.
[in]ldvtINTEGER The leading dimension of the array VT. LDVT >= 1;
  • if JOBVT = MagmaAllVec, LDVT >= N;
  • if JOBVT = MagmaSomeVec, LDVT >= min(M,N).
[out]work(workspace) COMPLEX array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK[0] returns the required LWORK.
[in]lworkINTEGER The dimension of the array WORK. 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.
Let mx = max(M,N) and mn = min(M,N). The threshold for mx >> mn is currently mx >= 1.6*mn. For job: N=None, O=Overwrite, S=Some, A=All. Paths below assume M >= N; for N > M swap jobu and jobvt.
Because of varying nb for different subroutines, formulas below are an upper bound. Querying gives an exact number. The optimal block size nb can be obtained through magma_get_dgesvd_nb(M,N). For many cases, there is a fast algorithm, and a slow algorithm that uses less workspace. Here are sizes for both cases.
Optimal lwork (fast algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any 2*mn + 2*mn*nb Path 2: jobu=O, jobvt=N mn*mn + 2*mn + 2*mn*nb or mn*mn + max(2*mn + 2*mn*nb, mx*mn) Path 3: jobu=O, jobvt=A,S mn*mn + 2*mn + 2*mn*nb or mn*mn + max(2*mn + 2*mn*nb, mx*mn) Path 4: jobu=S, jobvt=N mn*mn + 2*mn + 2*mn*nb Path 5: jobu=S, jobvt=O 2*mn*mn + 2*mn + 2*mn*nb Path 6: jobu=S, jobvt=A,S mn*mn + 2*mn + 2*mn*nb Path 7: jobu=A, jobvt=N mn*mn + max(2*mn + 2*mn*nb, mn + mx*nb) Path 8: jobu=A, jobvt=O 2*mn*mn + max(2*mn + 2*mn*nb, mn + mx*nb) Path 9: jobu=A, jobvt=A,S mn*mn + max(2*mn + 2*mn*nb, mn + mx*nb) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any 2*mn + (mx + mn)*nb
Optimal lwork (slow algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any n/a Path 2: jobu=O, jobvt=N 2*mn + (mx + mn)*nb Path 3-9: 2*mn + max(2*mn*nb, mx*nb) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any n/a
MAGMA requires the optimal sizes above, while LAPACK has the same optimal sizes but the minimum sizes below.
LAPACK minimum lwork (fast algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any 3*mn Path 2: jobu=O, jobvt=N mn*mn + 3*mn Path 3: jobu=O, jobvt=A,S mn*mn + 3*mn Path 4: jobu=S, jobvt=N mn*mn + 3*mn Path 5: jobu=S, jobvt=O 2*mn*mn + 3*mn Path 6: jobu=S, jobvt=A,S mn*mn + 3*mn Path 7: jobu=A, jobvt=N mn*mn + max(3*mn, mn + mx) Path 8: jobu=A, jobvt=O 2*mn*mn + max(3*mn, mn + mx) Path 9: jobu=A, jobvt=A,S mn*mn + max(3*mn, mn + mx) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any 2*mn + mx
LAPACK minimum lwork (slow algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any n/a Path 2-9: 2*mn + mx for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any n/a
rwork(workspace) REAL 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]infoINTEGER
  • = 0: successful exit.
  • < 0: if INFO = -i, the i-th argument had an illegal value.
  • > 0: if CBDSQR did not converge, INFO specifies how many superdiagonals of an intermediate bidiagonal form B did not converge to zero. See the description of RWORK above for details.

◆ magma_cgesvj_blocked_expert_batched()

magma_int_t magma_cgesvj_blocked_expert_batched ( magma_vec_t jobu_org,
magma_vec_t jobv_org,
magma_int_t morg,
magma_int_t norg,
magmaFloatComplex ** dA_array,
magma_int_t ldda,
float ** dS_array,
magmaFloatComplex ** dU_array,
magma_int_t lddu,
magmaFloatComplex ** dV_array,
magma_int_t lddv,
magma_int_t * dinfo_array,
magma_int_t nb,
magma_int_t max_sweeps,
magma_int_t heevj_max_sweeps,
float heevj_tol,
float heevj_tol_min,
float heevj_tol_scal,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

CGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) unitary matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is the internal blocked implementation of the algorithm, which provides extra arguments for expert users.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a COMPLEX array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a COMPLEX array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in]nbINTEGER The blocking size used by the algorithm. Each input matrix is subdivided into block columns of width nb each.
[in]max_sweepsINTEGER The maximum number of Jacobi sweeps.
[in]heevj_max_sweepsINTEGER The maximum number of Jacobi sweeps for the Hermitian eigensolver used to orthogonalize a pair of block columns
[in]heevj_tolDOUBLE The tolerance (as multiples of the machine epsilon) for the Hermitian eigensolver. This tolerance is used to control if an off-diagonal element in the Gram matrix should be annihilated during the Hermitian eigen-decomposition. This tolerance can be scaled down by the user as the algorithm progresses (see heevj_tol_min, and heevj_tol_scal).
[in]heevj_tol_minDOUBLE The minimum tolerance (as multiples of the machine epsilon) for the Hermitian eigensolver. The algorithm optionally scales down heevj_tol as long as it is larger than heevj_tol_min.
[in]heevj_tol_scalDOUBLE A scaling factor for heevj_tol, so that: heevj_tol[next-svd-sweep] = max( heevj_tol[current-svd-sweep] / heevj_tol_scal, heevj_tol_min)

heevj_tol_scal >= 1

Parameters
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_cgesvj_expert_batched()

magma_int_t magma_cgesvj_expert_batched ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
magmaFloatComplex ** dA_array,
magma_int_t ldda,
float ** dS_array,
magmaFloatComplex ** dU_array,
magma_int_t lddu,
magmaFloatComplex ** dV_array,
magma_int_t lddv,
magma_int_t * dinfo_array,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

CGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) unitary matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a COMPLEX array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a COMPLEX array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_cgesvj_expert_batched_strided()

magma_int_t magma_cgesvj_expert_batched_strided ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
magmaFloatComplex_ptr dA,
magma_int_t ldda,
magma_int_t strideA,
magmaFloat_ptr dS,
magma_int_t strideS,
magmaFloatComplex_ptr dU,
magma_int_t lddu,
magma_int_t strideU,
magmaFloatComplex_ptr dV,
magma_int_t lddv,
magma_int_t strideV,
magmaInt_ptr dinfo_array,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

CGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) unitary matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[in]strideAINTEGER The stride (in elements) between two consecutive A matrices. strideA >= (LDDA*N).
[out]dSPointer to the beginning of an array of pointers whose length is (batchCount), such that S[i+1] = S[i] + strideS Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[in]strideSINTEGER The stride (in elements) between two consecutive S vectors. strideS >= MIN(M, N).
[out]dUPointer to the beginning of an array of pointers whose length is (batchCount), such that U[i+1] = U[i] + strideU Each is a COMPLEX array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[in]strideUINTEGER The stride (in elements) between two consecutive U matrices. strideU >= (LDDU * MIN(M,N)).
[out]dVPointer to the beginning of an array of pointers whose length is (batchCount), such that V[i+1] = V[i] + strideV Each is a COMPLEX array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first n columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[in]strideVINTEGER The stride (in elements) between two consecutive V matrices. strideU >= (LDDV * MIN(M,N)).
[out]infoINTEGER
  • = 0: successful exit.
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_cgesvj_batched()

magma_int_t magma_cgesvj_batched ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
magmaFloatComplex ** dA_array,
magma_int_t ldda,
float ** dS_array,
magmaFloatComplex ** dU_array,
magma_int_t lddu,
magmaFloatComplex ** dV_array,
magma_int_t lddv,
magma_int_t * dinfo_array,
magma_int_t batchCount,
magma_queue_t queue )

CGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) unitary matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is the internal blocked implementation of the algorithm, which provides extra arguments for expert users.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a COMPLEX array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a COMPLEX array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_cgesvj_batched_strided()

magma_int_t magma_cgesvj_batched_strided ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
magmaFloatComplex_ptr dA,
magma_int_t ldda,
magma_int_t strideA,
magmaFloat_ptr dS,
magma_int_t strideS,
magmaFloatComplex_ptr dU,
magma_int_t lddu,
magma_int_t strideU,
magmaFloatComplex_ptr dV,
magma_int_t lddv,
magma_int_t strideV,
magmaInt_ptr dinfo_array,
magma_int_t batchCount,
magma_queue_t queue )

CGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) unitary matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is the internal blocked implementation of the algorithm, which provides extra arguments for expert users.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[in]strideAINTEGER The stride (in elements) between two consecutive A matrices. strideA >= (LDDA*N).
[out]dSPointer to the beginning of an array of pointers whose length is (batchCount), such that S[i+1] = S[i] + strideS Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[in]strideSINTEGER The stride (in elements) between two consecutive S vectors. strideS >= MIN(M, N).
[out]dUPointer to the beginning of an array of pointers whose length is (batchCount), such that U[i+1] = U[i] + strideU Each is a COMPLEX array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[in]strideUINTEGER The stride (in elements) between two consecutive U matrices. strideU >= (LDDU * MIN(M,N)).
[out]dVPointer to the beginning of an array of pointers whose length is (batchCount), such that V[i+1] = V[i] + strideV Each is a COMPLEX array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first n columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[in]strideVINTEGER The stride (in elements) between two consecutive V matrices. strideU >= (LDDV * MIN(M,N)).
[out]infoINTEGER
  • = 0: successful exit.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_cgesvj_qr_expert_batched()

magma_int_t magma_cgesvj_qr_expert_batched ( magma_vec_t jobu_org,
magma_vec_t jobv_org,
magma_int_t morg,
magma_int_t norg,
magmaFloatComplex ** dA_array,
magma_int_t ldda,
float ** dS_array,
magmaFloatComplex ** dU_array,
magma_int_t lddu,
magmaFloatComplex ** dV_array,
magma_int_t lddv,
magma_int_t * info_array,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

CGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A, optionally computing the left and/or right singular vectors.

The routine first computes a QR factorization of A, followed by an SVD on the R factor. Compared to a direct SVD, better performance is expected on tall-skinny matrices.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) unitary matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a COMPLEX array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a COMPLEX array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_dgesvd()

magma_int_t magma_dgesvd ( magma_vec_t jobu,
magma_vec_t jobvt,
magma_int_t m,
magma_int_t n,
double * A,
magma_int_t lda,
double * s,
double * U,
magma_int_t ldu,
double * VT,
magma_int_t ldvt,
double * work,
magma_int_t lwork,
magma_int_t * info )

DGESVD 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 * 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.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaAllVec: all M columns of U are returned in array U:
  • = MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are returned in the array U;
  • = MagmaOverwriteVec: the first min(m,n) columns of U (the left singular vectors) are overwritten on the array A;
  • = MagmaNoVec: no columns of U (no left singular vectors) are computed.
[in]jobvtmagma_vec_t Specifies options for computing all or part of the matrix V**T:
  • = MagmaAllVec: all N rows of V**T are returned in the array VT;
  • = MagmaSomeVec: the first min(m,n) rows of V**T (the right singular vectors) are returned in the array VT;
  • = MagmaOverwriteVec: the first min(m,n) rows of V**T (the right singular vectors) are overwritten on the array A;
  • = MagmaNoVec: no rows of V**T (no right singular vectors) are computed.
    JOBVT and JOBU cannot both be MagmaOverwriteVec.
[in]mINTEGER The number of rows of the input matrix A. M >= 0.
[in]nINTEGER The number of columns of the input matrix A. N >= 0.
[in,out]ADOUBLE PRECISION array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit,
  • if JOBU = MagmaOverwriteVec, A is overwritten with the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBVT = MagmaOverwriteVec, A is overwritten with the first min(m,n) rows of V**T (the right singular vectors, stored rowwise);
  • if JOBU != MagmaOverwriteVec and JOBVT != MagmaOverwriteVec, the contents of A are destroyed.
[in]ldaINTEGER The leading dimension of the array A. LDA >= max(1,M).
[out]sDOUBLE PRECISION array, dimension (min(M,N)) The singular values of A, sorted so that S(i) >= S(i+1).
[out]UDOUBLE PRECISION array, dimension (LDU,UCOL) (LDU,M) if JOBU = MagmaAllVec or (LDU,min(M,N)) if JOBU = MagmaSomeVec.
  • If JOBU = MagmaAllVec, U contains the M-by-M orthogonal matrix U;
  • if JOBU = MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec or MagmaOverwriteVec, U is not referenced.
[in]lduINTEGER The leading dimension of the array U. LDU >= 1; if JOBU = MagmaSomeVec or MagmaAllVec, LDU >= M.
[out]VTDOUBLE PRECISION array, dimension (LDVT,N)
  • If JOBVT = MagmaAllVec, VT contains the N-by-N orthogonal matrix V**T;
  • if JOBVT = MagmaSomeVec, VT contains the first min(m,n) rows of V**T (the right singular vectors, stored rowwise);
  • if JOBVT = MagmaNoVec or MagmaOverwriteVec, VT is not referenced.
[in]ldvtINTEGER The leading dimension of the array VT. LDVT >= 1;
  • if JOBVT = MagmaAllVec, LDVT >= N;
  • if JOBVT = MagmaSomeVec, LDVT >= min(M,N).
[out]work(workspace) DOUBLE PRECISION 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]lworkINTEGER The dimension of the array WORK. 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.
Let mx = max(M,N) and mn = min(M,N). The threshold for mx >> mn is currently mx >= 1.6*mn. For job: N=None, O=Overwrite, S=Some, A=All. Paths below assume M >= N; for N > M swap jobu and jobvt.
Because of varying nb for different subroutines, formulas below are an upper bound. Querying gives an exact number. The optimal block size nb can be obtained through magma_get_dgesvd_nb(M,N). For many cases, there is a fast algorithm, and a slow algorithm that uses less workspace. Here are sizes for both cases.
Optimal lwork (fast algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any 3*mn + 2*mn*nb Path 2: jobu=O, jobvt=N mn*mn + 3*mn + 2*mn*nb or mn*mn + max(3*mn + 2*mn*nb, mn + mx*mn) Path 3: jobu=O, jobvt=A,S mn*mn + 3*mn + 2*mn*nb or mn*mn + max(3*mn + 2*mn*nb, mn + mx*mn) Path 4: jobu=S, jobvt=N mn*mn + 3*mn + 2*mn*nb Path 5: jobu=S, jobvt=O 2*mn*mn + 3*mn + 2*mn*nb Path 6: jobu=S, jobvt=A,S mn*mn + 3*mn + 2*mn*nb Path 7: jobu=A, jobvt=N mn*mn + max(3*mn + 2*mn*nb, mn + mx*nb) Path 8: jobu=A, jobvt=O 2*mn*mn + max(3*mn + 2*mn*nb, mn + mx*nb) Path 9: jobu=A, jobvt=A,S mn*mn + max(3*mn + 2*mn*nb, mn + mx*nb) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any 3*mn + (mx + mn)*nb
Optimal lwork (slow algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any n/a Path 2: jobu=O, jobvt=N 3*mn + (mx + mn)*nb Path 3-9: 3*mn + max(2*mn*nb, mx*nb) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any n/a
MAGMA requires the optimal sizes above, while LAPACK has the same optimal sizes but the minimum sizes below.
LAPACK minimum lwork (fast algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any 5*mn Path 2: jobu=O, jobvt=N mn*mn + 5*mn Path 3: jobu=O, jobvt=A,S mn*mn + 5*mn Path 4: jobu=S, jobvt=N mn*mn + 5*mn Path 5: jobu=S, jobvt=O 2*mn*mn + 5*mn Path 6: jobu=S, jobvt=A,S mn*mn + 5*mn Path 7: jobu=A, jobvt=N mn*mn + max(5*mn, mn + mx) Path 8: jobu=A, jobvt=O 2*mn*mn + max(5*mn, mn + mx) Path 9: jobu=A, jobvt=A,S mn*mn + max(5*mn, mn + mx) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any max(3*mn + mx, 5*mn)
LAPACK minimum lwork (slow algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any n/a Path 2-9: max(3*mn + mx, 5*mn) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any n/a
[out]infoINTEGER
  • = 0: successful exit.
  • < 0: if INFO = -i, the i-th argument had an illegal value.
  • > 0: if DBDSQR did not converge, INFO specifies how many superdiagonals of an intermediate bidiagonal form B did not converge to zero. See the description of WORK above for details.

◆ magma_dgesvj_blocked_expert_batched()

magma_int_t magma_dgesvj_blocked_expert_batched ( magma_vec_t jobu_org,
magma_vec_t jobv_org,
magma_int_t morg,
magma_int_t norg,
double ** dA_array,
magma_int_t ldda,
double ** dS_array,
double ** dU_array,
magma_int_t lddu,
double ** dV_array,
magma_int_t lddv,
magma_int_t * dinfo_array,
magma_int_t nb,
magma_int_t max_sweeps,
magma_int_t heevj_max_sweeps,
double heevj_tol,
double heevj_tol_min,
double heevj_tol_scal,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

DGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) orthogonal matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is the internal blocked implementation of the algorithm, which provides extra arguments for expert users.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a DOUBLE PRECISION array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in]nbINTEGER The blocking size used by the algorithm. Each input matrix is subdivided into block columns of width nb each.
[in]max_sweepsINTEGER The maximum number of Jacobi sweeps.
[in]heevj_max_sweepsINTEGER The maximum number of Jacobi sweeps for the symmetric eigensolver used to orthogonalize a pair of block columns
[in]heevj_tolDOUBLE The tolerance (as multiples of the machine epsilon) for the symmetric eigensolver. This tolerance is used to control if an off-diagonal element in the Gram matrix should be annihilated during the symmetric eigen-decomposition. This tolerance can be scaled down by the user as the algorithm progresses (see heevj_tol_min, and heevj_tol_scal).
[in]heevj_tol_minDOUBLE The minimum tolerance (as multiples of the machine epsilon) for the symmetric eigensolver. The algorithm optionally scales down heevj_tol as long as it is larger than heevj_tol_min.
[in]heevj_tol_scalDOUBLE A scaling factor for heevj_tol, so that: heevj_tol[next-svd-sweep] = max( heevj_tol[current-svd-sweep] / heevj_tol_scal, heevj_tol_min)

heevj_tol_scal >= 1

Parameters
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_dgesvj_expert_batched()

magma_int_t magma_dgesvj_expert_batched ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
double ** dA_array,
magma_int_t ldda,
double ** dS_array,
double ** dU_array,
magma_int_t lddu,
double ** dV_array,
magma_int_t lddv,
magma_int_t * dinfo_array,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

DGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) orthogonal matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a DOUBLE PRECISION array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_dgesvj_expert_batched_strided()

magma_int_t magma_dgesvj_expert_batched_strided ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
magmaDouble_ptr dA,
magma_int_t ldda,
magma_int_t strideA,
magmaDouble_ptr dS,
magma_int_t strideS,
magmaDouble_ptr dU,
magma_int_t lddu,
magma_int_t strideU,
magmaDouble_ptr dV,
magma_int_t lddv,
magma_int_t strideV,
magmaInt_ptr dinfo_array,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

DGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) orthogonal matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a DOUBLE PRECISION array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[in]strideAINTEGER The stride (in elements) between two consecutive A matrices. strideA >= (LDDA*N).
[out]dSPointer to the beginning of an array of pointers whose length is (batchCount), such that S[i+1] = S[i] + strideS Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[in]strideSINTEGER The stride (in elements) between two consecutive S vectors. strideS >= MIN(M, N).
[out]dUPointer to the beginning of an array of pointers whose length is (batchCount), such that U[i+1] = U[i] + strideU Each is a DOUBLE PRECISION array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[in]strideUINTEGER The stride (in elements) between two consecutive U matrices. strideU >= (LDDU * MIN(M,N)).
[out]dVPointer to the beginning of an array of pointers whose length is (batchCount), such that V[i+1] = V[i] + strideV Each is a DOUBLE PRECISION array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first n columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[in]strideVINTEGER The stride (in elements) between two consecutive V matrices. strideU >= (LDDV * MIN(M,N)).
[out]infoINTEGER
  • = 0: successful exit.
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_dgesvj_batched()

magma_int_t magma_dgesvj_batched ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
double ** dA_array,
magma_int_t ldda,
double ** dS_array,
double ** dU_array,
magma_int_t lddu,
double ** dV_array,
magma_int_t lddv,
magma_int_t * dinfo_array,
magma_int_t batchCount,
magma_queue_t queue )

DGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) orthogonal matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is the internal blocked implementation of the algorithm, which provides extra arguments for expert users.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a DOUBLE PRECISION array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_dgesvj_batched_strided()

magma_int_t magma_dgesvj_batched_strided ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
magmaDouble_ptr dA,
magma_int_t ldda,
magma_int_t strideA,
magmaDouble_ptr dS,
magma_int_t strideS,
magmaDouble_ptr dU,
magma_int_t lddu,
magma_int_t strideU,
magmaDouble_ptr dV,
magma_int_t lddv,
magma_int_t strideV,
magmaInt_ptr dinfo_array,
magma_int_t batchCount,
magma_queue_t queue )

DGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) orthogonal matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is the internal blocked implementation of the algorithm, which provides extra arguments for expert users.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a DOUBLE PRECISION array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[in]strideAINTEGER The stride (in elements) between two consecutive A matrices. strideA >= (LDDA*N).
[out]dSPointer to the beginning of an array of pointers whose length is (batchCount), such that S[i+1] = S[i] + strideS Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[in]strideSINTEGER The stride (in elements) between two consecutive S vectors. strideS >= MIN(M, N).
[out]dUPointer to the beginning of an array of pointers whose length is (batchCount), such that U[i+1] = U[i] + strideU Each is a DOUBLE PRECISION array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[in]strideUINTEGER The stride (in elements) between two consecutive U matrices. strideU >= (LDDU * MIN(M,N)).
[out]dVPointer to the beginning of an array of pointers whose length is (batchCount), such that V[i+1] = V[i] + strideV Each is a DOUBLE PRECISION array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first n columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[in]strideVINTEGER The stride (in elements) between two consecutive V matrices. strideU >= (LDDV * MIN(M,N)).
[out]infoINTEGER
  • = 0: successful exit.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_dgesvj_qr_expert_batched()

magma_int_t magma_dgesvj_qr_expert_batched ( magma_vec_t jobu_org,
magma_vec_t jobv_org,
magma_int_t morg,
magma_int_t norg,
double ** dA_array,
magma_int_t ldda,
double ** dS_array,
double ** dU_array,
magma_int_t lddu,
double ** dV_array,
magma_int_t lddv,
magma_int_t * info_array,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

DGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A, optionally computing the left and/or right singular vectors.

The routine first computes a QR factorization of A, followed by an SVD on the R factor. Compared to a direct SVD, better performance is expected on tall-skinny matrices.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) orthogonal matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a DOUBLE PRECISION array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_sgesvd()

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 * 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.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaAllVec: all M columns of U are returned in array U:
  • = MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are returned in the array U;
  • = MagmaOverwriteVec: the first min(m,n) columns of U (the left singular vectors) are overwritten on the array A;
  • = MagmaNoVec: no columns of U (no left singular vectors) are computed.
[in]jobvtmagma_vec_t Specifies options for computing all or part of the matrix V**T:
  • = MagmaAllVec: all N rows of V**T are returned in the array VT;
  • = MagmaSomeVec: the first min(m,n) rows of V**T (the right singular vectors) are returned in the array VT;
  • = MagmaOverwriteVec: the first min(m,n) rows of V**T (the right singular vectors) are overwritten on the array A;
  • = MagmaNoVec: no rows of V**T (no right singular vectors) are computed.
    JOBVT and JOBU cannot both be MagmaOverwriteVec.
[in]mINTEGER The number of rows of the input matrix A. M >= 0.
[in]nINTEGER The number of columns of the input matrix A. N >= 0.
[in,out]AREAL array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit,
  • if JOBU = MagmaOverwriteVec, A is overwritten with the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBVT = MagmaOverwriteVec, A is overwritten with the first min(m,n) rows of V**T (the right singular vectors, stored rowwise);
  • if JOBU != MagmaOverwriteVec and JOBVT != MagmaOverwriteVec, the contents of A are destroyed.
[in]ldaINTEGER The leading dimension of the array A. LDA >= max(1,M).
[out]sREAL array, dimension (min(M,N)) The singular values of A, sorted so that S(i) >= S(i+1).
[out]UREAL array, dimension (LDU,UCOL) (LDU,M) if JOBU = MagmaAllVec or (LDU,min(M,N)) if JOBU = MagmaSomeVec.
  • If JOBU = MagmaAllVec, U contains the M-by-M orthogonal matrix U;
  • if JOBU = MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec or MagmaOverwriteVec, U is not referenced.
[in]lduINTEGER The leading dimension of the array U. LDU >= 1; if JOBU = MagmaSomeVec or MagmaAllVec, LDU >= M.
[out]VTREAL array, dimension (LDVT,N)
  • If JOBVT = MagmaAllVec, VT contains the N-by-N orthogonal matrix V**T;
  • if JOBVT = MagmaSomeVec, VT contains the first min(m,n) rows of V**T (the right singular vectors, stored rowwise);
  • if JOBVT = MagmaNoVec or MagmaOverwriteVec, VT is not referenced.
[in]ldvtINTEGER The leading dimension of the array VT. LDVT >= 1;
  • if JOBVT = MagmaAllVec, LDVT >= N;
  • if JOBVT = MagmaSomeVec, LDVT >= min(M,N).
[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]lworkINTEGER The dimension of the array WORK. 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.
Let mx = max(M,N) and mn = min(M,N). The threshold for mx >> mn is currently mx >= 1.6*mn. For job: N=None, O=Overwrite, S=Some, A=All. Paths below assume M >= N; for N > M swap jobu and jobvt.
Because of varying nb for different subroutines, formulas below are an upper bound. Querying gives an exact number. The optimal block size nb can be obtained through magma_get_sgesvd_nb(M,N). For many cases, there is a fast algorithm, and a slow algorithm that uses less workspace. Here are sizes for both cases.
Optimal lwork (fast algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any 3*mn + 2*mn*nb Path 2: jobu=O, jobvt=N mn*mn + 3*mn + 2*mn*nb or mn*mn + max(3*mn + 2*mn*nb, mn + mx*mn) Path 3: jobu=O, jobvt=A,S mn*mn + 3*mn + 2*mn*nb or mn*mn + max(3*mn + 2*mn*nb, mn + mx*mn) Path 4: jobu=S, jobvt=N mn*mn + 3*mn + 2*mn*nb Path 5: jobu=S, jobvt=O 2*mn*mn + 3*mn + 2*mn*nb Path 6: jobu=S, jobvt=A,S mn*mn + 3*mn + 2*mn*nb Path 7: jobu=A, jobvt=N mn*mn + max(3*mn + 2*mn*nb, mn + mx*nb) Path 8: jobu=A, jobvt=O 2*mn*mn + max(3*mn + 2*mn*nb, mn + mx*nb) Path 9: jobu=A, jobvt=A,S mn*mn + max(3*mn + 2*mn*nb, mn + mx*nb) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any 3*mn + (mx + mn)*nb
Optimal lwork (slow algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any n/a Path 2: jobu=O, jobvt=N 3*mn + (mx + mn)*nb Path 3-9: 3*mn + max(2*mn*nb, mx*nb) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any n/a
MAGMA requires the optimal sizes above, while LAPACK has the same optimal sizes but the minimum sizes below.
LAPACK minimum lwork (fast algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any 5*mn Path 2: jobu=O, jobvt=N mn*mn + 5*mn Path 3: jobu=O, jobvt=A,S mn*mn + 5*mn Path 4: jobu=S, jobvt=N mn*mn + 5*mn Path 5: jobu=S, jobvt=O 2*mn*mn + 5*mn Path 6: jobu=S, jobvt=A,S mn*mn + 5*mn Path 7: jobu=A, jobvt=N mn*mn + max(5*mn, mn + mx) Path 8: jobu=A, jobvt=O 2*mn*mn + max(5*mn, mn + mx) Path 9: jobu=A, jobvt=A,S mn*mn + max(5*mn, mn + mx) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any max(3*mn + mx, 5*mn)
LAPACK minimum lwork (slow algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any n/a Path 2-9: max(3*mn + mx, 5*mn) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any n/a
[out]infoINTEGER
  • = 0: successful exit.
  • < 0: if INFO = -i, the i-th argument had an illegal value.
  • > 0: if SBDSQR did not converge, INFO specifies how many superdiagonals of an intermediate bidiagonal form B did not converge to zero. See the description of WORK above for details.

◆ magma_sgesvj_blocked_expert_batched()

magma_int_t magma_sgesvj_blocked_expert_batched ( magma_vec_t jobu_org,
magma_vec_t jobv_org,
magma_int_t morg,
magma_int_t norg,
float ** dA_array,
magma_int_t ldda,
float ** dS_array,
float ** dU_array,
magma_int_t lddu,
float ** dV_array,
magma_int_t lddv,
magma_int_t * dinfo_array,
magma_int_t nb,
magma_int_t max_sweeps,
magma_int_t heevj_max_sweeps,
float heevj_tol,
float heevj_tol_min,
float heevj_tol_scal,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

SGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) orthogonal matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is the internal blocked implementation of the algorithm, which provides extra arguments for expert users.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a REAL array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in]nbINTEGER The blocking size used by the algorithm. Each input matrix is subdivided into block columns of width nb each.
[in]max_sweepsINTEGER The maximum number of Jacobi sweeps.
[in]heevj_max_sweepsINTEGER The maximum number of Jacobi sweeps for the symmetric eigensolver used to orthogonalize a pair of block columns
[in]heevj_tolDOUBLE The tolerance (as multiples of the machine epsilon) for the symmetric eigensolver. This tolerance is used to control if an off-diagonal element in the Gram matrix should be annihilated during the symmetric eigen-decomposition. This tolerance can be scaled down by the user as the algorithm progresses (see heevj_tol_min, and heevj_tol_scal).
[in]heevj_tol_minDOUBLE The minimum tolerance (as multiples of the machine epsilon) for the symmetric eigensolver. The algorithm optionally scales down heevj_tol as long as it is larger than heevj_tol_min.
[in]heevj_tol_scalDOUBLE A scaling factor for heevj_tol, so that: heevj_tol[next-svd-sweep] = max( heevj_tol[current-svd-sweep] / heevj_tol_scal, heevj_tol_min)

heevj_tol_scal >= 1

Parameters
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_sgesvj_expert_batched()

magma_int_t magma_sgesvj_expert_batched ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
float ** dA_array,
magma_int_t ldda,
float ** dS_array,
float ** dU_array,
magma_int_t lddu,
float ** dV_array,
magma_int_t lddv,
magma_int_t * dinfo_array,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

SGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) orthogonal matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a REAL array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_sgesvj_expert_batched_strided()

magma_int_t magma_sgesvj_expert_batched_strided ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
magmaFloat_ptr dA,
magma_int_t ldda,
magma_int_t strideA,
magmaFloat_ptr dS,
magma_int_t strideS,
magmaFloat_ptr dU,
magma_int_t lddu,
magma_int_t strideU,
magmaFloat_ptr dV,
magma_int_t lddv,
magma_int_t strideV,
magmaInt_ptr dinfo_array,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

SGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) orthogonal matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a REAL array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[in]strideAINTEGER The stride (in elements) between two consecutive A matrices. strideA >= (LDDA*N).
[out]dSPointer to the beginning of an array of pointers whose length is (batchCount), such that S[i+1] = S[i] + strideS Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[in]strideSINTEGER The stride (in elements) between two consecutive S vectors. strideS >= MIN(M, N).
[out]dUPointer to the beginning of an array of pointers whose length is (batchCount), such that U[i+1] = U[i] + strideU Each is a REAL array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[in]strideUINTEGER The stride (in elements) between two consecutive U matrices. strideU >= (LDDU * MIN(M,N)).
[out]dVPointer to the beginning of an array of pointers whose length is (batchCount), such that V[i+1] = V[i] + strideV Each is a REAL array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first n columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[in]strideVINTEGER The stride (in elements) between two consecutive V matrices. strideU >= (LDDV * MIN(M,N)).
[out]infoINTEGER
  • = 0: successful exit.
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_sgesvj_batched()

magma_int_t magma_sgesvj_batched ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
float ** dA_array,
magma_int_t ldda,
float ** dS_array,
float ** dU_array,
magma_int_t lddu,
float ** dV_array,
magma_int_t lddv,
magma_int_t * dinfo_array,
magma_int_t batchCount,
magma_queue_t queue )

SGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) orthogonal matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is the internal blocked implementation of the algorithm, which provides extra arguments for expert users.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a REAL array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_sgesvj_batched_strided()

magma_int_t magma_sgesvj_batched_strided ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
magmaFloat_ptr dA,
magma_int_t ldda,
magma_int_t strideA,
magmaFloat_ptr dS,
magma_int_t strideS,
magmaFloat_ptr dU,
magma_int_t lddu,
magma_int_t strideU,
magmaFloat_ptr dV,
magma_int_t lddv,
magma_int_t strideV,
magmaInt_ptr dinfo_array,
magma_int_t batchCount,
magma_queue_t queue )

SGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) orthogonal matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is the internal blocked implementation of the algorithm, which provides extra arguments for expert users.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a REAL array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[in]strideAINTEGER The stride (in elements) between two consecutive A matrices. strideA >= (LDDA*N).
[out]dSPointer to the beginning of an array of pointers whose length is (batchCount), such that S[i+1] = S[i] + strideS Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[in]strideSINTEGER The stride (in elements) between two consecutive S vectors. strideS >= MIN(M, N).
[out]dUPointer to the beginning of an array of pointers whose length is (batchCount), such that U[i+1] = U[i] + strideU Each is a REAL array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[in]strideUINTEGER The stride (in elements) between two consecutive U matrices. strideU >= (LDDU * MIN(M,N)).
[out]dVPointer to the beginning of an array of pointers whose length is (batchCount), such that V[i+1] = V[i] + strideV Each is a REAL array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first n columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[in]strideVINTEGER The stride (in elements) between two consecutive V matrices. strideU >= (LDDV * MIN(M,N)).
[out]infoINTEGER
  • = 0: successful exit.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_sgesvj_qr_expert_batched()

magma_int_t magma_sgesvj_qr_expert_batched ( magma_vec_t jobu_org,
magma_vec_t jobv_org,
magma_int_t morg,
magma_int_t norg,
float ** dA_array,
magma_int_t ldda,
float ** dS_array,
float ** dU_array,
magma_int_t lddu,
float ** dV_array,
magma_int_t lddv,
magma_int_t * info_array,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

SGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A, optionally computing the left and/or right singular vectors.

The routine first computes a QR factorization of A, followed by an SVD on the R factor. Compared to a direct SVD, better performance is expected on tall-skinny matrices.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) orthogonal matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a REAL array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_zgesvd()

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 VT = V**H, not V.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaAllVec: all M columns of U are returned in array U:
  • = MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are returned in the array U;
  • = MagmaOverwriteVec: the first min(m,n) columns of U (the left singular vectors) are overwritten on the array A;
  • = MagmaNoVec: no columns of U (no left singular vectors) are computed.
[in]jobvtmagma_vec_t Specifies options for computing all or part of the matrix V**H:
  • = MagmaAllVec: all N rows of V**H are returned in the array VT;
  • = MagmaSomeVec: the first min(m,n) rows of V**H (the right singular vectors) are returned in the array VT;
  • = MagmaOverwriteVec: the first min(m,n) rows of V**H (the right singular vectors) are overwritten on the array A;
  • = MagmaNoVec: no rows of V**H (no right singular vectors) are computed.
    JOBVT and JOBU cannot both be MagmaOverwriteVec.
[in]mINTEGER The number of rows of the input matrix A. M >= 0.
[in]nINTEGER The number of columns of the input matrix A. N >= 0.
[in,out]ACOMPLEX_16 array, dimension (LDA,N) On entry, the M-by-N matrix A. On exit,
  • if JOBU = MagmaOverwriteVec, A is overwritten with the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBVT = MagmaOverwriteVec, A is overwritten with the first min(m,n) rows of V**H (the right singular vectors, stored rowwise);
  • if JOBU != MagmaOverwriteVec and JOBVT != MagmaOverwriteVec, the contents of A are destroyed.
[in]ldaINTEGER The leading dimension of the array A. LDA >= max(1,M).
[out]sDOUBLE PRECISION array, dimension (min(M,N)) The singular values of A, sorted so that S(i) >= S(i+1).
[out]UCOMPLEX_16 array, dimension (LDU,UCOL) (LDU,M) if JOBU = MagmaAllVec or (LDU,min(M,N)) if JOBU = MagmaSomeVec.
  • If JOBU = MagmaAllVec, U contains the M-by-M unitary matrix U;
  • if JOBU = MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec or MagmaOverwriteVec, U is not referenced.
[in]lduINTEGER The leading dimension of the array U. LDU >= 1; if JOBU = MagmaSomeVec or MagmaAllVec, LDU >= M.
[out]VTCOMPLEX_16 array, dimension (LDVT,N)
  • If JOBVT = MagmaAllVec, VT contains the N-by-N unitary matrix V**H;
  • if JOBVT = MagmaSomeVec, VT contains the first min(m,n) rows of V**H (the right singular vectors, stored rowwise);
  • if JOBVT = MagmaNoVec or MagmaOverwriteVec, VT is not referenced.
[in]ldvtINTEGER The leading dimension of the array VT. LDVT >= 1;
  • if JOBVT = MagmaAllVec, LDVT >= N;
  • if JOBVT = MagmaSomeVec, LDVT >= min(M,N).
[out]work(workspace) COMPLEX_16 array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK[0] returns the required LWORK.
[in]lworkINTEGER The dimension of the array WORK. 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.
Let mx = max(M,N) and mn = min(M,N). The threshold for mx >> mn is currently mx >= 1.6*mn. For job: N=None, O=Overwrite, S=Some, A=All. Paths below assume M >= N; for N > M swap jobu and jobvt.
Because of varying nb for different subroutines, formulas below are an upper bound. Querying gives an exact number. The optimal block size nb can be obtained through magma_get_dgesvd_nb(M,N). For many cases, there is a fast algorithm, and a slow algorithm that uses less workspace. Here are sizes for both cases.
Optimal lwork (fast algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any 2*mn + 2*mn*nb Path 2: jobu=O, jobvt=N mn*mn + 2*mn + 2*mn*nb or mn*mn + max(2*mn + 2*mn*nb, mx*mn) Path 3: jobu=O, jobvt=A,S mn*mn + 2*mn + 2*mn*nb or mn*mn + max(2*mn + 2*mn*nb, mx*mn) Path 4: jobu=S, jobvt=N mn*mn + 2*mn + 2*mn*nb Path 5: jobu=S, jobvt=O 2*mn*mn + 2*mn + 2*mn*nb Path 6: jobu=S, jobvt=A,S mn*mn + 2*mn + 2*mn*nb Path 7: jobu=A, jobvt=N mn*mn + max(2*mn + 2*mn*nb, mn + mx*nb) Path 8: jobu=A, jobvt=O 2*mn*mn + max(2*mn + 2*mn*nb, mn + mx*nb) Path 9: jobu=A, jobvt=A,S mn*mn + max(2*mn + 2*mn*nb, mn + mx*nb) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any 2*mn + (mx + mn)*nb
Optimal lwork (slow algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any n/a Path 2: jobu=O, jobvt=N 2*mn + (mx + mn)*nb Path 3-9: 2*mn + max(2*mn*nb, mx*nb) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any n/a
MAGMA requires the optimal sizes above, while LAPACK has the same optimal sizes but the minimum sizes below.
LAPACK minimum lwork (fast algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any 3*mn Path 2: jobu=O, jobvt=N mn*mn + 3*mn Path 3: jobu=O, jobvt=A,S mn*mn + 3*mn Path 4: jobu=S, jobvt=N mn*mn + 3*mn Path 5: jobu=S, jobvt=O 2*mn*mn + 3*mn Path 6: jobu=S, jobvt=A,S mn*mn + 3*mn Path 7: jobu=A, jobvt=N mn*mn + max(3*mn, mn + mx) Path 8: jobu=A, jobvt=O 2*mn*mn + max(3*mn, mn + mx) Path 9: jobu=A, jobvt=A,S mn*mn + max(3*mn, mn + mx) for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any 2*mn + mx
LAPACK minimum lwork (slow algorithm) for mx >> mn: Path 1: jobu=N, jobvt=any n/a Path 2-9: 2*mn + mx for mx >= mn, but not mx >> mn: Path 10: jobu=any, jobvt=any n/a
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]infoINTEGER
  • = 0: successful exit.
  • < 0: if INFO = -i, the i-th argument had an illegal value.
  • > 0: if ZBDSQR did not converge, INFO specifies how many superdiagonals of an intermediate bidiagonal form B did not converge to zero. See the description of RWORK above for details.

◆ magma_zgesvj_blocked_expert_batched()

magma_int_t magma_zgesvj_blocked_expert_batched ( magma_vec_t jobu_org,
magma_vec_t jobv_org,
magma_int_t morg,
magma_int_t norg,
magmaDoubleComplex ** dA_array,
magma_int_t ldda,
double ** dS_array,
magmaDoubleComplex ** dU_array,
magma_int_t lddu,
magmaDoubleComplex ** dV_array,
magma_int_t lddv,
magma_int_t * dinfo_array,
magma_int_t nb,
magma_int_t max_sweeps,
magma_int_t heevj_max_sweeps,
double heevj_tol,
double heevj_tol_min,
double heevj_tol_scal,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

ZGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) unitary matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is the internal blocked implementation of the algorithm, which provides extra arguments for expert users.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX_16 array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a COMPLEX_16 array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a COMPLEX_16 array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in]nbINTEGER The blocking size used by the algorithm. Each input matrix is subdivided into block columns of width nb each.
[in]max_sweepsINTEGER The maximum number of Jacobi sweeps.
[in]heevj_max_sweepsINTEGER The maximum number of Jacobi sweeps for the Hermitian eigensolver used to orthogonalize a pair of block columns
[in]heevj_tolDOUBLE The tolerance (as multiples of the machine epsilon) for the Hermitian eigensolver. This tolerance is used to control if an off-diagonal element in the Gram matrix should be annihilated during the Hermitian eigen-decomposition. This tolerance can be scaled down by the user as the algorithm progresses (see heevj_tol_min, and heevj_tol_scal).
[in]heevj_tol_minDOUBLE The minimum tolerance (as multiples of the machine epsilon) for the Hermitian eigensolver. The algorithm optionally scales down heevj_tol as long as it is larger than heevj_tol_min.
[in]heevj_tol_scalDOUBLE A scaling factor for heevj_tol, so that: heevj_tol[next-svd-sweep] = max( heevj_tol[current-svd-sweep] / heevj_tol_scal, heevj_tol_min)

heevj_tol_scal >= 1

Parameters
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_zgesvj_expert_batched()

magma_int_t magma_zgesvj_expert_batched ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
magmaDoubleComplex ** dA_array,
magma_int_t ldda,
double ** dS_array,
magmaDoubleComplex ** dU_array,
magma_int_t lddu,
magmaDoubleComplex ** dV_array,
magma_int_t lddv,
magma_int_t * dinfo_array,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

ZGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) unitary matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX_16 array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a COMPLEX_16 array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a COMPLEX_16 array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_zgesvj_expert_batched_strided()

magma_int_t magma_zgesvj_expert_batched_strided ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
magmaDoubleComplex_ptr dA,
magma_int_t ldda,
magma_int_t strideA,
magmaDouble_ptr dS,
magma_int_t strideS,
magmaDoubleComplex_ptr dU,
magma_int_t lddu,
magma_int_t strideU,
magmaDoubleComplex_ptr dV,
magma_int_t lddv,
magma_int_t strideV,
magmaInt_ptr dinfo_array,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

ZGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) unitary matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX_16 array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[in]strideAINTEGER The stride (in elements) between two consecutive A matrices. strideA >= (LDDA*N).
[out]dSPointer to the beginning of an array of pointers whose length is (batchCount), such that S[i+1] = S[i] + strideS Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[in]strideSINTEGER The stride (in elements) between two consecutive S vectors. strideS >= MIN(M, N).
[out]dUPointer to the beginning of an array of pointers whose length is (batchCount), such that U[i+1] = U[i] + strideU Each is a COMPLEX_16 array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[in]strideUINTEGER The stride (in elements) between two consecutive U matrices. strideU >= (LDDU * MIN(M,N)).
[out]dVPointer to the beginning of an array of pointers whose length is (batchCount), such that V[i+1] = V[i] + strideV Each is a COMPLEX_16 array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first n columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[in]strideVINTEGER The stride (in elements) between two consecutive V matrices. strideU >= (LDDV * MIN(M,N)).
[out]infoINTEGER
  • = 0: successful exit.
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_zgesvj_batched()

magma_int_t magma_zgesvj_batched ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
magmaDoubleComplex ** dA_array,
magma_int_t ldda,
double ** dS_array,
magmaDoubleComplex ** dU_array,
magma_int_t lddu,
magmaDoubleComplex ** dV_array,
magma_int_t lddv,
magma_int_t * dinfo_array,
magma_int_t batchCount,
magma_queue_t queue )

ZGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) unitary matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is the internal blocked implementation of the algorithm, which provides extra arguments for expert users.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX_16 array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a COMPLEX_16 array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a COMPLEX_16 array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_zgesvj_batched_strided()

magma_int_t magma_zgesvj_batched_strided ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t morg,
magma_int_t norg,
magmaDoubleComplex_ptr dA,
magma_int_t ldda,
magma_int_t strideA,
magmaDouble_ptr dS,
magma_int_t strideS,
magmaDoubleComplex_ptr dU,
magma_int_t lddu,
magma_int_t strideU,
magmaDoubleComplex_ptr dV,
magma_int_t lddv,
magma_int_t strideV,
magmaInt_ptr dinfo_array,
magma_int_t batchCount,
magma_queue_t queue )

ZGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) unitary matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is the internal blocked implementation of the algorithm, which provides extra arguments for expert users.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX_16 array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[in]strideAINTEGER The stride (in elements) between two consecutive A matrices. strideA >= (LDDA*N).
[out]dSPointer to the beginning of an array of pointers whose length is (batchCount), such that S[i+1] = S[i] + strideS Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[in]strideSINTEGER The stride (in elements) between two consecutive S vectors. strideS >= MIN(M, N).
[out]dUPointer to the beginning of an array of pointers whose length is (batchCount), such that U[i+1] = U[i] + strideU Each is a COMPLEX_16 array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[in]strideUINTEGER The stride (in elements) between two consecutive U matrices. strideU >= (LDDU * MIN(M,N)).
[out]dVPointer to the beginning of an array of pointers whose length is (batchCount), such that V[i+1] = V[i] + strideV Each is a COMPLEX_16 array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first n columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[in]strideVINTEGER The stride (in elements) between two consecutive V matrices. strideU >= (LDDV * MIN(M,N)).
[out]infoINTEGER
  • = 0: successful exit.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_zgesvj_qr_expert_batched()

magma_int_t magma_zgesvj_qr_expert_batched ( magma_vec_t jobu_org,
magma_vec_t jobv_org,
magma_int_t morg,
magma_int_t norg,
magmaDoubleComplex ** dA_array,
magma_int_t ldda,
double ** dS_array,
magmaDoubleComplex ** dU_array,
magma_int_t lddu,
magmaDoubleComplex ** dV_array,
magma_int_t lddv,
magma_int_t * info_array,
void * device_work,
int64_t * device_lwork,
magma_int_t batchCount,
magma_queue_t queue )

ZGESVJ computes the reduced singular value decomposition (SVD) of an M-by-N matrix A, optionally computing the left and/or right singular vectors.

The routine first computes a QR factorization of A, followed by an SVD on the R factor. Compared to a direct SVD, better performance is expected on tall-skinny matrices.

The SVD is written as:

 A = U * SIGMA * conjugate-transpose(V)

where: SIGMA is a min(m,n)-by-min(m,n) matrix which is zero except for its min(m,n) diagonal elements U is an M-by-min(m,n) unitary matrix, and V is an N-by-min(m,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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm.

This routines computes V, not V**H (if right vectors are required)

The one-sided Jacobi algorithm implicitly computes the left singular vectors anyway while computing the values.

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are written.
  • = MagmaNoVec: no columns of U (no left singular vectors) are written to U. However, the algorithm implicitly computes them anyway while computing the values.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaVec or MagmaSomeVec: the first min(m,n) columns of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no columns of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX_16 array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if M >= N and JOBU = MagmaVec or MagmaSomeVec, the user has the option to set dU_array = dA_array, upon which A will be overwritten with the first min(m,n) columns of U
  • Otherwise A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a COMPLEX_16 array, dimension (LDDU,N)
  • if JOBU = MagmaVec or MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
  • When M >= N, dU_array could optionally be the same as dA_array
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a COMPLEX_16 array, dimension (LDDV,N)
  • if JOBV = MagmaVec or MagmaSomeVec, V contains the first min(m,n) columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in,out]device_workWorkspace, allocated on device (GPU) memory.
[in,out]lwork_deviceINTEGER pointer The size of the workspace (device_work) in bytes
  • lwork_device[0] < 0: a workspace query is assumed, the routine calculates the required amount of workspace and returns it in lwork_device. The workspace itself is not referenced, and no computation is performed.
  • lwork_device[0] >= 0: the routine assumes that the user has provided a workspace with the size in lwork_device.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_cgesvj_batched_small_sm()

magma_int_t magma_cgesvj_batched_small_sm ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t m,
magma_int_t n,
magmaFloatComplex ** dA_array,
magma_int_t ldda,
float ** dS_array,
magmaFloatComplex ** dU_array,
magma_int_t lddu,
magmaFloatComplex ** dV_array,
magma_int_t lddv,
magma_int_t * info_array,
magma_int_t batchCount,
magma_queue_t queue )

CGESVJ computes the singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is an internal routine. Each individual matrix should fit in the shared memory of the GPU. If the right singular vectors are required, additional shared memory workspace is required.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are computed.
  • = MagmaNoVec: no columns of U (no left singular vectors) are computed.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaSomeVec: the first min(m,n) rows of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no rows of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if JOBU = MagmaSomeVec, and dA_array is the same as dU_array, A is overwritten with the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, or dA_array is different from dU_array, then A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a COMPLEX array, dimension (LDDU,N)
  • if JOBU = MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a COMPLEX array, dimension (LDDV,N)
  • if JOBV = MagmaSomeVec, V contains the first n columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_dgesvj_batched_small_sm()

magma_int_t magma_dgesvj_batched_small_sm ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t m,
magma_int_t n,
double ** dA_array,
magma_int_t ldda,
double ** dS_array,
double ** dU_array,
magma_int_t lddu,
double ** dV_array,
magma_int_t lddv,
magma_int_t * info_array,
magma_int_t batchCount,
magma_queue_t queue )

DGESVJ computes the singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is an internal routine. Each individual matrix should fit in the shared memory of the GPU. If the right singular vectors are required, additional shared memory workspace is required.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are computed.
  • = MagmaNoVec: no columns of U (no left singular vectors) are computed.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaSomeVec: the first min(m,n) rows of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no rows of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a DOUBLE PRECISION array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if JOBU = MagmaSomeVec, and dA_array is the same as dU_array, A is overwritten with the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, or dA_array is different from dU_array, then A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (LDDU,N)
  • if JOBU = MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (LDDV,N)
  • if JOBV = MagmaSomeVec, V contains the first n columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_sgesvj_batched_small_sm()

magma_int_t magma_sgesvj_batched_small_sm ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t m,
magma_int_t n,
float ** dA_array,
magma_int_t ldda,
float ** dS_array,
float ** dU_array,
magma_int_t lddu,
float ** dV_array,
magma_int_t lddv,
magma_int_t * info_array,
magma_int_t batchCount,
magma_queue_t queue )

SGESVJ computes the singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is an internal routine. Each individual matrix should fit in the shared memory of the GPU. If the right singular vectors are required, additional shared memory workspace is required.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are computed.
  • = MagmaNoVec: no columns of U (no left singular vectors) are computed.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaSomeVec: the first min(m,n) rows of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no rows of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a REAL array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if JOBU = MagmaSomeVec, and dA_array is the same as dU_array, A is overwritten with the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, or dA_array is different from dU_array, then A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (LDDU,N)
  • if JOBU = MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a REAL array, dimension (LDDV,N)
  • if JOBV = MagmaSomeVec, V contains the first n columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.

◆ magma_zgesvj_batched_small_sm()

magma_int_t magma_zgesvj_batched_small_sm ( magma_vec_t jobu,
magma_vec_t jobv,
magma_int_t m,
magma_int_t n,
magmaDoubleComplex ** dA_array,
magma_int_t ldda,
double ** dS_array,
magmaDoubleComplex ** dU_array,
magma_int_t lddu,
magmaDoubleComplex ** dV_array,
magma_int_t lddv,
magma_int_t * info_array,
magma_int_t batchCount,
magma_queue_t queue )

ZGESVJ computes the singular value decomposition (SVD) of an M-by-N matrix A , optionally computing the left and/or right singular vectors.

The SVD is written as:

 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.

NOTES:

This routines computes only the economy size SVD based on the one-sided Jacobi algorithm

This is the batch version of the routine, which performs the SVD on a batch of matrices having the same dimensions.

This is an internal routine. Each individual matrix should fit in the shared memory of the GPU. If the right singular vectors are required, additional shared memory workspace is required.

Parameters
[in]jobumagma_vec_t Specifies options for computing all or part of the matrix U:
  • = MagmaSomeVec: the first min(m,n) columns of U (the left singular vectors) are computed.
  • = MagmaNoVec: no columns of U (no left singular vectors) are computed.
[in]jobvmagma_vec_t Specifies options for computing the matrix V:
  • = MagmaSomeVec: the first min(m,n) rows of V (the right singular vectors) are returned in the array V;
  • = MagmaNoVec: no rows of V (no right singular vectors) are computed.
[in]mINTEGER The number of rows of each input matrix A. M >= 0.
[in]nINTEGER The number of columns of each input matrix A. N >= 0.
[in,out]dA_arrayArray of pointers, length (batchCount). Each is a COMPLEX_16 array, dimension (LDDA,N) On entry, the M-by-N matrix A. On exit,
  • if JOBU = MagmaSomeVec, and dA_array is the same as dU_array, A is overwritten with the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, or dA_array is different from dU_array, then A is unchanged on exit
[in]lddaINTEGER The leading dimension of each array A. LDA >= max(1,M).
[out]dS_arrayArray of pointers, length (batchCount) Each is a DOUBLE PRECISION array, dimension (min(M,N)) The singular values of each matrix A, sorted so that S(i) >= S(i+1).
[out]dU_arrayArray of pointers, length (batchCount) Each is a COMPLEX_16 array, dimension (LDDU,N)
  • if JOBU = MagmaSomeVec, U contains the first min(m,n) columns of U (the left singular vectors, stored columnwise);
  • if JOBU = MagmaNoVec, U is not referenced.
[in]ldduINTEGER The leading dimension of each array U. lddu >= max(1,M);
[out]dV_arrayArray of pointers, length (batchCount) Each is a COMPLEX_16 array, dimension (LDDV,N)
  • if JOBV = MagmaSomeVec, V contains the first n columns of V (the right singular vectors, stored columnwise);
  • if JOBV = MagmaNoVec, V is not referenced.
[in]lddvINTEGER The leading dimension of each array V. lddv >= max(1,N);
[out]infoINTEGER
  • = 0: successful exit.
[in]batchCountINTEGER The number of matrices to operate on.
[in]queuemagma_queue_t Queue to execute in.