pub unsafe extern "C" fn cusolverDnSsygvd(
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,
) -> cusolverStatus_tExpand 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}
$$
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 sygvd_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 devInfo = i (i > 0 and i<=n) and jobz = cusolverEigMode_t::CUSOLVER_EIG_MODE_NOVECTOR, i off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If devInfo = N + i (i > 0), then the leading minor of order i of B is not positive definite. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed.
if jobz = cusolverEigMode_t::CUSOLVER_EIG_MODE_VECTOR, A contains the orthogonal eigenvectors of the matrix A. The eigenvectors are computed by divide and conquer algorithm.
Please visit cuSOLVER Library Samples - sygvd for a code example.