SRC/DEPRECATED/dgegv.f(3)
โจ SRC/DEPRECATED/dgegv.f โ Library Functions Manual โจ
okay bestie, buckle up ๐
this one's from the SRC/DEPRECATED/ folder and it is literally in the name: deprecated, babes. but we still stan her, so let's get into it ๐
๐ NAME ๐
SRC/DEPRECATED/dgegv.f
๐ธ SYNOPSIS ๐ธ
Functions/Subroutines
subroutine dgegv (jobvl, jobvr, n, a, lda, b, ldb, alphar, alphai, beta, vl, ldvl, vr, ldvr, work, lwork, info)โ DGEGV computes the eigenvalues and, optionally, the left and/or right eigenvectors of a real matrix pair (A,B).
๐ฆ Function/Subroutine Documentation ๐ฆ
subroutine dgegv (character jobvl, character jobvr, integer n, double precision, dimension( lda, * ) a, integer lda, double precision, dimension( ldb, * ) b, integer ldb, double precision, dimension( * ) alphar, double precision, dimension( * ) alphai, double precision, dimension( * ) beta, double precision, dimension( ldvl, * ) vl, integer ldvl, double precision, dimension( ldvr, * ) vr, integer ldvr, double precision, dimension( * ) work, integer lwork, integer info)
DGEGV computes the eigenvalues and, optionally, the left and/or right eigenvectors of a real matrix pair (A,B). periodt โจ
๐ฅ Purpose ๐ฅ
okay so real talk first, bestie, and i need you to hear me:
!> This routine is deprecated and has been replaced by routine DGGEV.
like, she's iconic but she's retired ๐ go use DGGEV instead, mwah.
now the actual math, and it's giving main character energy:
DGEGV computes the eigenvalues and, optionally, the left and/or right eigenvectors of a real matrix pair (A,B). Given two square matrices A and B, the generalized nonsymmetric eigenvalue problem (GNEP) is to find the eigenvalues lambda and corresponding (non-zero) eigenvectors x such that
A*x = lambda*B*x.
An alternate form is to find the eigenvalues mu and corresponding eigenvectors y such that
mu*A*y = B*y.
These two forms are equivalent with mu = 1/lambda and x = y if neither lambda nor mu is zero. In order to deal with the case that lambda or mu is zero or small, two values alpha and beta are returned for each eigenvalue, such that lambda = alpha/beta and mu = beta/alpha. ๐ซ
The vectors x and y in the above equations are right eigenvectors of the matrix pair (A,B). Vectors u and v satisfying
u**H*A = lambda*u**H*B or mu*v**H*A = v**H*B
are left eigenvectors of (A,B). slay ๐ซถ
Note: this routine performs on A and B โ yes, that sentence is literally just like that in the original, i'm not gaslighting you, the note is cut off mid-thought ๐
๐ Parameters ๐
JOBVL
!> JOBVL is CHARACTER*1
!> = 'N': do not compute the left generalized eigenvectors;
!> = 'V': compute the left generalized eigenvectors (returned
!> in VL).
so <italic>N</italic> is a no-thanks on the left eigenvectors, <italic>V</italic> is yes please, send them to VL ๐
JOBVR
!> JOBVR is CHARACTER*1
!> = 'N': do not compute the right generalized eigenvectors;
!> = 'V': compute the right generalized eigenvectors (returned
!> in VR).
same vibe check, but for the right eigenvectors this time โ <italic>N</italic> skip, <italic>V</italic> compute and drop them in VR โจ
N
!> N is INTEGER
!> The order of the matrices A, B, VL, and VR. N >= 0.
the order of A, B, VL, and VR, and she's gotta be N >= 0 โ no negatives, we don't do that here ๐
A
!> A is DOUBLE PRECISION array, dimension (LDA, N)
!> On entry, the matrix A.
!> If JOBVL = 'V' or JOBVR = 'V', then on exit A
!> contains the real Schur form of A from the generalized Schur
!> factorization of the pair (A,B) after balancing.
!> If no eigenvectors were computed, then only the diagonal
!> blocks from the Schur form will be correct. See DGGHRD and
!> DHGEQZ for details.
she comes in as plain old matrix A, but if JOBVL = 'V' or JOBVR = 'V' she leaves as the real Schur form of A from the generalized Schur factorization of the pair (A,B) after balancing. and if you didn't ask for eigenvectors? then only the diagonal blocks from the Schur form will be correct, so don't come for her ๐ญ peep DGGHRD and DHGEQZ for the deets.
LDA
!> LDA is INTEGER
!> The leading dimension of A. LDA >= max(1,N).
the leading dimension of A, and she must satisfy LDA >= max(1,N) ๐
B
!> B is DOUBLE PRECISION array, dimension (LDB, N)
!> On entry, the matrix B.
!> If JOBVL = 'V' or JOBVR = 'V', then on exit B contains the
!> upper triangular matrix obtained from B in the generalized
!> Schur factorization of the pair (A,B) after balancing.
!> If no eigenvectors were computed, then only those elements of
!> B corresponding to the diagonal blocks from the Schur form of
!> A will be correct. See DGGHRD and DHGEQZ for details.
enters as matrix B, exits as the upper triangular matrix obtained from B in the generalized Schur factorization of the pair (A,B) after balancing (same JOBVL = 'V' or JOBVR = 'V' situation as A, bestie). no eigenvectors computed? then only those elements of B corresponding to the diagonal blocks from the Schur form of A will be correct. DGGHRD and DHGEQZ again if you're nosy ๐ฆ
LDB
!> LDB is INTEGER
!> The leading dimension of B. LDB >= max(1,N).
leading dimension of B, LDB >= max(1,N), no exceptions ๐ธ
ALPHAR
!> ALPHAR is DOUBLE PRECISION array, dimension (N)
!> The real parts of each scalar alpha defining an eigenvalue of
!> GNEP.
the real parts of each scalar alpha defining an eigenvalue of GNEP โ the real ones ๐
ALPHAI
!> ALPHAI is DOUBLE PRECISION array, dimension (N)
!> The imaginary parts of each scalar alpha defining an
!> eigenvalue of GNEP. If ALPHAI(j) is zero, then the j-th
!> eigenvalue is real; if positive, then the j-th and
!> (j+1)-st eigenvalues are a complex conjugate pair, with
!> ALPHAI(j+1) = -ALPHAI(j).
the imaginary parts, and this is where it gets spicy ๐ฅ if ALPHAI(j) is zero, then the j-th eigenvalue is real. if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with ALPHAI(j+1) = -ALPHAI(j). cute little duo, we love a matched set ๐ซถ
BETA
!> BETA is DOUBLE PRECISION array, dimension (N)
!> The scalars beta that define the eigenvalues of GNEP.
!>
!> Together, the quantities alpha = (ALPHAR(j),ALPHAI(j)) and
!> beta = BETA(j) represent the j-th eigenvalue of the matrix
!> pair (A,B), in one of the forms lambda = alpha/beta or
!> mu = beta/alpha. Since either lambda or mu may overflow,
!> they should not, in general, be computed.
the scalars beta defining the eigenvalues of GNEP. together, the quantities alpha = (ALPHAR(j),ALPHAI(j)) and beta = BETA(j) represent the j-th eigenvalue of the matrix pair (A,B), in one of the forms lambda = alpha/beta or mu = beta/alpha.
โ ๏ธ okay important, bestie: since either lambda or mu may overflow, they should not, in general, be computed. like, do not try it. i'm serious. ๐
VL
!> VL is DOUBLE PRECISION array, dimension (LDVL,N)
!> If JOBVL = 'V', the left eigenvectors u(j) are stored
!> in the columns of VL, in the same order as their eigenvalues.
!> If the j-th eigenvalue is real, then u(j) = VL(:,j).
!> If the j-th and (j+1)-st eigenvalues form a complex conjugate
!> pair, then
!> u(j) = VL(:,j) + i*VL(:,j+1)
!> and
!> u(j+1) = VL(:,j) - i*VL(:,j+1).
!>
!> Each eigenvector is scaled so that its largest component has
!> abs(real part) + abs(imag. part) = 1, except for eigenvectors
!> corresponding to an eigenvalue with alpha = beta = 0, which
!> are set to zero.
!> Not referenced if JOBVL = 'N'.
if JOBVL = 'V', the left eigenvectors u(j) are stored in the columns of VL, in the same order as their eigenvalues. real j-th eigenvalue? then u(j) = VL(:,j). complex conjugate pair for j-th and (j+1)-st? then
u(j) = VL(:,j) + i*VL(:,j+1)
and
u(j+1) = VL(:,j) - i*VL(:,j+1).
each eigenvector is scaled so that its largest component has abs(real part) + abs(imag. part) = 1 โ except eigenvectors corresponding to an eigenvalue with alpha = beta = 0, which are set to zero (they get nothing, they get zero, iconic honestly). not referenced if JOBVL = 'N' ๐
LDVL
!> LDVL is INTEGER
!> The leading dimension of the matrix VL. LDVL >= 1, and
!> if JOBVL = 'V', LDVL >= N.
leading dimension of VL: LDVL >= 1, and if JOBVL = 'V', then LDVL >= N โจ
VR
!> VR is DOUBLE PRECISION array, dimension (LDVR,N)
!> If JOBVR = 'V', the right eigenvectors x(j) are stored
!> in the columns of VR, in the same order as their eigenvalues.
!> If the j-th eigenvalue is real, then x(j) = VR(:,j).
!> If the j-th and (j+1)-st eigenvalues form a complex conjugate
!> pair, then
!> x(j) = VR(:,j) + i*VR(:,j+1)
!> and
!> x(j+1) = VR(:,j) - i*VR(:,j+1).
!>
!> Each eigenvector is scaled so that its largest component has
!> abs(real part) + abs(imag. part) = 1, except for eigenvalues
!> corresponding to an eigenvalue with alpha = beta = 0, which
!> are set to zero.
!> Not referenced if JOBVR = 'N'.
mirror mirror on the wall, it's VL's twin ๐ช if JOBVR = 'V', the right eigenvectors x(j) are stored in the columns of VR, same order as their eigenvalues. real j-th eigenvalue โ x(j) = VR(:,j). complex conjugate pair โ
x(j) = VR(:,j) + i*VR(:,j+1)
and
x(j+1) = VR(:,j) - i*VR(:,j+1).
each eigenvector is scaled so that its largest component has abs(real part) + abs(imag. part) = 1, except for eigenvalues corresponding to an eigenvalue with alpha = beta = 0, which are set to zero. not referenced if JOBVR = 'N' ๐
LDVR
!> LDVR is INTEGER
!> The leading dimension of the matrix VR. LDVR >= 1, and
!> if JOBVR = 'V', LDVR >= N.
leading dimension of VR: LDVR >= 1, and if JOBVR = 'V', then LDVR >= N โญ
WORK
!> WORK is DOUBLE PRECISION array, dimension (MAX(1,LWORK))
!> On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
dimension (MAX(1,LWORK)), and on exit, if INFO = 0, then WORK(1) returns the optimal LWORK โ she's a little messenger girlie ๐
LWORK
!> LWORK is INTEGER
!> The dimension of the array WORK. LWORK >= max(1,8*N).
!> For good performance, LWORK must generally be larger.
!> To compute the optimal value of LWORK, call ILAENV to get
!> blocksizes (for DGEQRF, DORMQR, and DORGQR.) Then compute:
!> NB -- MAX of the blocksizes for DGEQRF, DORMQR, and DORGQR;
!> The optimal LWORK is:
!> 2*N + MAX( 6*N, N*(NB+1) ).
!>
!> 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.
the dimension of the array WORK, and she needs LWORK >= max(1,8*N). for good performance, LWORK must generally be larger (yes, generally, don't @ me). ๐ซถ
to compute the optimal value of LWORK, call ILAENV to get blocksizes (for DGEQRF, DORMQR, and DORGQR.) Then compute:
NB -- MAX of the blocksizes for DGEQRF, DORMQR, and DORGQR;
the optimal LWORK is:
2*N + MAX( 6*N, N*(NB+1) ).
and here's the cute shortcut ๐ 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. she's just peeking, not committing, we respect it ๐
INFO
!> INFO is INTEGER
!> = 0: successful exit
!> < 0: if INFO = -i, the i-th argument had an illegal value.
!> = 1,...,N:
!> The QZ iteration failed. No eigenvectors have been
!> calculated, but ALPHAR(j), ALPHAI(j), and BETA(j)
!> should be correct for j=INFO+1,...,N.
!> > N: errors that usually indicate LAPACK problems:
!> =N+1: error return from DGGBAL
!> =N+2: error return from DGEQRF
!> =N+3: error return from DORMQR
!> =N+4: error return from DORGQR
!> =N+5: error return from DGGHRD
!> =N+6: error return from DHGEQZ (other than failed
!> iteration)
!> =N+7: error return from DTGEVC
!> =N+8: error return from DGGBAK (computing VL)
!> =N+9: error return from DGGBAK (computing VR)
!> =N+10: error return from DLASCL (various calls)
the whole mood ring of exit codes, let's go ๐ฎ
= 0: successful exit, we love a happy ending ๐< 0: ifINFO = -i, the i-th argument had an illegal value โ you did that, not her ๐= 1,...,N: The QZ iteration failed. No eigenvectors have been calculated, butALPHAR(j),ALPHAI(j), andBETA(j)should be correct forj=INFO+1,...,N. partial credit, honestly ๐ญ> N: errors that usually indicate LAPACK problems:=N+1: error return fromDGGBAL=N+2: error return fromDGEQRF=N+3: error return fromDORMQR=N+4: error return fromDORGQR=N+5: error return fromDGGHRD=N+6: error return fromDHGEQZ(other than failed iteration)=N+7: error return fromDTGEVC=N+8: error return fromDGGBAK(computing VL)=N+9: error return fromDGGBAK(computing VR)=N+10: error return fromDLASCL(various calls)
๐ Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the whole squad, we thank them for their service ๐ซก๐
โญ Further Details: โญ
โฆand that's literally it, bestie โ the section header is there and the page just moves on ๐ฆ
โจ Balancing โจ
okay so bestie, this driver literally calls DGGBAL to both permute and scale rows and columns of A and B โ she's doing the most and we love her for it ๐
. The permutations PL and PR are chosen so that PL*A*PR and PL*B*R will be upper triangular except for the diagonal blocks A(i:j,i:j) and B(i:j,i:j), with i and j as close together as possible. The diagonal scaling matrices DL and DR are chosen so that the pair DL*PL*A*PR*DR, DL*PL*B*PR*DR have elements close to one (except for the elements that start out zero.) No cap, that's the whole balancing vibe โจ.
After the eigenvalues and eigenvectors of the balanced matrices have been computed, DGGBAK transforms the eigenvectors back to what they would have been (in perfect arithmetic) if they had not been balanced. It's giving restoration arc ๐ซถ.
๐ธ Contents of A and B on Exit ๐ธ
If any eigenvectors are computed (either JOBVL='V' or JOBVR='V' or both), then on exit the arrays A and B will contain the real Schur form[*] of the versions of A and B. If no eigenvectors are computed, then only the diagonal blocks will be correct. lowkey important, highkey iconic ๐ญ.
[*] See DHGEQZ, DGEGS, or read the book , by Golub & van Loan, pub. by Johns Hopkins U. Press.
Definition at line 304 of file dgegv.f.
Author
Generated automatically by Doxygen for LAPACK from the source code.
and that's the tea: this page is from LAPACK Version 3.12.0, file SRC/DEPRECATED/dgegv.f(3) โ periodt ๐
โจ
๐ฆ 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