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

◆ zhpevx()

void zhpevx ( char  jobz,
char  range,
char  uplo,
int  n,
doublecomplex  ap[],
double  vl,
double  vu,
int  il,
int  iu,
double  abstol,
int *  m,
double  w[],
int  ldz,
doublecomplex  z[],
doublecomplex  work[],
double  rwork[],
int  iwork[],
int  ifail[],
int *  info 
)

(Expert driver) Eigenvalues and eigenvectors of a Hermitian matrix in packed form

Purpose
This routine computes all or selected eigenvalues and, optionally, eigenvectors of a Hermitian matrix A in packed storage. Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues.
If all eigenvalues and eigenvectors are desired, it uses a QL or QR method. If selected eigenvalues and eigenvectors are desired, it uses a bisection and inverse iteration method.
Parameters
[in]jobz= 'N': Compute eigenvalues only.
= 'V': Compute eigenvalues and eigenvectors.
[in]range= 'A': All eigenvalues will be found.
= 'V': All eigenvalues in the half-open interval (vl, vu] will be found.
= 'I': The il-th through iu-th eigenvalues will be found.
[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,out]ap[]Array ap[lap] (lap >= n(n + 1)/2)
[in] The upper or lower triangle of the Hermitian matrix A, packed columnwise in a linear array. The j-th column of A is stored in the array ap as follows.
uplo = 'U': ap[i + j*(j + 1)/2] = A(i, j) for 0 <= i <= j <= n - 1.
uplo = 'L': ap[(i + j*(2*n - j - 1)/2] = A(i, j) for 0 <= j < = i <= n - 1.
[out] ap[] is overwritten by values generated during the reduction to tridiagonal form. If uplo = 'U', the diagonal and first superdiagonal of the tridiagonal matrix T overwrite the corresponding elements of A. If uplo = 'L', the diagonal and first subdiagonal of T overwrite the corresponding elements of A.
[in]vlrange = 'V': The lower bound of the interval to be searched for eigenvalues. (vl < vu)
range = 'A' or 'I': Not referenced.
[in]vurange = 'V': The upper bound of the interval to be searched for eigenvalues. (vl < vu)
range = 'A' or 'I': Not referenced.
[in]ilrange = 'I': The index of the smallest eigenvalue to be returned. (1 <= il <= iu <= n, if n > 0; il = 1 and iu = 0 if n = 0)
range = 'A' or 'V': Not referenced.
[in]iurange = 'I': The index of the largest eigenvalues to be returned. (1 <= il <= iu <= n, if n > 0; il = 1 and iu = 0 if n = 0)
range = 'A' or 'V': Not referenced.
[in]abstolThe absolute error tolerance for the eigenvalues.
An approximate eigenvalue is accepted as converged when it is determined to lie in an interval [a, b] of width less than or equal to abstol + eps * max(|a|, |b|), where eps is the machine precision. If abstol is less than or equal to zero, then eps*|T| will be used in its place, where |T| is the 1-norm of the tridiagonal matrix obtained by reducing A to tridiagonal form.
Eigenvalues will be computed most accurately when abstol is set to twice the underflow threshold 2*dlamch('S'), not zero. If this routine returns with info > 0, indicating that some eigenvectors did not converge, try setting abstol to 2*dlamch('S').
See "Computing Small Singular Values of Bidiagonal Matrices with Guaranteed High Relative Accuracy," by Demmel and Kahan, LAPACK Working Note #3.
[out]mThe total number of eigenvalues found. (0 <= m <= n)
If range = 'A', m = n, and if range = 'I', m = iu - il + 1.
[out]w[]Array w[lw] (lw >= n)
If info = 0, the selected eigenvalues in ascending order.
[in]ldzLeading dimension of the two dimensional array z[][]. (ldz >= 1 if jobz = 'N', ldz >= max(1, n) if jobz = 'V')
[out]z[][]Array z[lz][ldz] (lz >= max(1, m))
jobz = 'V': If info = 0, the first m rows of z[][] contain the orthonormal eigenvectors of the matrix A corresponding to the selected eigenvalues, with the i-th row of z[][] holding the eigenvector associated with w[i]. If an eigenvector fails to converge, then that row of z[][] contains the latest approximation to the eigenvector, and the index of the eigenvector is returned in ifail[].
jobz = 'N': z[][] is not referenced.
Note: The user must ensure that at least max(1, m) rows are supplied in the array z[][]; if range = 'V', the exact value of m is not known in advance and an upper bound must be used.
[out]work[]Array work[lwork] (lwork >= 2*n)
Work array.
[out]rwork[]Array rwork[lrwork] (lrwork >= 7*n)
Work array.
[out]iwork[]Array iwork[liwork] (liwork >= 5*n)
Work array.
[out]ifail[]Array ifail[lifail] (lifail >= n)
jobz = 'V': If info = 0, the first m elements of ifail[] are zero. If info > 0, then ifail[] contains the indices of the eigenvectors that failed to converge.
jobz = 'N': ifail[] is not referenced.
[out]info= 0: Successful exit
= -1: The argument jobz had an illegal value (jobz != 'V' nor 'N')
= -2: The argument range had an illegal value (range != 'A', 'V' nor 'I')
= -3: The argument uplo had an illegal value (uplo != 'U' nor 'L')
= -4: The argument n had an illegal value (n < 0)
= -7: The argument vu had an illegal value (vu <= vl)
= -8: The argument il had an illegal value (il < 1 or il > n)
= -9: The argument iu had an illegal value (iu < min(n, il) or iu > n)
= -13: The argument ldz had an illegal value (ldz too small)
= i > 0: i eigenvectors failed to converge. Their indices are stored in array ifail[].
Reference
LAPACK