Developer Reference for Intel® oneAPI Math Kernel Library for C
?heevr
Computes selected eigenvalues and, optionally, eigenvectors of a Hermitian matrix using the Relatively Robust Representations.
Syntax
lapack_int LAPACKE_cheevr ( intmatrix_layout , charjobz , charrange , charuplo , lapack_intn , lapack_complex_float*a , lapack_intlda , floatvl , floatvu , lapack_intil , lapack_intiu , floatabstol , lapack_int*m , float*w , lapack_complex_float*z , lapack_intldz , lapack_int*isuppz );
lapack_int LAPACKE_zheevr ( intmatrix_layout , charjobz , charrange , charuplo , lapack_intn , lapack_complex_double*a , lapack_intlda , doublevl , doublevu , lapack_intil , lapack_intiu , doubleabstol , lapack_int*m , double*w , lapack_complex_double*z , lapack_intldz , lapack_int*isuppz );
Include Files
mkl.h
Description
cheevr zheevr heevr
The routine computes selected eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A . Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues.
The routine first reduces the matrix A to tridiagonal form T with a call to hetrd . Then, whenever possible, ?heevr calls stegr to compute the eigenspectrum using Relatively Robust Representations. ?stegr computes eigenvalues by the dqds algorithm, while orthogonal eigenvectors are computed from various “good” L*D*L:code:`T` representations (also known as Relatively Robust Representations). Gram-Schmidt orthogonalization is avoided as far as possible. More specifically, the various steps of the algorithm are as follows. For each unreduced block (submatrix) of T :
Compute T - σ*I = L*D*L^{T} , so that L and D define all the wanted eigenvalues to high relative accuracy. This means that small relative changes in the entries of D and L cause only small relative changes in the eigenvalues and eigenvectors. The standard (unfactored) representation of the tridiagonal matrix T does not have this property in general.
Compute the eigenvalues to suitable accuracy. If the eigenvectors are desired, the algorithm attains full accuracy of the computed eigenvalues only right before the corresponding vectors have to be computed, see Steps c) and d).
For each cluster of close eigenvalues, select a new shift close to the cluster, find a new factorization, and refine the shifted eigenvalues to suitable accuracy.
For each eigenvalue with a large enough relative separation, compute the corresponding eigenvector by forming a rank revealing twisted factorization. Go back to Step c) for any clusters that remain.
The desired accuracy of the output can be specified by the input parameter abstol .
The routine ?heevr calls stemr when the full spectrum is requested on machines which conform to the IEEE-754 floating point standard, or stebz and stein on non-IEEE machines and when partial spectrum requests are made.
Note that the routine ?heevr is preferable for most cases of complex Hermitian eigenvalue problems as its underlying algorithm is fast and uses less workspace.
Input Parameters
- matrix_layout
-
Specifies whether matrix storage layout is row major ( LAPACK_ROW_MAJOR ) or column major ( LAPACK_COL_MAJOR ).
jobz
Must be ‘N’ or ‘V’ .
If job = 'N' , then only eigenvalues are computed. If job = 'V' , then eigenvalues and eigenvectors are computed.
range
Must be ‘A’ or ‘V’ or ‘I’ .
If range = 'A' , the routine computes all eigenvalues. If range = 'V' , the routine computes eigenvalues lambda(i) in the half-open interval: vl< lambda(i)≤vu . If range = 'I' , the routine computes eigenvalues with indices il to iu . For range = 'V' or ‘I’ , sstebz / dstebz and cstein / zstein are called.
uplo
Must be ‘U’ or ‘L’ .
If uplo = 'U' , a stores the upper triangular part of A . If uplo = 'L' , a stores the lower triangular part of A .
n
The order of the matrix A ( n≥ 0 ).
- a , work
-
COMPLEX for cheevr DOUBLE COMPLEX for zheevr . Arrays:
a (size max(1, lda * n )) is an array containing either upper or lower triangular part of the Hermitian matrix A , as specified by uplo .
The second dimension of a must be at least max(1, n ). work is a workspace array, its dimension max(1, lwork) .
lda
The leading dimension of the array a .
Must be at least max(1, n ).
- vl , vu
-
REAL for cheevr DOUBLE PRECISION for zheevr . If range = 'V' , the lower and upper bounds of the interval to be searched for eigenvalues. Constraint: vl< vu . If range = 'A' or ‘I’ , vl and vu are not referenced.
il , iu
If range = 'I' , the indices in ascending order of the smallest and largest eigenvalues to be returned. Constraint: 1 ≤il≤iu≤n , if n > 0 ; il=1 and iu=0 if n = 0 . If range = 'A' or ‘V’ , il and iu are not referenced.
- abstol
-
REAL for cheevr DOUBLE PRECISION for zheevr . The absolute error tolerance to which each eigenvalue/eigenvector is required. If jobz = 'V' , the eigenvalues and eigenvectors output have residual norms bounded by abstol , and the dot products between different eigenvectors are bounded by abstol . If abstol < n *eps*||T|| , then n *eps*||T|| is used instead, where eps is the machine precision, and ||T|| is the 1-norm of the matrix T . The eigenvalues are computed to an accuracy of eps*||T|| irrespective of abstol . If high relative accuracy is important, set abstol to ?lamch (‘S’).
ldz
The leading dimension of the output array z . Constraints:
ldz≥ 1 if jobz = 'N' ;
ldz≥ max(1, n) for column major layout and ldz ≥ max(1, m ) for row major layout if jobz = 'V' .
lwork
The dimension of the array work . Constraint: lwork≥ max(1, 2n) . If lwork = -1 , then a workspace query is assumed; the routine only calculates the optimal size of the work , rwork and iwork arrays, returns these values as the first entries of the work , rwork and iwork arrays, and no error message related to lwork or lrwork or liwork is issued by xerbla . See Application Notes for the suggested value of lwork .
- rwork
-
REAL for cheevr DOUBLE PRECISION for zheevr . Workspace array, size max(1, lwork) .
lrwork
The dimension of the array rwork ; lwork≥ max(1, 24n) . If lrwork = -1 , then a workspace query is assumed; the routine only calculates the optimal size of the work , rwork and iwork arrays, returns these values as the first entries of the work , rwork and iwork arrays, and no error message related to lwork or lrwork or liwork is issued by xerbla .
- iwork
-
INTEGER . Workspace array, its dimension max(1, liwork) .
liwork
The dimension of the array iwork , lwork≥ max(1, 10n) . If liwork = -1 , then a workspace query is assumed; the routine only calculates the optimal size of the work , rwork and iwork arrays, returns these values as the first entries of the work , rwork and iwork arrays, and no error message related to lwork or lrwork or liwork is issued by xerbla .
Output Parameters
- a
-
On exit, the lower triangle (if uplo = 'L' ) or the upper triangle (if uplo = 'U' ) of A , including the diagonal, is overwritten.
m
The total number of eigenvalues found,
0 ≤m≤n . If range = 'A' , m = n , if range = 'I' , m = iu-il+1 , and if range = 'V' the exact value of m is not known in advance.
- w
-
REAL for cheevr DOUBLE PRECISION for zheevr . Array, size at least max(1, n ), contains the selected eigenvalues in ascending order, stored in w(1)w[0] to w(m)w[m - 1] .
- z
-
COMPLEX for cheevr DOUBLE COMPLEX for zheevr .
Array z (size max(1, ldz * m ) for column major layout and max(1, ldz * n ) for row major layout) .
If jobz = 'V' , then if info = 0 , the first m columns of z contain the orthonormal eigenvectors of the matrix A corresponding to the selected eigenvalues, with the i -th column of z holding the eigenvector associated with w(i)w[i - 1] . If jobz = 'N' , then z is not referenced. Note: you must ensure that at least max(1, m ) columns 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.
isuppz
Array, size at least 2 *max(1, m ). The support of the eigenvectors in z , i.e., the indices indicating the nonzero elements in z . The i -th eigenvector is nonzero only in elements isuppz( 2i-1)isuppz[2i - 2] through isuppz( 2i )isuppz[2i - 1] . Referenced only if eigenvectors are needed ( jobz = 'V' ) and all eigenvalues are needed, that is, range = 'A' or range = 'I' and il = 1 and iu = n .
- work(1)
-
On exit, if info = 0 , then work(1) returns the required minimal size of lwork .
- rwork(1)
-
On exit, if info = 0 , then rwork(1) returns the required minimal size of lrwork .
- iwork(1)
-
On exit, if info = 0 , then iwork(1) returns the required minimal size of liwork .
Return Values
This function returns a value info .
If info=0 , the execution is successful.
If info = -i , the i -th parameter had an illegal value.
If info = i , an internal error has occurred.
LAPACK 95 Interface Notes
There exist FORTRAN 77 and FORTRAN 95 interfaces for this routine. See the Intel® oneMKL Fortran Developer Reference for details.
Application Notes
Normal execution of ?stemr may create NaN s and infinities and hence may abort due to a floating point exception in environments which do not handle NaN s and infinities in the IEEE standard default manner.
For more details, see ?stemr (Computes selected eigenvalues and eigenvectors of a real symmetric tridiagonal matrix.) and these references:
Inderjit S. Dhillon and Beresford N. Parlett: “Multiple representations to compute orthogonal eigenvectors of symmetric tridiagonal matrices,” Linear Algebra and its Applications, 387(1), pp. 1-28, August 2004.
Inderjit Dhillon and Beresford Parlett: “Orthogonal Eigenvectors and Relative Gaps,” SIAM Journal on Matrix Analysis and Applications, Vol. 25, 2004. Also LAPACK Working Note 154.
Inderjit Dhillon: “A new O(n^2) algorithm for the symmetric tridiagonal eigenvalue/eigenvector problem”, Computer Science Division Technical Report No. UCB/CSD-97-971, UC Berkeley, May 1997.