Skip to main content

cusolverDnSsygvj

Function cusolverDnSsygvj 

Source
pub unsafe extern "C" fn cusolverDnSsygvj(
    handle: cusolverDnHandle_t,
    itype: cusolverEigType_t,
    jobz: cusolverEigMode_t,
    uplo: cublasFillMode_t,
    n: c_int,
    A: *mut f32,
    lda: c_int,
    B: *mut f32,
    ldb: c_int,
    W: *mut f32,
    work: *mut f32,
    lwork: c_int,
    info: *mut c_int,
    params: syevjInfo_t,
) -> 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 eigenvalues and eigenvectors of a symmetric (Hermitian) $n \times n$ matrix-pair (A,B). The generalized symmetric-definite eigenvalue problem is: $$ \operatorname{eig}(A,B) = \begin{cases} A * V = B * V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1} \ A * B * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_2} \ B * A * V = V * \Lambda & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3} \end{cases} $$

where the matrix B is positive definite. Λ is a real $n \times n$ diagonal matrix. The diagonal elements of Λ are the eigenvalues of (A, B) in ascending order. V is an $n \times n$ orthogonal matrix. The eigenvectors are normalized as follows: $$ \begin{cases} V^H * B * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_1 or CUSOLVER_EIG_TYPE_2} \ V^H * \operatorname{inv}(B) * V = I & \text{if } itype = \text{CUSOLVER_EIG_TYPE_3} \end{cases} $$

This function has the same functionality as sygvd except that syevd in sygvd is replaced by syevj in sygvj. Therefore, sygvj inherits properties of syevj, the user can use cusolverDnXsyevjSetTolerance and cusolverDnXsyevjSetMaxSweeps to configure tolerance and maximum sweeps.

However the meaning of residual is different from syevj. sygvj first computes Cholesky factorization of matrix B, $$ B = L\*L^{H} $$

transform the problem to standard eigenvalue problem, then calls syevj.

For example, the standard eigenvalue problem of type I is: $$ M\Q = Q\\Lambda $$

where matrix M is symmetric: $$ M = L^{-1}\*A\*L^{-H} $$

The residual is the result of syevj on matrix M, not A.

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

If output parameter info = -i (less than zero), the i-th parameter is wrong (not counting handle). If info = i (i > 0 and i<=n), B is not positive definite, the factorization of B could not be completed and no eigenvalues or eigenvectors were computed. If info = n+1, syevj does not converge under given tolerance and maximum sweeps. In this case, the eigenvalues and eigenvectors are still computed because non-convergence comes from improper tolerance of maximum sweeps.

if jobz = cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR, A contains the orthogonal eigenvectors V.

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