hpgvd(3)
π NAME π
hpgvd β {hp,sp}gvd: eig, divide and conquer. Straight from the Library Functions Manual, bestie. π
β¨ SYNOPSIS β¨
π Functions π
CHPGVDβ the complex single-precision one:
subroutine chpgvd (itype, jobz, uplo, n, ap, bp, w, z, ldz, work, lwork,
rwork, lrwork, iwork, liwork, info)
DSPGVDβ the double-precision real symmetric one:
subroutine dspgvd (itype, jobz, uplo, n, ap, bp, w, z, ldz, work, lwork,
iwork, liwork, info)
SSPGVDβ the single-precision real symmetric one:
subroutine sspgvd (itype, jobz, uplo, n, ap, bp, w, z, ldz, work, lwork,
iwork, liwork, info)
ZHPGVDβ the complex double-precision one:
subroutine zhpgvd (itype, jobz, uplo, n, ap, bp, w, z, ldz, work, lwork,
rwork, lrwork, iwork, liwork, info)
πΈ Detailed Description πΈ
The full details are living in the function docs below, bestie. That's where the actual lore is. π
π¦ Function Documentation π¦
π subroutine chpgvd π
subroutine chpgvd (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, integer lwork, real, dimension( * ) rwork, integer lrwork,
integer, dimension( * ) iwork, integer liwork, integer info)
CHPGVD
π Purpose π
Okay so CHPGVD computes all the eigenvalues and, if you want them, the eigenvectors of a complex generalized Hermitian-definite eigenproblem. The form can be one of these:
A*x=(lambda)*B*xA*Bx=(lambda)*xB*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. It's giving efficient, honestly. π
π 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:'N': compute eigenvalues only;'V': compute eigenvalues and eigenvectors.
UPLOβCHARACTER*1:'U': upper triangles ofAandBare stored;'L': lower triangles ofAandBare stored.
NβINTEGER. The order of the matricesAandB.N >= 0.APβCOMPLEXarray, 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',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.
- if
On exit, the contents of AP are destroyed. π
BPβCOMPLEXarray, 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',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.
- 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βREALarray, dimension(N). IfINFO = 0, the eigenvalues in ascending order.ZβCOMPLEXarray, dimension(LDZ, N). IfJOBZ = 'V', then ifINFO = 0,Zcontains the matrixZof eigenvectors. The eigenvectors are normalized as follows:- if
ITYPE = 1or2,Z**H*B*Z = I; - if
ITYPE = 3,Z**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βCOMPLEXarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the requiredLWORK.LWORKβINTEGER. The dimension of arrayWORK.- If
N <= 1,LWORK >= 1. - If
JOBZ = 'N'andN > 1,LWORK >= N. - If
JOBZ = 'V'andN > 1,LWORK >= 2*N. - If
LWORK = -1, then a workspace query is assumed; the routine only calculates the required sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA.
- If
RWORKβREALarray, 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
LRWORK = -1, then a workspace query is assumed; the routine only calculates the required sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA.
- If
IWORKβINTEGERarray, 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
LIWORK = -1, then a workspace query is assumed; the routine only calculates the required sizes of theWORK,RWORKandIWORKarrays, returns these values as the first entries of theWORK,RWORKandIWORKarrays, and no error message related toLWORKorLRWORKorLIWORKis issued byXERBLA.
- If
INFOβINTEGER.= 0: successful exit.< 0: ifINFO = -i, the i-th argument had an illegal value.> 0:CPPTRForCHPEVDreturned an error code:<= N: ifINFO = i,CHPEVDfailed to converge;ioff-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 orderiofBis not positive. The factorization ofBcould not be completed and no eigenvalues or eigenvectors were computed. Not the vibe. π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Contributors: π
Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA
Definition at line 223 of file chpgvd.f.
π subroutine dspgvd π
subroutine dspgvd (integer itype, character jobz, character uplo, integer n,
double precision, dimension( * ) ap, double precision, dimension( * )
bp, double precision, dimension( * ) w, double precision, dimension(
ldz, * ) z, integer ldz, double precision, dimension( * ) work, integer
lwork, integer, dimension( * ) iwork, integer liwork, integer info)
DSPGVD
π Purpose π
DSPGVD computes all the eigenvalues, and optionally the eigenvectors, of a real generalized symmetric-definite eigenproblem. The form can be one of these:
A*x=(lambda)*B*xA*Bx=(lambda)*xB*A*x=(lambda)*x
Here A and B are assumed to be symmetric, stored in packed format, and B is also positive definite. If eigenvectors are desired, it uses a divide and conquer algorithm. Same energy, real symmetric flavor. β¨
π 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:'N': compute eigenvalues only;'V': compute eigenvalues and eigenvectors.
UPLOβCHARACTER*1:'U': upper triangles ofAandBare stored;'L': lower triangles ofAandBare stored.
NβINTEGER. The order of the matricesAandB.N >= 0.APβDOUBLE PRECISIONarray, dimension(N*(N+1)/2). On entry, the upper or lower triangle of the symmetric matrixA, packed columnwise in a linear array. The j-th column ofAis stored in the arrayAPas 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.
- if
On exit, the contents of AP are destroyed. π
BPβDOUBLE PRECISIONarray, dimension(N*(N+1)/2). On entry, the upper or lower triangle of the symmetric matrixB, packed columnwise in a linear array. The j-th column ofBis stored in the arrayBPas follows:- 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.
- if
On exit, the triangular factor U or L from the Cholesky factorization B = U**T*U or B = L*L**T, in the same storage format as B.
WβDOUBLE PRECISIONarray, dimension(N). IfINFO = 0, the eigenvalues in ascending order.ZZβ aDOUBLE PRECISIONarray, dimension(LDZ, N). IfJOBZ = 'V'andINFO = 0, this bad boy holds the eigenvector matrix Z. And bestie, the normalization is specific: ifITYPE = 1or2, thenZ**T*B*Z = I; ifITYPE = 3, thenZ**T*inv(B)*Z = I. IfJOBZ = 'N', then Z is literally not referenced β it's just vibing, unbothered. πLDZβINTEGER. The leading dimension of the arrayZ.LDZ >= 1, and ifJOBZ = 'V', thenLDZ >= max(1,N).WORKβDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the requiredLWORK. It's giving "I did the math so you don't have to" energy. β¨LWORKβINTEGER, the dimension of the arrayWORK. The rules, respectfully:- If
N <= 1,LWORK >= 1. - If
JOBZ = 'N'andN > 1,LWORK >= 2*N. - If
JOBZ = 'V'andN > 1,LWORK >= 1 + 6*N + 2*N**2.
- If
And if LWORK = -1, then a workspace query is assumed β the routine only calculates the required sizes of the WORK and IWORK arrays, returns these values as the first entries of the WORK and IWORK arrays, and no error message related to LWORK or LIWORK is issued by XERBLA. So like, a little sneak peek instead of a full computation. π«Ά
IWORKβINTEGERarray, dimension(MAX(1,LIWORK)). On exit, ifINFO = 0,IWORK(1)returns the requiredLIWORK.LIWORKβINTEGER, the dimension of the arrayIWORK. The tea:- 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 and IWORK arrays, returns these values as the first entries of the WORK and IWORK arrays, and no error message related to LWORK or LIWORK is issued by XERBLA.
INFOβINTEGER. The receipts:= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value> 0:DPPTRForDSPEVDreturned an error code:<= N: ifINFO = i,DSPEVDfailed 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. Rough. π
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA
Definition at line 202 of file dspgvd.f.
πΈ subroutine sspgvd πΈ
subroutine sspgvd (integer itype, character jobz, character uplo, integer n,
real, dimension( * ) ap, real, dimension( * ) bp, real, dimension( * )
w, real, dimension( ldz, * ) z, integer ldz, real, dimension( * ) work,
integer lwork, integer, dimension( * ) iwork, integer liwork, integer
info)
SSPGVD β ok so this is the single-precision bestie of the one above, same whole entire situation, different letter. π
Purpose:
SSPGVD computes all the eigenvalues, and optionally, the eigenvectors of a real generalized symmetric-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 symmetric, stored in packed format, and B is also positive definite. If eigenvectors are desired, it uses a divide and conquer algorithm. Iconic behavior, no notes. β¨
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:= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors.
UPLOβCHARACTER*1:= 'U': Upper triangles of A and B are stored;= 'L': Lower triangles of A and B are stored.
NβINTEGER. The order of the matrices A and B.N >= 0.APβREALarray, dimension(N*(N+1)/2). On entry, the upper or lower triangle of the symmetric matrix A, packed columnwise in a linear array. The j-th column of A is stored in the arrayAPas 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.
- if
On exit, the contents of AP are destroyed. Gone. Poof. π¦
BPβREALarray, dimension(N*(N+1)/2). On entry, the upper or lower triangle of the symmetric matrix B, packed columnwise in a linear array. The j-th column of B is stored in the arrayBPas follows:- 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.
- if
On exit, the triangular factor U or L from the Cholesky factorization B = U**T*U or B = L*L**T, in the same storage format as B. She transforms but she stays in the same outfit. π
WβREALarray, dimension(N). IfINFO = 0, the eigenvalues in ascending order. Sorted, as one should be. πZβREALarray, dimension(LDZ, N). IfJOBZ = 'V', then ifINFO = 0, Z contains the matrix Z of eigenvectors. The eigenvectors are normalized as follows: ifITYPE = 1or2,Z**T*B*Z = I; ifITYPE = 3,Z**T*inv(B)*Z = I. IfJOBZ = 'N', then Z is not referenced.LDZβINTEGER. The leading dimension of the array Z.LDZ >= 1, and ifJOBZ = 'V',LDZ >= max(1,N).WORKβREALarray, 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 >= 2*N. - If
JOBZ = 'V'andN > 1,LWORK >= 1 + 6*N + 2*N**2.
- If
If LWORK = -1, then a workspace query is assumed; the routine only calculates the required sizes of the WORK and IWORK arrays, returns these values as the first entries of the WORK and IWORK arrays, and no error message related to LWORK or LIWORK is issued by XERBLA.
IWORKβINTEGERarray, dimension(MAX(1,LIWORK)). On exit, ifINFO = 0,IWORK(1)returns the requiredLIWORK.LIWORKβINTEGER, the dimension of the 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 and IWORK arrays, returns these values as the first entries of the WORK and IWORK arrays, and no error message related to LWORK or LIWORK is issued by XERBLA.
INFOβINTEGER.= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value> 0:SPPTRForSSPEVDreturned an error code:<= N: ifINFO = i,SSPEVDfailed 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.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA
Definition at line 202 of file sspgvd.f.
π¦ 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 β now we're in complex double precision territory, and she brought extra workspace arrays with her because she's high maintenance in the most valid way possible. π
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.
Note the glow-up: this one says Hermitian, not symmetric β because complex numbers said "we do things differently here." π
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:= 'N': Compute eigenvalues only;= 'V': Compute eigenvalues and eigenvectors.
UPLOβCHARACTER*1:= 'U': Upper triangles of A and B are stored;= 'L': Lower triangles of A and B are stored.
NβINTEGER. The order of the matrices A and B.N >= 0.AP
π AP
AP is a COMPLEX*16 array, dimension (N*(N+1)/2). On entry, it holds 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 like this:
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 π so don't expect your data to still be there, bestie!
π¦ BP
BP is a COMPLEX*16 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 is stored in the array BP like this:
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, it contains 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
W is a DOUBLE PRECISION array, dimension (N). If INFO = 0, it holds the eigenvalues in ascending order. π
π Z
Z is a COMPLEX*16 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 = 1or2,Z**H*B*Z = I; - if
ITYPE = 3,Z**H*inv(B)*Z = I.
If JOBZ = 'N', then Z is not referenced at all. π
π§ LDZ
LDZ is INTEGER. It's the leading dimension of the array Z. LDZ >= 1, and if JOBZ = 'V', LDZ >= max(1,N). Slay that dimension check! π
π₯ WORK
WORK is a COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the required LWORK. π
β LWORK
LWORK is INTEGER. It's the dimension of the array WORK.
- If
N <= 1,LWORK >= 1. - If
JOBZ = 'N'andN > 1,LWORK >= N. - If
JOBZ = 'V'andN > 1,LWORK >= 2*N.
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. So don't freak out, it's just a query! π
π RWORK
RWORK is a DOUBLE PRECISION array, dimension (MAX(1,LRWORK)). On exit, if INFO = 0, RWORK(1) returns the required LRWORK. π«Ά
π LRWORK
LRWORK is INTEGER. It's the dimension of array RWORK.
- 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 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. Same vibe as LWORK, bestie! β¨
π IWORK
IWORK is INTEGER array, dimension (MAX(1,LIWORK)). On exit, if INFO = 0, IWORK(1) returns the required LIWORK. π
π LIWORK
LIWORK is INTEGER. It's the dimension of array IWORK.
- If
JOBZ = 'N'orN <= 1,LIWORK >= 1. - If
JOBZ = 'V'andN > 1,LIWORK >= 3 + 5*N.
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
INFO is INTEGER.
= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value π¬> 0: ZPPTRF or ZHPEVD returned an error code:<= N: ifINFO = i, ZHPEVD failed to converge; i off-diagonal elements of an intermediate tridiagonal form did not convergeto 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. π
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π«Ά Contributors:
Mark Fahey, Department of Mathematics, Univ. of Kentucky, USA
π Definition at line 223 of file zhpgvd.f.
β¨ Author
Generated automatically by Doxygen for LAPACK from the source code.
And that's a wrap, bestie! This iconic page is from LAPACK Version 3.12.0 and it's the hpgvd(3) man page. Stay slay, stay hermitian, and may your eigenvalues always converge! πβ¨π
π¦ 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