SRC/chpgv.f(3)
π SRC/chpgv.f β like, the chpgv era π«Ά
okay bestie, welcome to the chpgv page from the LAPACK Library Functions Manual β¨ this is a Fortran subroutine page and honestly it's giving main character energy for anyone doing generalized Hermitian-definite eigenproblems. sit down, grab a strawberry π, we're doing this.
πΈ SYNOPSIS πΈ
Functions/Subroutines
subroutine chpgv (itype, jobz, uplo, n, ap, bp, w, z, ldz, work, rwork,
info)
it's CHPGV, no cap π₯
β¨ Function/Subroutine Documentation β¨
subroutine chpgv (integer itype, character jobz, character uplo, integer n, complex, dimension( * ) ap, complex, dimension( * ) bp, real, dimension( * ) w, complex, dimension( ldz, * ) z, integer ldz, complex, dimension( * ) work, real, dimension( * ) rwork, integer info)
so that's CHPGV β same name, now with the whole squad of arguments π
π Purpose π
!>
!> CHPGV 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.
!>
so like, CHPGV gives you all the eigenvalues and, if you want them, the eigenvectors too β for a complex generalized Hermitian-definite eigenproblem. the three flavors are A*x=(lambda)*B*x, A*Bx=(lambda)*x, and B*A*x=(lambda)*x. A and B are assumed Hermitian and packed, and B also has to be positive definite. periodt π
π Parameters π
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
!>
ITYPE is an INTEGER and it picks which problem type you're solving, iykyk:
= 1:A*x = (lambda)*B*x= 2:A*B*x = (lambda)*x= 3:B*A*x = (lambda)*x
JOBZ
!> JOBZ is CHARACTER*1
!> = 'N': Compute eigenvalues only;
!> = 'V': Compute eigenvalues and eigenvectors.
!>
JOBZ is CHARACTER*1 β do you want just the eigenvalues or the whole package?
= 'N': eigenvalues only, minimal effort, respect= 'V': eigenvalues and eigenvectors, go off π
UPLO
!> UPLO is CHARACTER*1
!> = 'U': Upper triangles of A and B are stored;
!> = 'L': Lower triangles of A and B are stored.
!>
UPLO is CHARACTER*1 and it tells us which triangle you actually stored:
= 'U': the upper triangles ofAandBare stored= 'L': the lower triangles ofAandBare stored
N
!> N is INTEGER
!> The order of the matrices A and B. N >= 0.
!>
N is an INTEGER β the order of the matrices A and B. and N >= 0, fr fr.
AP
!> AP is COMPLEX 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.
!>
AP is a COMPLEX array, dimension (N*(N+1)/2). on entry it's the upper or lower triangle of the Hermitian matrix A, packed columnwise in a linear array. the j-th column of A lives in AP like this:
- 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, the contents of AP are destroyed. not me warning you twice β bestie, save your data before you call this π
BP
!> BP is COMPLEX 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.
!>
BP is a COMPLEX array, dimension (N*(N+1)/2). on entry it holds the upper or lower triangle of the Hermitian matrix B, packed columnwise in a linear array. the j-th column of B sits in BP like so:
- if
UPLO = 'U',BP(i + (j-1)*j/2) = B(i,j)for1<=i<=j; - if
UPLO = 'L',BP(i + (j-1)*(2*n-j)/2) = B(i,j)forj<=i<=n.
on exit it gets rewritten as 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. glow-up tbh π¦
W
!> W is REAL array, dimension (N)
!> If INFO = 0, the eigenvalues in ascending order.
!>
W is a REAL array, dimension (N). if INFO = 0, these are the eigenvalues, in ascending order β¨ (organized queen behavior)
Z
!> Z is COMPLEX array, dimension (LDZ, N)
!> If JOBZ = 'V', then if INFO = 0, Z contains the matrix Z of
!> eigenvectors. The eigenvectors are normalized as follows:
!> if ITYPE = 1 or 2, Z**H*B*Z = I;
!> if ITYPE = 3, Z**H*inv(B)*Z = I.
!> If JOBZ = 'N', then Z is not referenced.
!>
Z is a COMPLEX array, dimension (LDZ, N). if JOBZ = 'V' and INFO = 0, Z contains the matrix Z of eigenvectors, normalized like this:
- if
ITYPE = 1or2,Z**H*B*Z = I; - if
ITYPE = 3,Z**H*inv(B)*Z = I.
ifJOBZ = 'N', thenZis not referenced at all. she's literally not invited to the function call π
LDZ
!> LDZ is INTEGER
!> The leading dimension of the array Z. LDZ >= 1, and if
!> JOBZ = 'V', LDZ >= max(1,N).
!>
LDZ is an INTEGER β the leading dimension of the array Z. constraints: LDZ >= 1, and if JOBZ = 'V', then LDZ >= max(1,N). respect the bounds or the compiler will come for you π
WORK
!> WORK is COMPLEX array, dimension (max(1, 2*N-1))
!>
WORK is a COMPLEX array, dimension (max(1, 2*N-1)). it's the workspace, it's doing its thing π§
RWORK
!> RWORK is REAL array, dimension (max(1, 3*N-2))
!>
RWORK is a REAL array, dimension (max(1, 3*N-2)). the real-valued workspace counterpart, she's matching vibes with WORK π
INFO
!> INFO is INTEGER
!> = 0: successful exit
!> < 0: if INFO = -i, the i-th argument had an illegal value
!> > 0: CPPTRF or CHPEV returned an error code:
!> <= N: if INFO = i, CHPEV failed to converge;
!> i off-diagonal elements of an intermediate
!> tridiagonal form did not convergeto 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.
!>
INFO is an INTEGER and it's the vibe check at the end:
= 0: successful exit, we ate π< 0: ifINFO = -i, the i-th argument had an illegal value β somebody passed something cursed> 0:CPPTRForCHPEVreturned an error code:<= N: ifINFO = i,CHPEVfailed to converge;ioff-diagonal elements of an intermediate tridiagonal form did not converge to zero (yes, the original says "convergeto" β we keep it exactly, character for character π )> N: ifINFO = N + i, for1 <= i <= n, then the leading principal minor of orderiofBis not positive. the factorization ofBcould not be completed and no eigenvalues or eigenvectors were computed. worst case scenario, honestly π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
legendary lineup, no notes π
Definition at line 163 of file chpgv.f.
π¦ Author π¦
Generated automatically by Doxygen for LAPACK from the source code. (the robots wrote this one, and honestly they slayed)
okay bestie that's the whole page π«Ά this was LAPACK, Version 3.12.0, SRC/chpgv.f(3) β go forth and compute those eigenvalues, and remember: back up AP before you do πΈβ¨π
π¦ where this page comes from
- arch rolling: lapack-doc 3.12.1-2 Β· custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms