/home/abui...RC/zhegv.f(3)

πŸ“¦ version 3.12.0, in opensuse-leap 16.0

πŸŽ€ 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*x
  • A*Bx=(lambda)*x
  • B*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, where NB is the blocksize for ZHETRD returned by ILAENV. (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: if INFO = -i, the i-th argument had an illegal value
  • > 0: ZPOTRF or ZHEEV returned an error code:
    • <= N: if INFO = i, ZHEEV failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not converge to zero;
    • > N: if INFO = N + i, for 1 <= 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