/home/abui...RC/zhegv.f(3)
π NAME π
okay bestie so this whole page is about /home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/zhegv.f β that's the LAPACK source file, and everything below is describing what lives inside it. it's a man page from the Library Functions Manual section, generated for the file at /home/abui...RC/zhegv.f, and honestly? iconic.
β¨ SYNOPSIS β¨
π§ Functions/Subroutines
subroutine ZHEGV (itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork, rwork, info)β literally the whole subroutine, right here, one line:
subroutine ZHEGV (itype, jobz, uplo, n, a, lda, b, ldb, w, work, lwork,
rwork, info)
β¦and it's called ZHEGV, which is also the answer to "what's it called?" π
π Function/Subroutine Documentation π
πΈ The full signature (no cap, every type)
subroutine ZHEGV (integer itype, character jobz, character uplo, integer n,
complex*16, dimension( lda, * ) a, integer lda, complex*16, dimension(
ldb, * ) b, integer ldb, double precision, dimension( * ) w, complex*16,
dimension( * ) work, integer lwork, double precision, dimension( * )
rwork, integer info)
and yes, it's named ZHEGV. again. because the man page said so. π
π¦ Purpose
okay so here's the vibe: ZHEGV computes all the eigenvalues, and optionally the eigenvectors too, of a complex generalized Hermitian-definite eigenproblem. the three forms it handles are:
A*x=(lambda)*B*xA*Bx=(lambda)*xB*A*x=(lambda)*x
and in every single one of those, A and B are assumed to be Hermitian, and B is also assumed to be positive definite. that's the whole deal. that's the assignment. periodt. π₯
π§ Parameters
ITYPE
it's an INTEGER, and it picks which problem type you're solving, bestie:
= 1:A*x = (lambda)*B*x= 2:A*B*x = (lambda)*x= 3:B*A*x = (lambda)*x
JOBZ
JOBZ is CHARACTER*1 and it's basically the "do you want the whole package or just the eigenvalues" switch:
= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors.
UPLO
UPLO is CHARACTER*1 β where's the data stored, babes:
= 'U': Upper triangles of A and B are stored;= 'L': Lower triangles of A and B are stored.
N
N is INTEGER β the order of the matrices A and B. and the rule is N >= 0. that's it, that's the constraint. π«Ά
A
A is COMPLEX*16 array, dimension (LDA, N)
on entry, it's the Hermitian matrix A. if UPLO = 'U', the leading N-by-N upper triangular part of A contains the upper triangular part of the matrix A. if UPLO = 'L', the leading N-by-N lower triangular part of A contains the lower triangular part of the matrix A.
on exit, if JOBZ = 'V', then if INFO = 0, A contains the matrix Z of eigenvectors. the eigenvectors are normalized like this:
- if
ITYPE = 1 or 2,Z**H*B*Z = I; - if
ITYPE = 3,Z**H*inv(B)*Z = I.
and if JOBZ = 'N', then on exit the upper triangle (if UPLO='U') or the lower triangle (if UPLO='L') of A, including the diagonal, is destroyed. π so like. don't need it after? cool. need it after? too bad.
LDA
LDA is INTEGER β the leading dimension of the array A, and it must be LDA >= max(1,N). no exceptions, bestie.
B
B is COMPLEX*16 array, dimension (LDB, N)
on entry, it's the Hermitian positive definite matrix B. if UPLO = 'U', the leading N-by-N upper triangular part of B contains the upper triangular part of the matrix B. if UPLO = 'L', the leading N-by-N lower triangular part of B contains the lower triangular part of the matrix B.
on exit, if INFO <= N, the part of B containing the matrix is overwritten by the triangular factor U or L from the Cholesky factorization B = U**H*U or B = L*L**H. so B kinda gets a glow-up into its Cholesky era β¨
LDB
LDB is INTEGER β the leading dimension of the array B, and it has to be LDB >= max(1,N). same energy as LDA, different letter.
W
W is DOUBLE PRECISION array, dimension (N) β and if INFO = 0, these are your eigenvalues, in ascending order. sorted, tidy, main character energy. π
WORK
WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)) β and on exit, if INFO = 0, WORK(1) returns the optimal LWORK. it's a little sneak peek into how much workspace you actually should've given it.
LWORK
LWORK is INTEGER β the length of the array WORK. requirements:
LWORK >= max(1,2*N-1)(the bare minimum, the "we're surviving" level)- for optimal efficiency,
LWORK >= (NB+1)*N, whereNBis the blocksize forZHETRDreturned byILAENV. (the "thriving, not just surviving" level π¦)
and here's the fun part: if LWORK = -1, then a workspace query is assumed. the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. so -1 is the "just tell me how much room I need, don't yell at me" mode. π
RWORK
RWORK is DOUBLE PRECISION array, dimension (max(1, 3*N-2)) β that's the whole description. that's it. it's a real workspace and it knows what it is.
INFO
INFO is INTEGER, the final report card:
= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value> 0:ZPOTRForZHEEVreturned an error code:<= N: ifINFO = i,ZHEEVfailed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero;> N: ifINFO = N + i, for1 <= i <= N, then the leading principal minor of order i of B is not positive. the factorization of B could not be completed and no eigenvalues or eigenvectors were computed. π absolute tragedy, nothing got computed.
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
and this whole thing lives at Definition at line 179 of file zhegv.f. π
π Author (the meta one)
Generated automatically by Doxygen for LAPACK from the source code. yes, the docs wrote themselves. we love an independent queen. β¨
okay that's the whole page bestie, no cap, nothing skipped. this was LAPACK, Version 3.12.0, from /home/abui...RC/zhegv.f(3) β go forth and solve those generalized Hermitian-definite eigenproblems! πππ
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms