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

◆ zhegvd()

void zhegvd ( 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  lrwork,
int  iwork[],
int  liwork,
int *  info 
)

(Divide and conquer 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.
If eigenvectors are desired, it uses a divide and conquer algorithm.
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]
Complex work array
On exit, if info = 0, work[0] returns the optimal lwork.
[in]lworkThe size of work[]. (lwork >= 1 (if n <= 1), n + 1 (if jobz = 'N'), n^2 + 2*n (if jobz = 'V'))
If lwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[], rwork[] and iwork[] arrays, and returns these values in work[0], rwork[0] and iwork[0].
[out]rwork[]Array rwork[lrwork]
Work array.
On exit, if info = 0, rwork[0] returns the optimal lwork.
[in]lrworkThe size of rwork[]. (lrwork >= 1 (if n <= 1), n (if jobz = 'N'), 2*n^2 + 5*n + 1 (if jobz = 'V'))
If lrwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[], rwork[] and iwork[] arrays, and returns these values in work[0], rwork[0] and iwork[0].
[out]iwork[]Array iwork[liwork]
Integer work array.
On exit, if info = 0, iwork[0] returns the optimal liwork.
[in]liworkThe size of iwork[]. (liwork >= 1 (if n <= 1), 1 (if jobz = 'N'), 5*n + 3 (if jobz = 'V'))
If liwork = -1, then a workspace query is assumed. The routine only calculates the optimal size of the work[], rwork[] and iwork[] arrays, and returns these values in work[0], rwork[0] and iwork[0].
[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)
= -13: The argument lrwork had an illegal value (lrwork too small)
= -15: The argument liwork had an illegal value (liwork too small)
= i (0 < i <= n): If jobz = 'N', then the algorithm failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero. If jobz = 'V', then the algorithm failed to compute an eigenvalue while working on the submatrix lying in rows and columns i/(n + 1) through mod(i, n + 1).
= 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