Generalized Eigenvalue Solver for Symmetric or Hermitian Matrix#
HEGV (symmetric or HErmitian Generalized eigenValue solver) computes the eigenvalues and, optionally, eigenvectors of a batched symmetric or Hermitian-definite generalized eigenvalue problem:
where:
\(A\) is an \(M \times M\) symmetric or Hermitian matrix,
\(B\) is an \(M \times M\) symmetric or Hermitian positive-definite matrix,
\(\Lambda\) is an \(M \times M\) diagonal matrix containing the eigenvalues, and
\(V\) is an \(M \times M\) matrix whose columns are the eigenvectors. For Eig type 1 and 2, the eigenvectors are \(B\)-orthogonal; for Eig type 3, they are \(B^{-1}\)-orthogonal.
Device API#
The cuSolverDx hegv device functions are as follows (see Execution Methods):
// Compute eigenvalues, and optionally the eigenvectors
__device__ void execute(data_type* A, data_type* B, precision_of_data_type* lambda, data_type* workspace, status_type* info);
// Compute eigenvalues, and optionally the eigenvectors with runtime leading dimensions
__device__ void execute(data_type* A, data_type* B, const unsigned int ldb, precision_of_data_type* lambda, data_type* workspace, status_type* info);
__device__ void execute(data_type* A, const unsigned int lda, data_type* B, precision_of_data_type* lambda, data_type* workspace, status_type* info);
__device__ void execute(data_type* A, const unsigned int lda, data_type* B, const unsigned int ldb, precision_of_data_type* lambda, data_type* workspace, status_type* info);
Note that eigenvalues of a symmetric or Hermitian matrix are always real values, which is the reason why in the hegv functions lambda is of precision_of_data_type* instead of data_type*.
Parameters:
A: Batched \(M \times M\) Hermitian matrix, with leading dimension \(\mathrm{lda} \geq M\).
On entry, the matrix data in the triangle selected by the FillMode operator is the stored triangular part of \(A\).
On exit:
if the
joboperator isjob::overwrite_vectors,Acontains the eigenvectors \(V\) of the generalized problem. The columns of \(V\) are \(B\)-orthogonal when EigType is 1 or 2 (\(V^H B V = I\)), and \(B^{-1}\)-orthogonal when EigType is 3 (\(V^H B^{-1} V = I\)).If only eigenvalues are requested, i.e.,
job::no_vectors, the processed triangle ofA, including the diagonal, is destroyed and the other triangle is unchanged.
B: Batched \(M \times M\) symmetric or Hermitian positive-definite matrix, with leading dimension \(\mathrm{ldb} \geq M\).On entry, the same fill mode as
Amust be applied toB.On exit, the triangle of
Bcontaining the matrix is overwritten by the triangular factor \(U\) or \(L\) from the Cholesky factorization \(B = U^H U\) or \(B = L L^H\).
lambda: Array of size \(M\) per batch containing the eigenvalues.workspace: Temporary buffer preallocated by the user. The required size can be obtained via workspace_size. Note that depending on the size and configuration of the problem, the workspace size could be zero. Use a nullptr if the required workspace size is zero.info: Status of the function for each batch.info = 0if the function succeeds for the batch.If
info = i > 0and \(i \leq M\), then the standard eigensolve failed to find all of the eigenvalues, andioff-diagonal elements of the intermediate tridiagonal matrix have not converged to zero.If Cholesky factorization of
Bfails,info = M + iwhereiis the index of the leading principal minor ofBthat is not positive definite. The factorization ofBis not completed and no eigenvalues or eigenvectors are computed.
Supported Configurations#
Arrangement: Layouts of
AandBcan independently use column-major or row-major layouts using theArrangement<Arr, Brr>operator (see Arrangement operator).Leading Dimensions: Leading dimensions for A and B can be set independently using the
LeadingDimension<LDA, LDB>operator (see LeadingDimension operator).Fill mode:
AandBhave to be the same FillMode (lowerorupper). The operator is required to be defined forhegv.EigType: \(\mathrm{EigType} \in \{1,2,3\}\), as described above (see EigType Operator).
Job:
jobbeing eitherjob::no_vectors, orjob::overwrite_vectors, see Job operator.job::all_vectors,job::some_vectors, andjob::multiply_vectorsare not allowed for thehegvfunction; doing that will result in a compile-time error.