XLPack 7.0
XLPack Numerical Library (C API) Reference Manual
Loading...
Searching...
No Matches

◆ zhegv()

void zhegv ( int  itype,
char  jobz,
char  uplo,
int  n,
int  lda,
doublecomplex  a[],
int  ldb,
doublecomplex  b[],
double  w[],
doublecomplex  work[],
int  lwork,
double  rwork[],
int *  info 
)

(Simple driver) Generalized eigenvalue problem of Hermitian matrices

Purpose
This routine computes all the eigenvalues, and optionally, the eigenvectors of a complex generalized Hermitian-definite eigenproblem, of the form
A*x = lambda*B*x, A*B*x = lambda*x, or B*A*x = lambda*x.
Here A and B are assumed to be Hermitian and B is also positive definite.
Parameters
[in]itypeSpecifies the problem type to be solved:
= 1: A*x = lambda*B*x.
= 2: A*B*x = lambda*x.
= 3: B*A*x = lambda*x.
[in]jobz= 'N': Compute eigenvalues only.
= 'V': Compute eigenvalues and eigenvectors.
[in]uplo= 'U': Upper triangles of A and B are stored.
= 'L': Lower triangles of A and B are stored.
[in]nOrder of the matrices A and B. (n >= 0) (If n = 0, returns without computation)
[in]ldaLeading dimension of the two dimensional array a[][]. (lda >= max(1, n))
[in,out]a[][]Array a[la][lda] (la >= n)
[in] The Hermitian matrix A. If uplo = 'U', the leading n x n upper triangular part of a[][] contains the upper triangular part of the matrix A. If uplo = 'L', the leading n x n lower triangular part of a[][] contains the lower triangular part of the matrix A.
[out] jobz = 'V': If info = 0, a[][] contains the matrix Z of eigenvectors. The eigenvectors are normalized as follows:
    itype = 1 or 2: Z^H*B*Z = I
    itype = 3: Z^H*inv(B)*Z = I
  jobz = 'N': The upper triangle (if uplo = 'U') or the lower triangle (if uplo = 'L') of a[][], including the diagonal, is destroyed.
[in]ldbLeading dimension of the two dimensional array b[][]. (ldb >= max(1, n))
[in,out]b[][]Array b[lb][ldb] (lb >= n)
[in] The Hermitian positive definite matrix B. If uplo = 'U', the leading n x n upper triangular part of b[][] contains the upper triangular part of the matrix B. If uplo = 'L', the leading n x n lower triangular part of b[][] contains the lower triangular part of the matrix B.
[out] If info <= n, the part of b[][] containing the matrix is overwritten by the triangular factor U or L from the Cholesky factorization B = U^H*U or B = L*L^H.
[out]w[]Array w[lw] (lw >= n)
If info = 0, the eigenvalues in ascending order.
[out]work[]Array work[lwork]
Work array
On exit, if info = 0, work[0] returns the optimal lwork.
[in]lworkThe length of work[]. (lwork >= max(1, 2*n-1))
For optimal efficiency, lwork >= (nb + 1)*n, where nb is the optimal blocksize.
If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[] array, and returns the value in work[0].
[out]rwork[]Array rwork[lrwork] (lrwork >= max(1, 3*n-2))
Work array.
[out]info= 0: Successful exit
= -1: The argument itype had an illegal value (itype < 1 or itype > 3)
= -2: The argument jobz had an illegal value (jobz != 'V' nor 'N')
= -3: The argument uplo had an illegal value (uplo != 'U' nor 'L')
= -4: The argument n had an illegal value (n < 0)
= -5: The argument lda had an illegal value (lda < max(1, n))
= -7: The argument ldb had an illegal value (ldb < max(1, n))
= -11: The argument lwork had an illegal value (lwork too small)
= i (0 < i <= n): zheev failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero.
= i (i > n): The leading minor of order i-n of B is not positive definite. The factorization of B could not be completed and no eigenvalues or eigenvectors were computed
Reference
LAPACK