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

◆ zheev()

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

(Simple driver) Eigenvalues and eigenvectors of a Hermitian matrix

Purpose
This routine computes all eigenvalues and, optionally, eigenvectors of a Hermitian matrix A. Eigenvalues and eigenvectors are computed by QL or QR method.
Parameters
[in]jobz= 'N': Compute eigenvalues only.
= 'V': Compute eigenvalues and eigenvectors.
[in]uplo= 'U': Upper triangle of A is stored.
= 'L': Lower triangle of A is stored.
[in]nOrder of the matrix A. (n >= 0) (If n = 0, returns without computation)
[in]ldaThe leading dimension of the 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 orthonormal eigenvectors of the matrix A.
  jobz = 'N': The lower triangle (if uplo = 'L') or the upper triangle (if uplo = 'U') of a[][], including the diagonal, is destroyed.

[in] n x n Hermitian matrix A. The upper or lower triangular part is to be stored in accordance with uplo.
[out] jobz = 'V': If info = 0, a[][] contains the orthonormal eigenvectors of the matrix A.
  jobz = 'N': The lower triangle (if uplo = 'L') or the upper triangle (if uplo = 'U') of a[][], including the diagonal, is destroyed.

Parameters
[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 size 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 jobz had an illegal value (jobz != 'V' nor 'N')
= -2: The argument uplo had an illegal value (uplo != 'U' nor 'L')
= -3: The argument n had an illegal value (n < 0)
= -4: The argument lda had an illegal value (lda < max(1, n))
= -8: The argument lwork had an illegal value (lwork too small)
= i > 0: The algorithm failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero
Reference
LAPACK