complex16OTHEReigen(3)
π complex16OTHEReigen(3) β the LAPACK complex16 "Other Eigenvalue" saga π
okay so bestie, welcome to complex16OTHEReigen, a LAPACK manual page that's literally the group chat for every complex16 routine that does eigenvalues but isn't a standard ?ev / ?evd / ?evr situation. it's giving "the other ones" and honestly? iconic. no cap, there's a LOT here β so buckle up, we're going routine by routine, and I'm keeping every single detail because that's the whole vibe. π«Ά
πΈ NAME πΈ
complex16OTHEReigen β complex16 Other Eigenvalue routines β¨
β¨ SYNOPSIS β¨
π Functions π
here's the whole cast, bestie. every single one of these is a subroutine, and every signature is exactly what you'll type. no shortcuts, no renamed args, fr fr. π
zggglmβsubroutine zggglm (N, M, P, A, LDA, B, LDB, D, X, Y, WORK, LWORK, INFO)β ZGGGLMzhbevβsubroutine zhbev (JOBZ, UPLO, N, KD, AB, LDAB, W, Z, LDZ, WORK, RWORK, INFO)β ZHBEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matriceszhbev_2stageβsubroutine zhbev_2stage (JOBZ, UPLO, N, KD, AB, LDAB, W, Z, LDZ, WORK, LWORK, RWORK, INFO)β ZHBEV_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matriceszhbevdβsubroutine zhbevd (JOBZ, UPLO, N, KD, AB, LDAB, W, Z, LDZ, WORK, LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO)β ZHBEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matriceszhbevd_2stageβsubroutine zhbevd_2stage (JOBZ, UPLO, N, KD, AB, LDAB, W, Z, LDZ, WORK, LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO)β ZHBEVD_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matriceszhbevxβsubroutine zhbevx (JOBZ, RANGE, UPLO, N, KD, AB, LDAB, Q, LDQ, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, WORK, RWORK, IWORK, IFAIL, INFO)β ZHBEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matriceszhbevx_2stageβsubroutine zhbevx_2stage (JOBZ, RANGE, UPLO, N, KD, AB, LDAB, Q, LDQ, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, WORK, LWORK, RWORK, IWORK, IFAIL, INFO)β ZHBEVX_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matriceszhbgvβsubroutine zhbgv (JOBZ, UPLO, N, KA, KB, AB, LDAB, BB, LDBB, W, Z, LDZ, WORK, RWORK, INFO)β ZHBGVzhbgvdβsubroutine zhbgvd (JOBZ, UPLO, N, KA, KB, AB, LDAB, BB, LDBB, W, Z, LDZ, WORK, LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO)β ZHBGVDzhbgvxβsubroutine zhbgvx (JOBZ, RANGE, UPLO, N, KA, KB, AB, LDAB, BB, LDBB, Q, LDQ, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, WORK, RWORK, IWORK, IFAIL, INFO)β ZHBGVXzhpevβsubroutine zhpev (JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, RWORK, INFO)β ZHPEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matriceszhpevdβsubroutine zhpevd (JOBZ, UPLO, N, AP, W, Z, LDZ, WORK, LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO)β ZHPEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matriceszhpevxβsubroutine zhpevx (JOBZ, RANGE, UPLO, N, AP, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, WORK, RWORK, IWORK, IFAIL, INFO)β ZHPEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matriceszhpgvβsubroutine zhpgv (ITYPE, JOBZ, UPLO, N, AP, BP, W, Z, LDZ, WORK, RWORK, INFO)β ZHPGVzhpgvdβsubroutine zhpgvd (ITYPE, JOBZ, UPLO, N, AP, BP, W, Z, LDZ, WORK, LWORK, RWORK, LRWORK, IWORK, LIWORK, INFO)β ZHPGVDzhpgvxβsubroutine zhpgvx (ITYPE, JOBZ, RANGE, UPLO, N, AP, BP, VL, VU, IL, IU, ABSTOL, M, W, Z, LDZ, WORK, RWORK, IWORK, IFAIL, INFO)β ZHPGVX
π¦ Detailed Description π¦
This is the group of complex16 Other Eigenvalue routines. that's the whole pitch bestie, and honestly it ate. π
π Function Documentation π
π subroutine zggglm π
subroutine zggglm (integer N, integer M, integer P, complex*16, dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B, integer LDB, complex*16, dimension( * ) D, complex*16, dimension( * ) X, complex*16, dimension( * ) Y, complex*16, dimension( * ) WORK, integer LWORK, integer INFO)
ZGGGLM β¨
π― Purpose
ZGGGLM solves a general Gauss-Markov linear model (GLM) problem:
minimize || y ||_2 subject to d = A*x + B*y
x
where A is an N-by-M matrix, B is an N-by-P matrix, and d is a
given N-vector. It is assumed that M <= N <= M+P, and
rank(A) = M and rank( A B ) = N.
Under these assumptions, the constrained equation is always
consistent, and there is a unique solution x and a minimal 2-norm
solution y, which is obtained using a generalized QR factorization
of the matrices (A, B) given by
A = Q*(R), B = Q*T*Z.
(0)
In particular, if matrix B is square nonsingular, then the problem
GLM is equivalent to the following weighted linear least squares
problem
minimize || inv(B)*(d-A*x) ||_2
x
where inv(B) denotes the inverse of B.
π§ Parameters
Nβ INTEGER. The number of rows of the matrices A and B.N >= 0.Mβ INTEGER. The number of columns of the matrix A.0 <= M <= N.Pβ INTEGER. The number of columns of the matrix B.P >= N-M.Aβ COMPLEX*16 array, dimension(LDA,M).- On entry, the N-by-M matrix A.
- On exit, the upper triangular part of the array A contains the M-by-M upper triangular matrix R.
LDAβ INTEGER. The leading dimension of the array A.LDA >= max(1,N).Bβ COMPLEX*16 array, dimension(LDB,P).- On entry, the N-by-P matrix B.
- On exit, if
N <= P, the upper triangle of the subarrayB(1:N,P-N+1:P)contains the N-by-N upper triangular matrix T; ifN > P, the elements on and above the(N-P)th subdiagonal contain the N-by-P upper trapezoidal matrix T.
LDBβ INTEGER. The leading dimension of the array B.LDB >= max(1,N).Dβ COMPLEX*16 array, dimension(N).- On entry, D is the left hand side of the GLM equation.
- On exit, D is destroyed. π (yes really, it's gone)
Xβ COMPLEX*16 array, dimension(M).Yβ COMPLEX*16 array, dimension(P).- On exit, X and Y are the solutions of the GLM problem. π
WORKβ COMPLEX*16 array, dimension(MAX(1,LWORK)).- On exit, if
INFO = 0,WORK(1)returns the optimalLWORK.
- On exit, if
LWORKβ INTEGER. The dimension of the arrayWORK.LWORK >= max(1,N+M+P). For optimum performance,LWORK >= M+min(N,P)+max(N,P)*NB, where NB is an upper bound for the optimal blocksizes forZGEQRF,ZGERQF,ZUNMQRandZUNMRQ.- If
LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.
- If
INFOβ INTEGER.= 0: successful exit. π«Ά< 0: ifINFO = -i, the i-th argument had an illegal value.= 1: the upper triangular factor R associated with A in the generalized QR factorization of the pair (A, B) is singular, so thatrank(A) < M; the least squares solution could not be computed. π= 2: the bottom(N-M)by(N-M)part of the upper trapezoidal factor T associated with B in the generalized QR factorization of the pair (A, B) is singular, so thatrank( A B ) < N; the least squares solution could not be computed. π
βοΈ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π subroutine zhbev π
subroutine zhbev (character JOBZ, character UPLO, integer N, integer KD, complex*16, dimension( ldab, * ) AB, integer LDAB, double precision, dimension( * ) W, complex*16, dimension( ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK, integer INFO)
ZHBEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices π
π― Purpose
ZHBEV computes all the eigenvalues and, optionally, eigenvectors of
a complex Hermitian band matrix A.
π§ Parameters
JOBZβ CHARACTER*1.= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors.
UPLOβ CHARACTER*1.= 'U': Upper triangle of A is stored;= 'L': Lower triangle of A is stored.
Nβ INTEGER. The order of the matrix A.N >= 0.KDβ INTEGER. The number of superdiagonals of the matrix A ifUPLO = 'U', or the number of subdiagonals ifUPLO = 'L'.KD >= 0.ABβ COMPLEX*16 array, dimension(LDAB, N).- On entry, the upper or lower triangle of the Hermitian band matrix A, stored in the first
KD+1rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:- if
UPLO = 'U',AB(kd+1+i-j,j) = A(i,j)formax(1,j-kd)<=i<=j; - if
UPLO = 'L',AB(1+i-j,j) = A(i,j)forj<=i<=min(n,j+kd).
- if
- On exit, AB is overwritten by values generated during the reduction to tridiagonal form. If
UPLO = 'U', the first superdiagonal and the diagonal of the tridiagonal matrix T are returned in rowsKDandKD+1of AB, and ifUPLO = 'L', the diagonal and first subdiagonal of T are returned in the first two rows of AB.
- On entry, the upper or lower triangle of the Hermitian band matrix A, stored in the first
LDABβ INTEGER. The leading dimension of the array AB.LDAB >= KD + 1.Wβ DOUBLE PRECISION array, dimension(N). IfINFO = 0, the eigenvalues in ascending order. βZβ COMPLEX*16 array, dimension(LDZ, N).- If
JOBZ = 'V', then ifINFO = 0, Z contains the orthonormal eigenvectors of the matrix A, with the i-th column of Z holding the eigenvector associated withW(i). - If
JOBZ = 'N', then Z is not referenced. π
- If
LDZβ INTEGER. The leading dimension of the array Z.LDZ >= 1, and ifJOBZ = 'V',LDZ >= max(1,N).WORKβ COMPLEX*16 array, dimension(N).RWORKβ DOUBLE PRECISION array, dimension(max(1,3*N-2)).INFOINFOisINTEGER= 0: successful exit. slay, no notes π< 0: ifINFO = -i, the i-th argument had an illegal value β so like, argument number i is the one acting up, bestie> 0: ifINFO = i, the algorithm failed to converge;ioff-diagonal elements of an intermediate tridiagonal form did not converge to zero. it just would not lock in π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π subroutine zhbev_2stage (character JOBZ, character UPLO, integer N, integer KD, complex*16, dimension( ldab, * ) AB, integer LDAB, double precision, dimension( * ) W, complex*16, dimension( ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK, integer LWORK, double precision, dimension( * ) RWORK, integer INFO)
ZHBEV_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices
π Purpose π
ZHBEV_2STAGE computes all the eigenvalues and, optionally, eigenvectors of a complex Hermitian band matrix A using the 2stage technique for the reduction to tridiagonal. it's giving β¨efficientβ¨, fr fr.
π Parameters π
JOBZ
JOBZ is CHARACTER*1
= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors. Not available in this release. π« (like, it's on the vision board, not in the build)
UPLO
UPLO is CHARACTER*1
= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
N
N is INTEGER The order of the matrix A. N >= 0.
KD
KD is INTEGER The number of superdiagonals of the matrix A if UPLO = 'U', or the number of subdiagonals if UPLO = 'L'. KD >= 0.
AB
AB is COMPLEX*16 array, dimension (LDAB, N) On entry, the upper or lower triangle of the Hermitian band matrix A, stored in the first KD+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:
if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
On exit, AB is overwritten by values generated during the reduction to tridiagonal form. If UPLO = 'U', the first superdiagonal and the diagonal of the tridiagonal matrix T are returned in rows KD and KD+1 of AB, and if UPLO = 'L', the diagonal and first subdiagonal of T are returned in the first two rows of AB. so yeah, your input gets a whole glow-up in place π«
LDAB
LDAB is INTEGER The leading dimension of the array AB. LDAB >= KD + 1.
W
W is DOUBLE PRECISION array, dimension (N) If INFO = 0, the eigenvalues in ascending order. sorted, organized, main character behavior π
Z
Z is COMPLEX*16 array, dimension (LDZ, N) If JOBZ = 'V', then if INFO = 0, Z contains the orthonormal eigenvectors of the matrix A, with the i-th column of Z holding the eigenvector associated with W(i). If JOBZ = 'N', then Z is not referenced. ghosted, literally not even looked at π
LDZ
LDZ is INTEGER The leading dimension of the array Z. LDZ >= 1, and if JOBZ = 'V', LDZ >= max(1,N).
WORK
WORK is COMPLEX*16 array, dimension LWORK On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK
LWORK is INTEGER The length of the array WORK. LWORK >= 1, when N <= 1; otherwise
If JOBZ = 'N' and N > 1, LWORK must be queried.
LWORK = MAX(1, dimension) where
dimension = (2KD+1)*N + KD*NTHREADS
where KD is the size of the band.
NTHREADS is the number of threads used when
openMP compilation is enabled, otherwise =1.
If JOBZ = 'V' and N > 1, LWORK must be queried. Not yet available.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes 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. it's just peeking, not committing π
RWORK
RWORK is DOUBLE PRECISION array, dimension (max(1,3*N-2))
INFO
INFO is INTEGER
= 0: successful exit. π< 0: ifINFO = -i, the i-th argument had an illegal value.> 0: ifINFO = i, the algorithm failed to converge;ioff-diagonal elements of an intermediate tridiagonal form did not converge to zero. the drama of it all π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details: π
All details about the 2stage techniques are available in:
Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '11), New York, NY, USA, Article 8 , 11 pages. http://doi.acm.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '13). Denver, Colorado, USA, 2013. Article 90, 12 pages. http://doi.acm.org/10.1145/2503210.2503292
A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. http://hpc.sagepub.com/content/28/2/196
π¦ subroutine zhbevd (character JOBZ, character UPLO, integer N, integer KD, complex*16, dimension( ldab, * ) AB, integer LDAB, double precision, dimension( * ) W, complex*16, dimension( ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK, integer LWORK, double precision, dimension( * ) RWORK, integer LRWORK, integer, dimension( * ) IWORK, integer LIWORK, integer INFO)
ZHBEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices
π Purpose π
ZHBEVD computes all the eigenvalues and, optionally, eigenvectors of a complex Hermitian band matrix A. If eigenvectors are desired, it uses a divide and conquer algorithm. it's giving strategy, periodt.
The divide and conquer algorithm makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on those binary machines without guard digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none. so like... probably fine? iconic confidence tbh π§
π Parameters π
JOBZ
JOBZ is CHARACTER*1
= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors.
UPLO
UPLO is CHARACTER*1
= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
N
N is INTEGER The order of the matrix A. N >= 0.
KD
KD is INTEGER The number of superdiagonals of the matrix A if UPLO = 'U', or the number of subdiagonals if UPLO = 'L'. KD >= 0.
AB
AB is COMPLEX*16 array, dimension (LDAB, N) On entry, the upper or lower triangle of the Hermitian band matrix A, stored in the first KD+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:
if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
On exit, AB is overwritten by values generated during the reduction to tridiagonal form. If UPLO = 'U', the first superdiagonal and the diagonal of the tridiagonal matrix T are returned in rows KD and KD+1 of AB, and if UPLO = 'L', the diagonal and first subdiagonal of T are returned in the first two rows of AB.
LDAB
LDAB is INTEGER The leading dimension of the array AB. LDAB >= KD + 1.
W
W is DOUBLE PRECISION array, dimension (N) If INFO = 0, the eigenvalues in ascending order. ascending, as it should be π
Z
Z is COMPLEX*16 array, dimension (LDZ, N) If JOBZ = 'V', then if INFO = 0, Z contains the orthonormal eigenvectors of the matrix A, with the i-th column of Z holding the eigenvector associated with W(i). If JOBZ = 'N', then Z is not referenced.
LDZ
LDZ is INTEGER The leading dimension of the array Z. LDZ >= 1, and if JOBZ = 'V', LDZ >= max(1,N).
WORK
WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)) On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK
LWORK is INTEGER The dimension of the array WORK.
If N <= 1, LWORK must be at least 1.
If JOBZ = 'N' and N > 1, LWORK must be at least N.
If JOBZ = 'V' and N > 1, LWORK must be at least 2*N**2.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes 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.
RWORK
RWORK is DOUBLE PRECISION array, dimension (LRWORK) On exit, if INFO = 0, RWORK(1) returns the optimal LRWORK.
LRWORKLRWORKisINTEGERβ the dimension of arrayRWORK, so like, it's gotta be big enough for the vibes π«Ά- If
N <= 1, thenLRWORKmust be at least1. - If
JOBZ = 'N'andN > 1,LRWORKmust be at leastN. - If
JOBZ = 'V'andN > 1,LRWORKmust be at least1 + 5*N + 2*N**2.
- If
IfLRWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA. (so like, it ghosts the error messages, iconic honestly π )
IWORKβIWORKisINTEGERarray, dimension(MAX(1,LIWORK)). On exit, ifINFO = 0,IWORK(1)returns the optimalLIWORK. she's reporting back bestie πLIWORKisINTEGERβ the dimension of arrayIWORK.- If
JOBZ = 'N'orN <= 1,LIWORKmust be at least1. - If
JOBZ = 'V'andN > 1,LIWORKmust be at least3 + 5*N.
- If
IfLIWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA. β¨
INFOisINTEGERβ the moment of truth, the vibe check at the end π¦= 0: successful exit. slay π< 0: ifINFO = -i, the i-th argument had an illegal value. someone fumbled π> 0: ifINFO = i, the algorithm failed to converge;ioff-diagonal elements of an intermediate tridiagonal form did not converge to zero. it's giving "not me crying in floating point" π
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine zhbevd_2stage
subroutine zhbevd_2stage (character JOBZ, character UPLO, integer N, integer
KD, complex*16, dimension( ldab, * ) AB, integer LDAB, double precision,
dimension( * ) W, complex*16, dimension( ldz, * ) Z, integer LDZ,
complex*16, dimension( * ) WORK, integer LWORK, double precision,
dimension( * ) RWORK, integer LRWORK, integer, dimension( * ) IWORK,
integer LIWORK, integer INFO)
ZHBEVD_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices β no cap, that's the whole job description π
Purpose:
ZHBEVD_2STAGE computes all the eigenvalues and, optionally, eigenvectors of a complex Hermitian band matrix A using the 2stage technique for the reduction to tridiagonal. If eigenvectors are desired, it uses a divide and conquer algorithm. queen behaviour honestly π
The divide and conquer algorithm makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on those binary machines without guard digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none. (so like, it could fail, but nobody's ever seen it happen β she's resilient fr fr πͺ)
Parameters
JOBZisCHARACTER*1β pick your destiny bestie:= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors. Not available in this release. (yeah, that door is locked in this release, no cap πͺπ)
UPLOisCHARACTER*1β which triangle are we even looking at:= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NisINTEGERβ the order of the matrixA.N >= 0.KDisINTEGERβ the number of superdiagonals of the matrixAifUPLO = 'U', or the number of subdiagonals ifUPLO = 'L'.KD >= 0.ABisCOMPLEX*16array, dimension(LDAB, N)β okay so on entry, the upper or lower triangle of the Hermitian band matrixA, stored in the firstKD+1rows of the array. The j-th column ofAis stored in the j-th column of the arrayABas follows:
if UPLO = 'U', AB(kd+1+i-j,j) = A(i,j) for max(1,j-kd)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+kd).
On exit, AB is overwritten by values generated during the reduction to tridiagonal form. If UPLO = 'U', the first superdiagonal and the diagonal of the tridiagonal matrix T are returned in rows KD and KD+1 of AB, and if UPLO = 'L', the diagonal and first subdiagonal of T are returned in the first two rows of AB. (yes she will be overwriting your data, she said what she said π)
LDABisINTEGERβ the leading dimension of the arrayAB.LDAB >= KD + 1.WisDOUBLE PRECISIONarray, dimension(N)β ifINFO = 0, the eigenvalues in ascending order. all lined up, neat and pretty β¨ZisCOMPLEX*16array, dimension(LDZ, N)β ifJOBZ = 'V', then ifINFO = 0,Zcontains the orthonormal eigenvectors of the matrixA, with the i-th column ofZholding the eigenvector associated withW(i). IfJOBZ = 'N', thenZis not referenced. (she's not even in the group chat if you pick'N'π)LDZisINTEGERβ the leading dimension of the arrayZ.LDZ >= 1, and ifJOBZ = 'V',LDZ >= max(1,N).WORKisCOMPLEX*16array, dimension(MAX(1,LWORK))β on exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKisINTEGERβ the length of the arrayWORK.LWORK >= 1, whenN <= 1; otherwise:- If
JOBZ = 'N'andN > 1,LWORKmust be queried.
- If
LWORK = MAX(1, dimension) where
dimension = (2KD+1)*N + KD*NTHREADS
where KD is the size of the band.
NTHREADS is the number of threads used when
openMP compilation is enabled, otherwise =1.
- If
JOBZ = 'V'andN > 1,LWORKmust be queried. Not yet available. (coming eventually, she promises π)
IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA.
RWORKisDOUBLE PRECISIONarray, dimension(LRWORK)β on exit, ifINFO = 0,RWORK(1)returns the optimalLRWORK.LRWORKisINTEGERβ the dimension of arrayRWORK.- If
N <= 1,LRWORKmust be at least1. - If
JOBZ = 'N'andN > 1,LRWORKmust be at leastN. - If
JOBZ = 'V'andN > 1,LRWORKmust be at least1 + 5*N + 2*N**2.
- If
IfLRWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA. π
IWORKisINTEGERarray, dimension(MAX(1,LIWORK))β on exit, ifINFO = 0,IWORK(1)returns the optimalLIWORK.LIWORKisINTEGERβ the dimension of arrayIWORK.- If
JOBZ = 'N'orN <= 1,LIWORKmust be at least1. - If
JOBZ = 'V'andN > 1,LIWORKmust be at least3 + 5*N.
- If
IfLIWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA. β¨
INFOisINTEGERβ the final verdict:= 0: successful exit. we ate π< 0: ifINFO = -i, the i-th argument had an illegal value.> 0: ifINFO = i, the algorithm failed to converge;ioff-diagonal elements of an intermediate tridiagonal form did not converge to zero. π
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
All details about the 2stage techniques are available in β okay bestie, citation time, she's academic AND cute πβ¨
Azzam Haidar, Hatem Ltaief, and Jack Dongarra. Parallel reduction to condensed forms for symmetric eigenvalue problems using aggregated fine-grained and memory-aware kernels. In Proceedings of 2011 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '11), New York, NY, USA, Article 8 , 11 pages. http://doi.acm.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013. An improved parallel singular value algorithm and its implementation for multicore hardware, In Proceedings of 2013 International Conference for High Performance Computing, Networking, Storage and Analysis (SC '13). Denver, Colorado, USA, 2013. Article 90, 12 pages. http://doi.acm.org/10.1145/2503210.2503292
A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra. A novel hybrid CPU-GPU generalized eigensolver for electronic structure calculations based on fine-grained memory aware tasks. International Journal of High Performance Computing Applications. Volume 28 Issue 2, Pages 196-209, May 2014. http://hpc.sagepub.com/content/28/2/196
subroutine zhbevx
subroutine zhbevx (character JOBZ, character RANGE, character UPLO, integer
N, integer KD, complex*16, dimension( ldab, * ) AB, integer LDAB,
complex*16, dimension( ldq, * ) Q, integer LDQ, double precision VL,
double precision VU, integer IL, integer IU, double precision ABSTOL,
integer M, double precision, dimension( * ) W, complex*16, dimension(
ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK, double
precision, dimension( * ) RWORK, integer, dimension( * ) IWORK, integer,
dimension( * ) IFAIL, integer INFO)
ZHBEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices πΈ
Purpose:
okay so like, buckle up buttercup, the details for this one are right up next π
...ZHBEVX is that girl: she computes selected eigenvalues and, if you want, eigenvectors too, of a complex Hermitian band matrix A. You can pick your faves either by a range of values or a range of indices. Choose your fighter. π
β¨ Parameters β¨
JOBZβCHARACTER*1, bestie, pick one:= 'N': compute eigenvalues only;= 'V': compute eigenvalues and eigenvectors.
RANGEβCHARACTER*1, the vibe selector:= 'A': all eigenvalues will be found;= 'V': all eigenvalues in the half-open interval(VL,VU]will be found;= 'I': theIL-th throughIU-th eigenvalues will be found.
UPLOβCHARACTER*1, which triangle are we even looking at:= 'U': upper triangle of A is stored;= 'L': lower triangle of A is stored.
NβINTEGER. The order of the matrix A.N >= 0. periodt.KDβINTEGER. The number of superdiagonals of the matrix A ifUPLO = 'U', or the number of subdiagonals ifUPLO = 'L'.KD >= 0.ABβCOMPLEX*16 array, dimension (LDAB, N). On entry, the upper or lower triangle of the Hermitian band matrix A, stored in the firstKD+1rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:- if
UPLO = 'U',AB(kd+1+i-j,j) = A(i,j)formax(1,j-kd)<=i<=j; - if
UPLO = 'L',AB(1+i-j,j) = A(i,j)forj<=i<=min(n,j+kd).
- if
On exit, AB is overwritten by values generated during the reduction to tridiagonal form. (Yeah she will touch your array, that's just how it is π)
LDABβINTEGER. The leading dimension of the array AB.LDAB >= KD + 1.QβCOMPLEX*16 array, dimension (LDQ, N).- If
JOBZ = 'V', the N-by-N unitary matrix used in the reduction to tridiagonal form. - If
JOBZ = 'N', the array Q is not referenced. (she's off-duty, not even looking π)
- If
LDQβINTEGER. The leading dimension of the array Q. IfJOBZ = 'V', thenLDQ >= max(1,N).VLβDOUBLE PRECISION. IfRANGE='V', the lower bound of the interval to be searched for eigenvalues.VL < VU. Not referenced ifRANGE = 'A'or'I'.VUβDOUBLE PRECISION. IfRANGE='V', the upper bound of the interval to be searched for eigenvalues.VL < VU. Not referenced ifRANGE = 'A'or'I'.ILβINTEGER. IfRANGE='I', the index of the smallest eigenvalue to be returned.1 <= IL <= IU <= N, ifN > 0;IL = 1andIU = 0ifN = 0. Not referenced ifRANGE = 'A'or'V'.IUβINTEGER. IfRANGE='I', the index of the largest eigenvalue to be returned.1 <= IL <= IU <= N, ifN > 0;IL = 1andIU = 0ifN = 0. Not referenced ifRANGE = 'A'or'V'.ABSTOLβDOUBLE PRECISION. The 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 AB 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'). (ngl this is the glow-up you want β¨)
See 'Computing Small Singular Values of Bidiagonal Matrices with Guaranteed High Relative Accuracy,' by Demmel and Kahan, LAPACK Working Note #3.
MβINTEGER. The total number of eigenvalues found.0 <= M <= N. IfRANGE = 'A',M = N, and ifRANGE = 'I',M = IU-IL+1.WβDOUBLE PRECISION array, dimension (N). The first M elements contain the selected eigenvalues in ascending order. πZβCOMPLEX*16 array, dimension (LDZ, max(1,M)). IfJOBZ = 'V', then ifINFO = 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 withW(i). If an eigenvector fails to converge, then that column of Z contains the latest approximation to the eigenvector, and the index of the eigenvector is returned inIFAIL. IfJOBZ = 'N', then Z is not referenced.
Note: the user must ensure that at leastmax(1,M)columns are supplied in the array Z; ifRANGE = 'V', the exact value of M is not known in advance and an upper bound must be used. (plan ahead bestie, she's not gonna guess for you π)
LDZβINTEGER. The leading dimension of the array Z.LDZ >= 1, and ifJOBZ = 'V',LDZ >= max(1,N).WORKβCOMPLEX*16 array, dimension (N).RWORKβDOUBLE PRECISION array, dimension (7*N).IWORKβINTEGER array, dimension (5*N).IFAILβINTEGER array, dimension (N). IfJOBZ = 'V', then ifINFO = 0, the first M elements ofIFAILare zero. IfINFO > 0, thenIFAILcontains the indices of the eigenvectors that failed to converge. IfJOBZ = 'N', thenIFAILis not referenced.INFOβINTEGER.= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value> 0: ifINFO = i, then i eigenvectors failed to converge. Their indices are stored in arrayIFAIL.
π¦ Author π¦
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
πΈ subroutine zhbevx_2stage πΈ
subroutine zhbevx_2stage (character JOBZ, character RANGE, character UPLO,
integer N, integer KD, complex*16, dimension( ldab, * ) AB, integer
LDAB, complex*16, dimension( ldq, * ) Q, integer LDQ, double precision
VL, double precision VU, integer IL, integer IU, double precision
ABSTOL, integer M, double precision, dimension( * ) W, complex*16,
dimension( ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK,
integer LWORK, double precision, dimension( * ) RWORK, integer,
dimension( * ) IWORK, integer, dimension( * ) IFAIL, integer INFO)
ZHBEVX_2STAGE computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices. (yes the name is a whole mouthful, we love her anyway π)
β¨ Purpose β¨
ZHBEVX_2STAGE computes selected eigenvalues and, optionally, eigenvectors of a complex Hermitian band matrix A using the 2stage technique for the reduction to tridiagonal. Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues.
π Parameters π
JOBZβCHARACTER*1.= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors.
Not available in this release. (ik, devastating. read the room bestie π)
RANGEβCHARACTER*1.= 'A': all eigenvalues will be found;= 'V': all eigenvalues in the half-open interval(VL,VU]will be found;= 'I': theIL-th throughIU-th eigenvalues will be found.
UPLOβCHARACTER*1.= 'U': upper triangle of A is stored;= 'L': lower triangle of A is stored.
NβINTEGER. The order of the matrix A.N >= 0.KDβINTEGER. The number of superdiagonals of the matrix A ifUPLO = 'U', or the number of subdiagonals ifUPLO = 'L'.KD >= 0.ABβCOMPLEX*16 array, dimension (LDAB, N). On entry, the upper or lower triangle of the Hermitian band matrix A, stored in the firstKD+1rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:- if
UPLO = 'U',AB(kd+1+i-j,j) = A(i,j)formax(1,j-kd)<=i<=j; - if
UPLO = 'L',AB(1+i-j,j) = A(i,j)forj<=i<=min(n,j+kd).
- if
On exit, AB is overwritten by values generated during the reduction to tridiagonal form.
LDABβINTEGER. The leading dimension of the array AB.LDAB >= KD + 1.QβCOMPLEX*16 array, dimension (LDQ, N).- If
JOBZ = 'V', the N-by-N unitary matrix used in the reduction to tridiagonal form. - If
JOBZ = 'N', the array Q is not referenced.
- If
LDQβINTEGER. The leading dimension of the array Q. IfJOBZ = 'V', thenLDQ >= max(1,N).VLβDOUBLE PRECISION. IfRANGE='V', the lower bound of the interval to be searched for eigenvalues.VL < VU. Not referenced ifRANGE = 'A'or'I'.VUβDOUBLE PRECISION. IfRANGE='V', the upper bound of the interval to be searched for eigenvalues.VL < VU. Not referenced ifRANGE = 'A'or'I'.ILβINTEGER. IfRANGE='I', the index of the smallest eigenvalue to be returned.1 <= IL <= IU <= N, ifN > 0;IL = 1andIU = 0ifN = 0. Not referenced ifRANGE = 'A'or'V'.IUIUβ bestie,IUisINTEGERβ¨ IfRANGE='I', it's the index of the largest eigenvalue you want back. Rules of the road:1 <= IL <= IU <= NifN > 0; andIL = 1plusIU = 0whenN = 0. It is not referenced ifRANGE = 'A'or'V'β so don't stress about it then, she's off duty πABSTOLβABSTOLisDOUBLE PRECISIONπ― It's the absolute error tolerance for the eigenvalues. An approximate eigenvalue gets accepted as converged when it's determined to lie in an interval[a,b]whose width is 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| gets used in its place, where |T| is the 1-norm of the tridiagonal matrix you get by reducing AB to tridiagonal form. Lowkey important: eigenvalues are computed most accurately when ABSTOL is set to twice the underflow threshold 2*DLAMCH('S'), not zero π¨ If this routine comes back with INFO>0 β meaning some eigenvectors did not converge β try setting ABSTOL to 2*DLAMCH('S'). And if you wanna go deep: see 'Computing Small Singular Values of Bidiagonal Matrices with Guaranteed High Relative Accuracy,' by Demmel and Kahan, LAPACK Working Note #3 π
MβMisINTEGERπΈ The total number of eigenvalues found.0 <= M <= N. IfRANGE = 'A', thenM = N, and ifRANGE = 'I', thenM = IU-IL+1. Math girlies stay winning πWβWisDOUBLE PRECISION array, dimension(N)β The firstMelements contain the selected eigenvalues in ascending order. Sorted and slaying, as she should πZβZisCOMPLEX*16 array, dimension(LDZ, max(1,M))π¦ IfJOBZ = 'V', then ifINFO = 0, the firstMcolumns ofZcontain the orthonormal eigenvectors of the matrixAcorresponding to the selected eigenvalues, with thei-th column ofZholding the eigenvector associated withW(i). If an eigenvector fails to converge, then that column ofZcontains the latest approximation to the eigenvector, and the index of the eigenvector is returned inIFAILπ IfJOBZ = 'N', thenZis not referenced at all, she's not even invited. Note: you the user must ensure that at leastmax(1,M)columns are supplied in the arrayZ; ifRANGE = 'V', the exact value ofMis not known in advance so you gotta use an upper bound πLDZβLDZisINTEGERπ« The leading dimension of the arrayZ.LDZ >= 1, and ifJOBZ = 'V',LDZ >= max(1,N).WORKβWORKisCOMPLEX*16 array, dimension(LWORK)πLWORKβLWORKisINTEGERπ The length of the arrayWORK.LWORK >= 1, whenN <= 1; otherwise:- If
JOBZ = 'N'andN > 1,LWORKmust be queried.
- If
LWORK = MAX(1, dimension) where
dimension = (2KD+1)*N + KD*NTHREADS
where KD is the size of the band.
NTHREADS is the number of threads used when
openMP compilation is enabled, otherwise =1.
- If
JOBZ = 'V'andN > 1,LWORKmust be queried. Not yet available. π
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes 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. Iconic behaviour honestly π
RWORKβRWORKisDOUBLE PRECISION array, dimension(7*N)πΈIWORKβIWORKisINTEGER array, dimension(5*N)π§IFAILβIFAILisINTEGER array, dimension(N)β IfJOBZ = 'V', then ifINFO = 0, the firstMelements ofIFAILare zero. IfINFO > 0, thenIFAILcontains the indices of the eigenvectors that failed to converge. IfJOBZ = 'N', thenIFAILis not referenced. She's the receipts keeper fr fr π§ΎINFOβINFOisINTEGERπ£= 0: successful exit β¨< 0: ifINFO = -i, thei-th argument had an illegal value π> 0: ifINFO = i, thenieigenvectors failed to converge. Their indices are stored in arrayIFAILπ
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π Further Details: π
All details about the 2stage techniques are available in:
Azzam Haidar, Hatem Ltaief, and Jack Dongarra.
Parallel reduction to condensed forms for symmetric eigenvalue problems
using aggregated fine-grained and memory-aware kernels. In Proceedings
of 2011 International Conference for High Performance Computing,
Networking, Storage and Analysis (SC '11), New York, NY, USA,
Article 8 , 11 pages.
http://doi.acm.org/10.1145/2063384.2063394
A. Haidar, J. Kurzak, P. Luszczek, 2013.
An improved parallel singular value algorithm and its implementation
for multicore hardware, In Proceedings of 2013 International Conference
for High Performance Computing, Networking, Storage and Analysis (SC '13).
Denver, Colorado, USA, 2013.
Article 90, 12 pages.
http://doi.acm.org/10.1145/2503210.2503292
A. Haidar, R. Solca, S. Tomov, T. Schulthess and J. Dongarra.
A novel hybrid CPU-GPU generalized eigensolver for electronic structure
calculations based on fine-grained memory aware tasks.
International Journal of High Performance Computing Applications.
Volume 28 Issue 2, Pages 196-209, May 2014.
http://hpc.sagepub.com/content/28/2/196
Citation queen behaviour, we love to see it ππ
π¦ subroutine zhbgv π¦
subroutine zhbgv (character JOBZ, character UPLO, integer N, integer KA,
integer KB, complex*16, dimension( ldab, * ) AB, integer LDAB,
complex*16, dimension( ldbb, * ) BB, integer LDBB, double precision,
dimension( * ) W, complex*16, dimension( ldz, * ) Z, integer LDZ,
complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK,
integer INFO)
ZHBGV
β¨ Purpose: β¨
ZHBGV computes all the eigenvalues, and optionally, the eigenvectors of a complex generalized Hermitian-definite banded eigenproblem, of the form A*x=(lambda)*B*x. Here A and B are assumed to be Hermitian and banded, and B is also positive definite. No cap, she does the whole glow-up on a banded problem π«Ά
π Parameters π
JOBZβJOBZisCHARACTER*1π«= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors.
UPLOβUPLOisCHARACTER*1πΈ= 'U': Upper triangles ofAandBare stored;= 'L': Lower triangles ofAandBare stored.
NβNisINTEGERβ The order of the matricesAandB.N >= 0.KAβKAisINTEGERπ¦ The number of superdiagonals of the matrixAifUPLO = 'U', or the number of subdiagonals ifUPLO = 'L'.KA >= 0.KBβKBisINTEGERπ The number of superdiagonals of the matrixBifUPLO = 'U', or the number of subdiagonals ifUPLO = 'L'.KB >= 0.ABβABisCOMPLEX*16 array, dimension(LDAB, N)π On entry, the upper or lower triangle of the Hermitian band matrixA, stored in the firstka+1rows of the array. Thej-th column ofAis stored in thej-th column of the arrayABas follows:
if UPLO = 'U', AB(ka+1+i-j,j) = A(i,j) for max(1,j-ka)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+ka).
On exit, the contents of AB are destroyed π she did what she had to do.
LDABβLDABisINTEGERβ¨ The leading dimension of the arrayAB.LDAB >= KA+1.BBβBBisCOMPLEX*16 array, dimension(LDBB, N)π§ On entry, the upper or lower triangle of the Hermitian band matrixB, stored in the firstkb+1rows of the array. Thej-th column ofBis stored in thej-th column of the arrayBBas follows:
if UPLO = 'U', BB(kb+1+i-j,j) = B(i,j) for max(1,j-kb)<=i<=j;
if UPLO = 'L', BB(1+i-j,j) = B(i,j) for j<=i<=min(n,j+kb).
On exit, the factor S from the split Cholesky factorization B = S**H*S, as returned by ZPBSTF π
LDBBβLDBBisINTEGERπ The leading dimension of the arrayBB.LDBB >= KB+1.WβWisDOUBLE PRECISION array, dimension(N)β IfINFO = 0, the eigenvalues in ascending order. Sorted, ascending, thriving πZβZisCOMPLEX*16 array, dimension(LDZ, N)π¦ IfJOBZ = 'V', then ifINFO = 0,Zcontains the matrixZof eigenvectors, with thei-th column ofZholding the eigenvector associated withW(i). The eigenvectors are normalized so thatZ**H*B*Z = I. IfJOBZ = 'N', thenZis not referenced β she's simply not in the group chat πLDZβLDZisINTEGERπΈ The leading dimension of the arrayZ.LDZ >= 1, and ifJOBZ = 'V',LDZ >= N.WORKβWORKisCOMPLEX*16 array, dimension(N)πRWORKβRWORKisDOUBLE PRECISION array, dimension(3*N)πINFOβINFOisINTEGERπ£= 0: successful exit β¨< 0: ifINFO = -i, thei-th argument had an illegal value π> 0: ifINFO = i, andiis:<= N: the algorithm failed to converge:ioff-diagonal elements of an intermediate tridiagonal form did not converge to zero π> N: ifINFO = N + i, for1 <= i <= N, thenZPBSTFreturnedINFO = i:Bis not positive definite. The factorization ofBcould not be completed and no eigenvalues or eigenvectors were computed. Devastating. Nothing was served π
π Author π
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine zhbgvd
subroutine zhbgvd (character JOBZ, character UPLO, integer N, integer KA,
integer KB, complex*16, dimension( ldab, * ) AB, integer LDAB,
complex*16, dimension( ldbb, * ) BB, integer LDBB, double precision,
dimension( * ) W, complex*16, dimension( ldz, * ) Z, integer LDZ,
complex*16, dimension( * ) WORK, integer LWORK, double precision,
dimension( * ) RWORK, integer LRWORK, integer, dimension( * ) IWORK,
integer LIWORK, integer INFO)
ZHBGVD
Purpose β¨
ZHBGVD computes all the eigenvalues β and, if you want them, the eigenvectors too β of a complex generalized Hermitian-definite banded eigenproblem, bestie. The form is:
A*x=(lambda)*B*x
Here A and B are assumed to be Hermitian and banded, and B is also positive definite. If eigenvectors are desired, it uses a divide and conquer algorithm. π
The divide and conquer algorithm makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on those binary machines without guard digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none. (no cap, that's just what the docs say π)
Parameters
JOBZ
JOBZ is CHARACTER*1, so pick your vibe:
'N': Compute eigenvalues only;'V': Compute eigenvalues and eigenvectors.
UPLO
UPLO is CHARACTER*1 β which triangle are we even using, bestie:
'U': Upper triangles ofAandBare stored;'L': Lower triangles ofAandBare stored.
N
N is INTEGER. The order of the matrices A and B. N >= 0.
KA
KA is INTEGER. The number of superdiagonals of the matrix A if UPLO = 'U', or the number of subdiagonals if UPLO = 'L'. KA >= 0.
KB
KB is INTEGER. The number of superdiagonals of the matrix B if UPLO = 'U', or the number of subdiagonals if UPLO = 'L'. KB >= 0.
AB
AB is COMPLEX*16 array, dimension (LDAB, N). On entry, the upper or lower triangle of the Hermitian band matrix A, stored in the first ka+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:
if UPLO = 'U', AB(ka+1+i-j,j) = A(i,j) for max(1,j-ka)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+ka).
On exit, the contents of AB are destroyed. π
LDAB
LDAB is INTEGER. The leading dimension of the array AB. LDAB >= KA+1.
BB
BB is COMPLEX*16 array, dimension (LDBB, N). On entry, the upper or lower triangle of the Hermitian band matrix B, stored in the first kb+1 rows of the array. The j-th column of B is stored in the j-th column of the array BB as follows:
if UPLO = 'U', BB(kb+1+i-j,j) = B(i,j) for max(1,j-kb)<=i<=j;
if UPLO = 'L', BB(1+i-j,j) = B(i,j) for j<=i<=min(n,j+kb).
On exit, the factor S from the split Cholesky factorization B = S**H*S, as returned by ZPBSTF.
LDBB
LDBB is INTEGER. The leading dimension of the array BB. LDBB >= KB+1.
W
W is DOUBLE PRECISION array, dimension (N). If INFO = 0, the eigenvalues in ascending order. β¨
Z
Z is COMPLEX*16 array, dimension (LDZ, N). If JOBZ = 'V', then if INFO = 0, Z contains the matrix Z of eigenvectors, with the i-th column of Z holding the eigenvector associated with W(i). The eigenvectors are normalized so that Z**H*B*Z = I. If JOBZ = 'N', then Z is not referenced.
LDZ
LDZ is INTEGER. The leading dimension of the array Z. LDZ >= 1, and if JOBZ = 'V', LDZ >= N.
WORK
WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO=0, WORK(1) returns the optimal LWORK.
LWORK
LWORK is INTEGER. The dimension of the array WORK.
If N <= 1, LWORK >= 1.
If JOBZ = 'N' and N > 1, LWORK >= N.
If JOBZ = 'V' and N > 1, LWORK >= 2*N**2.
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes 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. π«Ά
RWORK
RWORK is DOUBLE PRECISION array, dimension (MAX(1,LRWORK)). On exit, if INFO=0, RWORK(1) returns the optimal LRWORK.
LRWORK
LRWORK is INTEGER. The dimension of array RWORK.
If N <= 1, LRWORK >= 1.
If JOBZ = 'N' and N > 1, LRWORK >= N.
If JOBZ = 'V' and N > 1, LRWORK >= 1 + 5*N + 2*N**2.
If LRWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes 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
IWORK is INTEGER array, dimension (MAX(1,LIWORK)). On exit, if INFO=0, IWORK(1) returns the optimal LIWORK.
LIWORK
LIWORK is INTEGER. The dimension of array IWORK.
If JOBZ = 'N' or N <= 1, LIWORK >= 1.
If JOBZ = 'V' and N > 1, LIWORK >= 3 + 5*N.
If LIWORK = -1, then a workspace query is assumed; the routine only calculates the optimal sizes 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.
INFO
INFO is INTEGER:
= 0: successful exit π< 0: ifINFO = -i, thei-th argument had an illegal value> 0: ifINFO = i, andiis:<= N: the algorithm failed to converge:ioff-diagonal elements of an intermediate tridiagonal form did not converge to zero;> N: ifINFO = N + i, for1 <= i <= N, thenZPBSTFreturnedINFO = i:Bis not positive definite. The factorization ofBcould not be completed and no eigenvalues or eigenvectors were computed. (this one hurts, bestie π)
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA
subroutine zhbgvx
subroutine zhbgvx (character JOBZ, character RANGE, character UPLO, integer
N, integer KA, integer KB, complex*16, dimension( ldab, * ) AB, integer
LDAB, complex*16, dimension( ldbb, * ) BB, integer LDBB, complex*16,
dimension( ldq, * ) Q, integer LDQ, double precision VL, double
precision VU, integer IL, integer IU, double precision ABSTOL, integer
M, double precision, dimension( * ) W, complex*16, dimension( ldz, * )
Z, integer LDZ, complex*16, dimension( * ) WORK, double precision,
dimension( * ) RWORK, integer, dimension( * ) IWORK, integer, dimension(
* ) IFAIL, integer INFO)
ZHBGVX
Purpose π
ZHBGVX computes all the eigenvalues, and optionally, the eigenvectors of a complex generalized Hermitian-definite banded eigenproblem, of the form:
A*x=(lambda)*B*x
Here A and B are assumed to be Hermitian and banded, and B is also positive definite. And the iconic part: eigenvalues and eigenvectors can be selected by specifying either all eigenvalues, a range of values or a range of indices for the desired eigenvalues. Choose your own adventure, fr fr. π¦
Parameters
JOBZ
JOBZ is CHARACTER*1:
'N': Compute eigenvalues only;'V': Compute eigenvalues and eigenvectors.
RANGE
RANGE is CHARACTER*1:
'A': all eigenvalues will be found;'V': all eigenvalues in the half-open interval(VL,VU]will be found;'I': theIL-th throughIU-th eigenvalues will be found.
UPLO
UPLO is CHARACTER*1:
'U': Upper triangles ofAandBare stored;'L': Lower triangles ofAandBare stored.
N
N is INTEGER. The order of the matrices A and B. N >= 0.
KA
KA is INTEGER. The number of superdiagonals of the matrix A if UPLO = 'U', or the number of subdiagonals if UPLO = 'L'. KA >= 0.
KB
KB is INTEGER. The number of superdiagonals of the matrix B if UPLO = 'U', or the number of subdiagonals if UPLO = 'L'. KB >= 0.
AB
AB is COMPLEX*16 array, dimension (LDAB, N). On entry, the upper or lower triangle of the Hermitian band matrix A, stored in the first ka+1 rows of the array. The j-th column of A is stored in the j-th column of the array AB as follows:
if UPLO = 'U', AB(ka+1+i-j,j) = A(i,j) for max(1,j-ka)<=i<=j;
if UPLO = 'L', AB(1+i-j,j) = A(i,j) for j<=i<=min(n,j+ka).
On exit, the contents of AB are destroyed. π
LDAB
LDAB is INTEGER. The leading dimension of the array AB. LDAB >= KA+1.
BB
BB is COMPLEX*16 array, dimension (LDBB, N). On entry, the upper or lower triangle of the Hermitian band matrix B, stored in the first kb+1 rows of the array. The j-th column of B is stored in the j-th column of the array BB as follows:
if UPLO = 'U', BB(kb+1+i-j,j) = B(i,j) for max(1,j-kb)<=i<=j;
if UPLO = 'L', BB(1+i-j,j) = B(i,j) for j<=i<=min(n,j+kb).
On exit, the factor S from the split Cholesky factorization B = S**H*S, as returned by ZPBSTF.
LDBB
LDBB is INTEGER. The leading dimension of the array BB. LDBB >= KB+1.
Q
okay so still on Q, and here's the rest of the tea π« β this one's a COMPLEX*16 array, dimension (LDQ, N).
- If
JOBZ = 'V', it's the n-by-n matrix used in the reduction ofA*x = (lambda)*B*xto standard form, i.e.C*x = (lambda)*x, and consequently C to tridiagonal form. - If
JOBZ = 'N', the arrayQis not referenced at all. she's off duty, respect her privacy π LDQβLDQ is INTEGER, the leading dimension of the arrayQ. IfJOBZ = 'N', thenLDQ >= 1. IfJOBZ = 'V', thenLDQ >= max(1,N). get this wrong and it's over bestieVLβVL is DOUBLE PRECISION. IfRANGE='V', this is the lower bound of the interval to be searched for eigenvalues.VL < VU. Not referenced ifRANGE = 'A'or'I'.VUβVU is DOUBLE PRECISION. IfRANGE='V', this is the upper bound of the interval to be searched for eigenvalues.VL < VU. Not referenced ifRANGE = 'A'or'I'.ILβIL is INTEGER. IfRANGE='I', it's the index of the smallest eigenvalue to be returned.1 <= IL <= IU <= N, ifN > 0;IL = 1andIU = 0ifN = 0. Not referenced ifRANGE = 'A'or'V'.IUβIU is INTEGER. IfRANGE='I', it's the index of the largest eigenvalue to be returned.1 <= IL <= IU <= N, ifN > 0;IL = 1andIU = 0ifN = 0. Not referenced ifRANGE = 'A'or'V'.ABSTOLβABSTOL is DOUBLE PRECISION, the absolute error tolerance for the eigenvalues. An approximate eigenvalue gets accepted as converged when it's 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| gets used in its place, where |T| is the 1-norm of the tridiagonal matrix obtained by reducing AP to tridiagonal form.
Eigenvalues get computed most accurately when ABSTOL is set to twice the underflow threshold 2*DLAMCH('S'), not zero. And listen β if this routine comes back with INFO>0, meaning some eigenvectors did not converge, try setting ABSTOL to 2*DLAMCH('S'). that's the glow-up fix β¨
MβM is INTEGER, the total number of eigenvalues found.0 <= M <= N. IfRANGE = 'A',M = N, and ifRANGE = 'I',M = IU-IL+1. she's counting for you, say thank you π«ΆWβW is DOUBLE PRECISION array, dimension (N). IfINFO = 0, these are the eigenvalues in ascending order. sorted queen behaviorZβZ is COMPLEX*16 array, dimension (LDZ, N). IfJOBZ = 'V', then ifINFO = 0,Zcontains the matrixZof eigenvectors, with the i-th column ofZholding the eigenvector associated withW(i). The eigenvectors are normalized so thatZ**H*B*Z = I. IfJOBZ = 'N', thenZis not referenced. normalized to the identity, as she should be πLDZβLDZ is INTEGER, the leading dimension of the arrayZ.LDZ >= 1, and ifJOBZ = 'V',LDZ >= N.WORKβWORK is COMPLEX*16 array, dimension (N).RWORKβRWORK is DOUBLE PRECISION array, dimension (7*N).IWORKβIWORK is INTEGER array, dimension (5*N).IFAILβIFAIL is INTEGER array, dimension (N). IfJOBZ = 'V', then ifINFO = 0, the firstMelements ofIFAILare zero. IfINFO > 0, thenIFAILcontains the indices of the eigenvectors that failed to converge. IfJOBZ = 'N', thenIFAILis not referenced.INFOβINFO is INTEGER
= 0: successful exit
< 0: if INFO = -i, the i-th argument had an illegal value
> 0: if INFO = i, and i is:
<= N: then i eigenvectors failed to converge. Their
indices are stored in array IFAIL.
> N: if INFO = N + i, for 1 <= i <= N, then ZPBSTF
returned INFO = i: B is not positive definite.
The factorization of B could not be completed and
no eigenvalues or eigenvectors were computed.
INFO <= N means some eigenvectors ghosted you and their names are in IFAIL. INFO > N means ZPBSTF said B is not positive definite and literally nothing got computed. devastating, but at least you know why π
πΈ Author πΈ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Contributors π
Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA
π subroutine zhpev (character JOBZ, character UPLO, integer N, complex*16, dimension( * ) AP, double precision, dimension( * ) W, complex*16, dimension( ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK, integer INFO)
ZHPEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices. iconic. no notes.
β¨ Purpose β¨
ZHPEV computes all the eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix in packed storage.
π Parameters π
JOBZβJOBZ is CHARACTER*1= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors.
UPLOβUPLO is CHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβN is INTEGER. The order of the matrixA.N >= 0.APβAP is COMPLEX*16 array, dimension (N*(N+1)/2).
On entry, 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:
if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
if UPLO = 'L', AP(i + (j-1)*(2*n-j)/2) = A(i,j) for j<=i<=n.
On exit, 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, and if UPLO = 'L', the diagonal and first subdiagonal of T overwrite the corresponding elements of A. yes, she ate your input. it's gone. it was always going to be gone. π
WβW is DOUBLE PRECISION array, dimension (N). IfINFO = 0, the eigenvalues in ascending order. ascending, always, no exceptionsZβZ is COMPLEX*16 array, dimension (LDZ, N). IfJOBZ = 'V', then ifINFO = 0,Zcontains the orthonormal eigenvectors of the matrixA, with the i-th column ofZholding the eigenvector associated withW(i). IfJOBZ = 'N', thenZis not referenced.LDZβLDZ is INTEGER, the leading dimension of the arrayZ.LDZ >= 1, and ifJOBZ = 'V',LDZ >= max(1,N).WORKβWORK is COMPLEX*16 array, dimension (max(1, 2*N-1)).RWORKβRWORK is DOUBLE PRECISION array, dimension (max(1, 3*N-2)).INFOβINFO is INTEGER
= 0: successful exit.
< 0: if INFO = -i, the i-th argument had an illegal value.
> 0: if INFO = i, the algorithm failed to converge; i
off-diagonal elements of an intermediate tridiagonal
form did not converge to zero.
INFO > 0 here means the algorithm couldn't converge β i off-diagonal elements of an intermediate tridiagonal form refused to go to zero. stubborn.
πΈ Author πΈ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π subroutine zhpevd (character JOBZ, character UPLO, integer N, complex*16, dimension( * ) AP, double precision, dimension( * ) W, complex*16, dimension( ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK, integer LWORK, double precision, dimension( * ) RWORK, integer LRWORK, integer, dimension( * ) IWORK, integer LIWORK, integer INFO)
ZHPEVD computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices. the fancy one. the diva. the divide-and-conquer one.
β¨ Purpose β¨
ZHPEVD computes all the eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A in packed storage. If eigenvectors are desired, it uses a divide and conquer algorithm.
The divide and conquer algorithm makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on those binary machines without guard digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none. she's adventurous but she's not reckless, okay π¦
π Parameters π
JOBZβJOBZ is CHARACTER*1= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors.
UPLOβUPLO is CHARACTER*1= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβN is INTEGER. The order of the matrixA.N >= 0.APβAP is COMPLEX*16 array, dimension (N*(N+1)/2).
On entry, 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:
if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
if UPLO = 'L', AP(i + (j-1)*(2*n-j)/2) = A(i,j) for j<=i<=n.
On exit, 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, and if UPLO = 'L', the diagonal and first subdiagonal of T overwrite the corresponding elements of A. same deal as before: your AP gets rearranged and there's no going back π
WβW is DOUBLE PRECISION array, dimension (N). IfINFO = 0, the eigenvalues in ascending order. sorted, slay, ascendingZβZ is COMPLEX*16 array, dimension (LDZ, N). IfJOBZ = 'V', then ifINFO = 0,Zcontains the orthonormal eigenvectors of the matrixA, with the i-th column ofZholding the eigenvector associated withW(i). IfJOBZ = 'N', thenZis not referenced.LDZβLDZ is INTEGER, the leading dimension of the arrayZ.LDZ >= 1, and ifJOBZ = 'V',LDZ >= max(1,N).WORKβWORK is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the requiredLWORK. she tells you what she needs, you just have to ask π«ΆLWORKβINTEGER</p>, bestie, it's the dimension of arrayWORK. π Here's the vibe check on how big it needs to be:- If
N <= 1,LWORKmust be at least1. - If
JOBZ = 'N'andN > 1,LWORKmust be at leastN. - If
JOBZ = 'V'andN > 1,LWORKmust be at least2*N.
- If
And now the iconic part: if LWORK = -1, then a workspace query is assumed β the routine only calculates the required sizes 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. It's giving "just asking for a friend, not actually doing the math." β¨
RWORKβDOUBLE PRECISIONarray, dimension(MAX(1,LRWORK)). On exit, ifINFO = 0,RWORK(1)returns the requiredLRWORK. πLRWORKβINTEGER</p>, the dimension of arrayRWORK. Sizing tea:- If
N <= 1,LRWORKmust be at least1. - If
JOBZ = 'N'andN > 1,LRWORKmust be at leastN. - If
JOBZ = 'V'andN > 1,LRWORKmust be at least1 + 5*N + 2*N**2.
- If
Same query energy: if LRWORK = -1, then a workspace query is assumed; the routine only calculates the required sizes 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βINTEGERarray, dimension(MAX(1,LIWORK)). On exit, ifINFO = 0,IWORK(1)returns the requiredLIWORK. π¦LIWORKβINTEGER</p>, the dimension of arrayIWORK.- If
JOBZ = 'N'orN <= 1,LIWORKmust be at least1. - If
JOBZ = 'V'andN > 1,LIWORKmust be at least3 + 5*N.
- If
And one more time for the people in the back: if LIWORK = -1, then a workspace query is assumed; the routine only calculates the required sizes 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. Periodt. π₯
INFOβINTEGER</p>, the receipts:= 0: successful exit β¨< 0: ifINFO = -i, thei-th argument had an illegal value. π©> 0: ifINFO = i, the algorithm failed to converge;ioff-diagonal elements of an intermediate tridiagonal form did not converge to zero. Not the slay we wanted. π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
πΈ subroutine zhpevx (character JOBZ, character RANGE, character UPLO, integer N, complex*16, dimension( * ) AP, double precision VL, double precision VU, integer IL, integer IU, double precision ABSTOL, integer M, double precision, dimension( * ) W, complex*16, dimension( ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK, integer, dimension( * ) IWORK, integer, dimension( * ) IFAIL, integer INFO)
ZHPEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for OTHER matrices π¦
Purpose
ZHPEVX computes selected eigenvalues and, optionally, eigenvectors of a complex Hermitian matrix A in packed storage. Eigenvalues/vectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues. Pick your fighter: values or indices, bestie. π
Parameters
JOBZβCHARACTER*1</p>= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors.
RANGEβCHARACTER*1</p>= 'A': all eigenvalues will be found;= 'V': all eigenvalues in the half-open interval(VL,VU]will be found;= 'I': theIL-th throughIU-th eigenvalues will be found.
UPLOβCHARACTER*1</p>= 'U': Upper triangle ofAis stored;= 'L': Lower triangle ofAis stored.
NβINTEGER</p>, the order of the matrixA.N >= 0.APβCOMPLEX*16array, dimension(N*(N+1)/2).
On entry, 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:
- if
UPLO = 'U',AP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - if
UPLO = 'L',AP(i + (j-1)*(2*n-j)/2) = A(i,j)forj<=i<=n.
On exit, 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, and if UPLO = 'L', the diagonal and first subdiagonal of T overwrite the corresponding elements of A. Yes bestie, your input gets eaten. It's a glow-up, not a preservation project. π
VLβDOUBLE PRECISION. IfRANGE='V', the lower bound of the interval to be searched for eigenvalues.VL < VU. Not referenced ifRANGE = 'A'or'I'.VUβDOUBLE PRECISION. IfRANGE='V', the upper bound of the interval to be searched for eigenvalues.VL < VU. Not referenced ifRANGE = 'A'or'I'.ILβINTEGER</p>. IfRANGE='I', the index of the smallest eigenvalue to be returned.1 <= IL <= IU <= N, ifN > 0;IL = 1andIU = 0ifN = 0. Not referenced ifRANGE = 'A'or'V'.IUβINTEGER</p>. IfRANGE='I', the index of the largest eigenvalue to be returned.1 <= IL <= IU <= N, ifN > 0;IL = 1andIU = 0ifN = 0. Not referenced ifRANGE = 'A'or'V'.ABSTOLβDOUBLE PRECISION, the 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 AP 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. π
MβINTEGER</p>, the total number of eigenvalues found.0 <= M <= N. IfRANGE = 'A',M = N, and ifRANGE = 'I',M = IU-IL+1.WβDOUBLE PRECISIONarray, dimension(N). IfINFO = 0, the selected eigenvalues in ascending order. βZβCOMPLEX*16array, dimension(LDZ, max(1,M)). IfJOBZ = 'V', then ifINFO = 0, the firstMcolumns ofZcontain the orthonormal eigenvectors of the matrixAcorresponding to the selected eigenvalues, with thei-th column ofZholding the eigenvector associated withW(i). If an eigenvector fails to converge, then that column ofZcontains the latest approximation to the eigenvector, and the index of the eigenvector is returned inIFAIL. IfJOBZ = 'N', thenZis not referenced.
Note: the user must ensure that at leastmax(1,M)columns are supplied in the arrayZ; ifRANGE = 'V', the exact value ofMis not known in advance and an upper bound must be used. Don't skip this one bestie, it WILL bite you. π
LDZβINTEGER</p>, the leading dimension of the arrayZ.LDZ >= 1, and ifJOBZ = 'V',LDZ >= max(1,N).WORKβCOMPLEX*16array, dimension(2*N).RWORKβDOUBLE PRECISIONarray, dimension(7*N).IWORKβINTEGERarray, dimension(5*N).IFAILβINTEGERarray, dimension(N). IfJOBZ = 'V', then ifINFO = 0, the firstMelements ofIFAILare zero. IfINFO > 0, thenIFAILcontains the indices of the eigenvectors that failed to converge. IfJOBZ = 'N', thenIFAILis not referenced. πINFOβINTEGER</p>, the final report card:= 0: successful exit β¨< 0: ifINFO = -i, thei-th argument had an illegal value π©> 0: ifINFO = i, thenieigenvectors failed to converge. Their indices are stored in arrayIFAIL. Not every icon makes it to the finish line. π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π subroutine zhpgv (integer ITYPE, character JOBZ, character UPLO, integer N, complex*16, dimension( * ) AP, complex*16, dimension( * ) BP, double precision, dimension( * ) W, complex*16, dimension( ldz, * ) Z, integer LDZ, complex*16, dimension( * ) WORK, double precision, dimension( * ) RWORK, integer INFO)
ZHPGV π«Ά
Purpose
ZHPGV computes all the eigenvalues and, optionally, the eigenvectors of a complex generalized Hermitian-definite eigenproblem, of the form A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. Here A and B are assumed to be Hermitian, stored in packed format, and B is also positive definite. Two matrices, one iconic problem, zero drama (hopefully). π
Parameters
ITYPEβINTEGER</p>, specifies the problem type to be solved:= 1:A*x = (lambda)*B*x= 2:A*B*x = (lambda)*x= 3:B*A*x = (lambda)*x
JOBZβCHARACTER*1</p>= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors.
UPLOβCHARACTER*1</p>= 'U': Upper triangles ofAandBare stored;= 'L': Lower triangles ofAandBare stored.
NNβ INTEGER, bestie. It's the order of the matricesAandB, and the vibe check saysN >= 0. No negative orders, we don't do that here πAPβ COMPLEX*16 array, dimension(N*(N+1)/2). On entry it's holding the upper or lower triangle of the Hermitian matrixA, packed columnwise in a linear array, which sounds scary but it's just fancy storage, iykyk. The j-th column ofAlives inAPlike this:- if
UPLO = 'U', thenAP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - if
UPLO = 'L', thenAP(i + (j-1)*(2*n-j)/2) = A(i,j)forj<=i<=n.
- if
On exit, the contents of AP are destroyed. Gone. Reduced to atoms. π Don't come looking for your original A in there.
BPβ COMPLEX*16 array, dimension(N*(N+1)/2). On entry, same deal but for the Hermitian matrixB, packed columnwise in a linear array. The j-th column ofBis stored inBPas follows:- if
UPLO = 'U', thenBP(i + (j-1)*j/2) = B(i,j)for1<=i<=j; - if
UPLO = 'L', thenBP(i + (j-1)*(2*n-j)/2) = B(i,j)forj<=i<=n.
- if
On exit, BP holds the triangular factor U or L from the Cholesky factorization B = U**H*U or B = L*L**H, in the same storage format as B. She transformed, she's iconic now β¨
Wβ DOUBLE PRECISION array, dimension(N). IfINFO = 0, this is your eigenvalues in ascending order. Sorted, tidy, main character energy πZβ COMPLEX*16 array, dimension(LDZ, N). IfJOBZ = 'V', then ifINFO = 0,Zcontains the matrixZof eigenvectors. The eigenvectors are normalized like this:- if
ITYPE = 1or2, thenZ**H*B*Z = I; - if
ITYPE = 3, thenZ**H*inv(B)*Z = I.
- if
If JOBZ = 'N', then Z is not referenced. Not even a little. She doesn't get invited to the party π
LDZβ INTEGER. The leading dimension of the arrayZ. Rules areLDZ >= 1, and ifJOBZ = 'V', thenLDZ >= max(1,N). Respect the leading dimension or suffer the consequences fr fr.WORKβ COMPLEX*16 array, dimension(max(1, 2*N-1)). Just workspace, doing the behind-the-scenes labor. We stan π«ΆRWORKβ DOUBLE PRECISION array, dimension(max(1, 3*N-2)). More workspace, real-valued this time.INFOβ INTEGER. The status report, the receipts, the truth:= 0: successful exit. Slay π< 0: ifINFO = -i, the i-th argument had an illegal value. You messed up an input bestie π> 0:ZPPTRForZHPEVreturned an error code:<= N: ifINFO = i,ZHPEVfailed to converge;ioff-diagonal elements of an intermediate tridiagonal form did not convergeto zero;> N: ifINFO = N + i, for1 <= i <= n, then the leading minor of orderiofBis not positive definite. The factorization ofBcould not be completed and no eigenvalues or eigenvectors were computed. Total loss, no results, we're crying in the club π
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
subroutine zhpgvd πΈ
subroutine zhpgvd (integer ITYPE, character JOBZ, character UPLO, integer N,
complex*16, dimension( * ) AP, complex*16, dimension( * ) BP, double
precision, dimension( * ) W, complex*16, dimension( ldz, * ) Z, integer
LDZ, complex*16, dimension( * ) WORK, integer LWORK, double precision,
dimension( * ) RWORK, integer LRWORK, integer, dimension( * ) IWORK,
integer LIWORK, integer INFO)
ZHPGVD β¨
Purpose π¦
ZHPGVD computes all the eigenvalues and, optionally, the eigenvectors of a complex generalized Hermitian-definite eigenproblem, of the form A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. Here A and B are assumed to be Hermitian, stored in packed format, and B is also positive definite. If eigenvectors are desired, it uses a divide and conquer algorithm. Divide and conquer, literally the strategy of every group project survivor π
The divide and conquer algorithm makes very mild assumptions about floating point arithmetic. It will work on machines with a guard digit in add/subtract, or on those binary machines without guard digits which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2. It could conceivably fail on hexadecimal or decimal machines without guard digits, but we know of none. So like, probably fine, no cap π§
Parameters β
ITYPEβ INTEGER. Specifies the problem type to be solved:= 1:A*x = (lambda)*B*x= 2:A*B*x = (lambda)*x= 3:B*A*x = (lambda)*x
JOBZβ CHARACTER*1. Choose your fighter:= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors.
UPLOβ CHARACTER*1. Where the tea is stored:= 'U': Upper triangles ofAandBare stored;= 'L': Lower triangles ofAandBare stored.
Nβ INTEGER. The order of the matricesAandB.N >= 0.APβ COMPLEX*16 array, dimension(N*(N+1)/2). On entry, the upper or lower triangle of the Hermitian matrixA, packed columnwise in a linear array. The j-th column ofAis stored in the arrayAPas follows:- if
UPLO = 'U', thenAP(i + (j-1)*j/2) = A(i,j)for1<=i<=j; - if
UPLO = 'L', thenAP(i + (j-1)*(2*n-j)/2) = A(i,j)forj<=i<=n.
- if
On exit, the contents of AP are destroyed. RIP to your input π
BPβ COMPLEX*16 array, dimension(N*(N+1)/2). On entry, the upper or lower triangle of the Hermitian matrixB, packed columnwise in a linear array. The j-th column ofBis stored in the arrayBPas follows:- if
UPLO = 'U', thenBP(i + (j-1)*j/2) = B(i,j)for1<=i<=j; - if
UPLO = 'L', thenBP(i + (j-1)*(2*n-j)/2) = B(i,j)forj<=i<=n.
- if
On exit, the triangular factor U or L from the Cholesky factorization B = U**H*U or B = L*L**H, in the same storage format as B.
Wβ DOUBLE PRECISION array, dimension(N). IfINFO = 0, the eigenvalues in ascending order.Zβ COMPLEX*16 array, dimension(LDZ, N). IfJOBZ = 'V', then ifINFO = 0,Zcontains the matrixZof eigenvectors. The eigenvectors are normalized as follows:- if
ITYPE = 1or2, thenZ**H*B*Z = I; - if
ITYPE = 3, thenZ**H*inv(B)*Z = I.
- if
If JOBZ = 'N', then Z is not referenced.
LDZβ INTEGER. The leading dimension of the arrayZ.LDZ >= 1, and ifJOBZ = 'V',LDZ >= max(1,N).WORKβ COMPLEX*16 array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the requiredLWORK.LWORKβ INTEGER. The dimension of the arrayWORK:- If
N <= 1,LWORK >= 1. - If
JOBZ = 'N'andN > 1,LWORK >= N. - If
JOBZ = 'V'andN > 1,LWORK >= 2*N.
- If
If LWORK = -1, then a workspace query is assumed; the routine only calculates the required sizes 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. Sneaky little shortcut, love that for us π
RWORKβ DOUBLE PRECISION array, dimension(MAX(1,LRWORK)). On exit, ifINFO = 0,RWORK(1)returns the requiredLRWORK.LRWORKβ INTEGER. The dimension of arrayRWORK:- If
N <= 1,LRWORK >= 1. - If
JOBZ = 'N'andN > 1,LRWORK >= N. - If
JOBZ = 'V'andN > 1,LRWORK >= 1 + 5*N + 2*N**2.
- If
If LRWORK = -1, then a workspace query is assumed; the routine only calculates the required sizes 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 array, dimension(MAX(1,LIWORK)). On exit, ifINFO = 0,IWORK(1)returns the requiredLIWORK.LIWORKβ INTEGER. The dimension of arrayIWORK:- If
JOBZ = 'N'orN <= 1,LIWORK >= 1. - If
JOBZ = 'V'andN > 1,LIWORK >= 3 + 5*N.
- If
If LIWORK = -1, then a workspace query is assumed; the routine only calculates the required sizes 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.
INFOβ INTEGER:= 0: successful exit.< 0: ifINFO = -i, the i-th argument had an illegal value.> 0:ZPPTRForZHPEVDreturned an error code:<= N: ifINFO = i,ZHPEVDfailed to converge;ioff-diagonal elements of an intermediate tridiagonal form did not convergeto zero;> N: ifINFO = N + i, for1 <= i <= n, then the leading minor of orderiofBis not positive definite. The factorization ofBcould not be completed and no eigenvalues or eigenvectors were computed.
Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors: πΈ
- Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA
subroutine zhpgvx π¦
subroutine zhpgvx (integer ITYPE, character JOBZ, character RANGE, character
UPLO, integer N, complex*16, dimension( * ) AP, complex*16, dimension( *
) BP, double precision VL, double precision VU, integer IL, integer IU,
double precision ABSTOL, integer M, double precision, dimension( * ) W,
complex*16, dimension( ldz, * ) Z, integer LDZ, complex*16, dimension( *
) WORK, double precision, dimension( * ) RWORK, integer, dimension( * )
IWORK, integer, dimension( * ) IFAIL, integer INFO)
ZHPGVX β¨
Purpose π
ZHPGVX computes selected eigenvalues and, optionally, eigenvectors of a complex generalized Hermitian-definite eigenproblem, of the form A*x=(lambda)*B*x, A*Bx=(lambda)*x, or B*A*x=(lambda)*x. Here A and B are assumed to be Hermitian, stored in packed format, and B is also positive definite. Eigenvalues and eigenvectors can be selected by specifying either a range of values or a range of indices for the desired eigenvalues. Selective, picky, knows what she wants β that's the energy π
Parameters β
ITYPEβ
okay bestie we are in the home stretch, do not close the tab, the arguments are right here and we are going through every single one π
ITYPE
ITYPE is INTEGER
Specifies the problem type to be solved:
= 1: A*x = (lambda)*B*x
= 2: A*B*x = (lambda)*x
= 3: B*A*x = (lambda)*x
Pick your fighter, it changes literally everything downstream β¨
JOBZ
JOBZ is CHARACTER*1
= 'N'β Compute eigenvalues only;= 'V'β Compute eigenvalues and eigenvectors.
RANGE
RANGE is CHARACTER*1
= 'A'β all eigenvalues will be found;= 'V'β all eigenvalues in the half-open interval(VL,VU]will be found;= 'I'β theIL-th throughIU-th eigenvalues will be found.
UPLO
UPLO is CHARACTER*1
= 'U'β Upper triangles ofAandBare stored;= 'L'β Lower triangles ofAandBare stored.
N
N is INTEGER
The order of the matrices A and B. N >= 0. π«Ά
AP
AP is COMPLEX*16 array, dimension (N*(N+1)/2)
On entry, 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:
if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
if UPLO = 'L', AP(i + (j-1)*(2*n-j)/2) = A(i,j) for j<=i<=n.
On exit, the contents of AP are destroyed. gone. evaporated. do not go looking for your original matrix in there π
BP
BP is COMPLEX*16 array, dimension (N*(N+1)/2)
On entry, the upper or lower triangle of the Hermitian matrix B, packed columnwise in a linear array. The j-th column of B is stored in the array BP as follows:
if UPLO = 'U', BP(i + (j-1)*j/2) = B(i,j) for 1<=i<=j;
if UPLO = 'L', BP(i + (j-1)*(2*n-j)/2) = B(i,j) for j<=i<=n.
On exit, the triangular factor U or L from the Cholesky factorization B = U**H*U or B = L*L**H, in the same storage format as B. it got a whole glow-up π
VL
VL is DOUBLE PRECISION
If RANGE='V', the lower bound of the interval to be searched for eigenvalues. VL < VU.
Not referenced if RANGE = 'A' or 'I'.
VU
VU is DOUBLE PRECISION
If RANGE='V', the upper bound of the interval to be searched for eigenvalues. VL < VU.
Not referenced if RANGE = 'A' or 'I'.
IL
IL is INTEGER
If RANGE='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.
Not referenced if RANGE = 'A' or 'V'.
IU
IU is INTEGER
If RANGE='I', the index of the largest eigenvalue to be returned.
1 <= IL <= IU <= N, if N > 0; IL = 1 and IU = 0 if N = 0.
Not referenced if RANGE = 'A' or 'V'.
ABSTOL
ABSTOL is DOUBLE PRECISION
The 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 AP 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'). noted, bestie, we do not set it to zero, we set it to 2*DLAMCH('S') β
M
M is INTEGER
The total number of eigenvalues found. 0 <= M <= N.
If RANGE = 'A', M = N, and if RANGE = 'I', M = IU-IL+1.
W
W is DOUBLE PRECISION array, dimension (N)
On normal exit, the first M elements contain the selected eigenvalues in ascending order. sorted, as they should be π
Z
Z is COMPLEX*16 array, dimension (LDZ, N)
If JOBZ = 'N', then Z is not referenced.
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).
The eigenvectors are normalized as follows:
- if
ITYPE = 1or2,Z**H*B*Z = I; - if
ITYPE = 3,Z**H*inv(B)*Z = I.
If an eigenvector fails to converge, then that column of Z contains the latest approximation to the eigenvector, and the index of the eigenvector is returned in IFAIL.
Note: the user must ensure that at leastmax(1,M)columns are supplied in the arrayZ; ifRANGE = 'V', the exact value ofMis not known in advance and an upper bound must be used. read that twice, bestie, this is the one that bites people π
LDZ
LDZ is INTEGER
The leading dimension of the array Z. LDZ >= 1, and if JOBZ = 'V', LDZ >= max(1,N).
WORK
WORK is COMPLEX*16 array, dimension (2*N)
RWORK
RWORK is DOUBLE PRECISION array, dimension (7*N)
IWORK
IWORK is INTEGER array, dimension (5*N)
IFAIL
IFAIL is INTEGER array, dimension (N)
If JOBZ = 'V', then 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.
If JOBZ = 'N', then IFAIL is not referenced.
INFO
INFO is INTEGER
= 0β successful exit π< 0β ifINFO = -i, thei-th argument had an illegal value> 0βZPPTRForZHPEVXreturned an error code:<= Nβ ifINFO = i,ZHPEVXfailed to converge;ieigenvectors failed to converge. Their indices are stored in arrayIFAIL.> Nβ ifINFO = N + i, for1 <= i <= n, then the leading minor of orderiofBis not positive definite. The factorization ofBcould not be completed and no eigenvalues or eigenvectors were computed. nothing happened, no vibes, no results, just sadness π
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Contributors:
- Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA
Author
Generated automatically by Doxygen for LAPACK from the source code. yes bestie, the docs wrote themselves, that's the whole bit π€
and that's the whole page, you made it, I'm so proud of you π This masterpiece is Version 3.11.0, dated Sun Nov 27 2022 β go forth and compute your eigen-everything, bestie, you're literally the main character of numerical linear algebra now πβ¨π¦
π¦ where this page comes from
- debian bookworm: liblapack-doc 3.11.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms