Skip to main content

cusolverDnDgesvd

Function cusolverDnDgesvd 

Source
pub unsafe extern "C" fn cusolverDnDgesvd(
    handle: cusolverDnHandle_t,
    jobu: c_schar,
    jobvt: c_schar,
    m: c_int,
    n: c_int,
    A: *mut f64,
    lda: c_int,
    S: *mut f64,
    U: *mut f64,
    ldu: c_int,
    VT: *mut f64,
    ldvt: c_int,
    work: *mut f64,
    lwork: c_int,
    rwork: *mut f64,
    info: *mut c_int,
) -> cusolverStatus_t
Expand description

The helper functions below can calculate the sizes needed for pre-allocated buffer.

The S and D data types are real valued single and double precision, respectively.

The C and Z data types are complex valued single and double precision, respectively.

This function computes the singular value decomposition (SVD) of an $m \times n$ matrix A and corresponding the left and/or right singular vectors. The SVD is written: $$ A = U\*\Sigma\*V^{H} $$

where $\Sigma$ is an $m \times n$ matrix which is zero except for its min(m,n) diagonal elements, U is an $m \times m$ unitary matrix, and V is an $n \times 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.

The user has to provide working space which is pointed by input parameter work. The input parameter lwork is size of the working space, and it is returned by gesvd_bufferSize(). Please note that the size in bytes of the working space is equal to sizeof(<type>) * lwork.

If output parameter devInfo = -i (less than zero), the i-th parameter is wrong (not counting handle). if bdsqr did not converge, devInfo specifies how many superdiagonals of an intermediate bidiagonal form did not converge to zero.

The rwork is real array of dimension (min(m,n)-1). If devInfo>0 and rwork is not NULL, rwork contains the unconverged superdiagonal elements of an upper bidiagonal matrix. This is slightly different from LAPACK which puts unconverged superdiagonal elements in work if type is real; in rwork if type is complex. rwork can be a NULL pointer if the user does not want the information from superdiagonal.

Please visit cuSOLVER Library Samples - gesvd for a code example.

Remark 1: gesvd only supports m>=n.

Remark 2: the routine returns $V^{H}$, not V.