complex16GEeigen(3)
π complex16GEeigen β LAPACK π
okay bestie, sit down, hydrate, because this is the complex16GEeigen(3) page and it's a whole group of LAPACK driver routines. Think of it as the group chat for complex16 eigenvalue driver functions for GE matrices. Ten routines, all in one family, all doing the eigenvalues/Schur/vector thing. Let's go π¦
β¨ NAME β¨
complex16GEeigen β complex16 πΈ
π SYNOPSIS π
Functions
zgees
subroutine zgees (JOBVS, SORT, SELECT, N, A, LDA, SDIM, W, VS, LDVS,
WORK, LWORK, RWORK, BWORK, INFO)
ZGEES computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices π
zgeesx
subroutine zgeesx (JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM, W, VS,
LDVS, RCONDE, RCONDV, WORK, LWORK, RWORK, BWORK, INFO)
ZGEESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices β¨
zgeev
subroutine zgeev (JOBVL, JOBVR, N, A, LDA, W, VL, LDVL, VR, LDVR, WORK,
LWORK, RWORK, INFO)
ZGEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices πΈ
zgeevx
subroutine zgeevx (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, W, VL, LDVL,
VR, LDVR, ILO, IHI, SCALE, ABNRM, RCONDE, RCONDV, WORK, LWORK,
RWORK, INFO)
ZGEEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices π¦
zgges
subroutine zgges (JOBVSL, JOBVSR, SORT, SELCTG, N, A, LDA, B, LDB, SDIM,
ALPHA, BETA, VSL, LDVSL, VSR, LDVSR, WORK, LWORK, RWORK, BWORK,
INFO)
ZGGES computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices π
zgges3
subroutine zgges3 (JOBVSL, JOBVSR, SORT, SELCTG, N, A, LDA, B, LDB,
SDIM, ALPHA, BETA, VSL, LDVSL, VSR, LDVSR, WORK, LWORK, RWORK,
BWORK, INFO)
ZGGES3 computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices (blocked algorithm) π₯
zggesx
subroutine zggesx (JOBVSL, JOBVSR, SORT, SELCTG, SENSE, N, A, LDA, B,
LDB, SDIM, ALPHA, BETA, VSL, LDVSL, VSR, LDVSR, RCONDE, RCONDV,
WORK, LWORK, RWORK, IWORK, LIWORK, BWORK, INFO)
ZGGESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices π
zggev
subroutine zggev (JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHA, BETA, VL,
LDVL, VR, LDVR, WORK, LWORK, RWORK, INFO)
ZGGEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices π
zggev3
subroutine zggev3 (JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHA, BETA, VL,
LDVL, VR, LDVR, WORK, LWORK, RWORK, INFO)
ZGGEV3 computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices (blocked algorithm) β
zggevx
subroutine zggevx (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, B, LDB,
ALPHA, BETA, VL, LDVL, VR, LDVR, ILO, IHI, LSCALE, RSCALE, ABNRM,
BBNRM, RCONDE, RCONDV, WORK, LWORK, RWORK, IWORK, BWORK, INFO)
ZGGEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices π
π Detailed Description π
This is the group of complex16 eigenvalue driver functions for GE matrices π
π Function Documentation π
subroutine zgees
subroutine zgees (character JOBVS, character SORT, external SELECT, integer
N, complex*16, dimension( lda, * ) A, integer LDA, integer SDIM,
complex*16, dimension( * ) W, complex*16, dimension( ldvs, * ) VS,
integer LDVS, complex*16, dimension( * ) WORK, integer LWORK, double
precision, dimension( * ) RWORK, logical, dimension( * ) BWORK, integer
INFO)
ZGEES computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices π
Purpose
ZGEES computes for an N-by-N complex nonsymmetric matrix A, the eigenvalues, the Schur form T, and, optionally, the matrix of Schur vectors Z. This gives the Schur factorization A = Z*T*(Z**H). β¨
Optionally, it also orders the eigenvalues on the diagonal of the Schur form so that selected eigenvalues are at the top left. The leading columns of Z then form an orthonormal basis for the invariant subspace corresponding to the selected eigenvalues.
A complex matrix is in Schur form if it is upper triangular. no cap π
Parameters
JOBVSJOBVSisCHARACTER*1= 'N': Schur vectors are not computed;= 'V': Schur vectors are computed.
SORTSORTisCHARACTER*1- Specifies whether or not to order the eigenvalues on the diagonal of the Schur form.
= 'N': Eigenvalues are not ordered:= 'S': Eigenvalues are ordered (seeSELECT).
SELECTSELECTis aLOGICAL FUNCTIONof oneCOMPLEX*16argumentSELECTmust be declaredEXTERNALin the calling subroutine.- If
SORT = 'S',SELECTis used to select eigenvalues to order to the top left of the Schur form. - IF
SORT = 'N',SELECTis not referenced. - The eigenvalue
W(j)is selected ifSELECT(W(j))is true.
NNisINTEGER- The order of the matrix A.
N >= 0.
AAisCOMPLEX*16array, dimension(LDA,N)- On entry, the N-by-N matrix A.
- On exit, A has been overwritten by its Schur form T. π (yes bestie, it gets rewritten, that's the vibe)
LDALDAisINTEGER- The leading dimension of the array A.
LDA >= max(1,N).
SDIMSDIMisINTEGER- If
SORT = 'N',SDIM = 0. - If
SORT = 'S',SDIM = number of eigenvalues for which SELECT is true.
WWisCOMPLEX*16array, dimension(N)- W contains the computed eigenvalues, in the same order that they appear on the diagonal of the output Schur form T. π
VSVSisCOMPLEX*16array, dimension(LDVS,N)- If
JOBVS = 'V', VS contains the unitary matrix Z of Schur vectors. - If
JOBVS = 'N', VS is not referenced.
LDVSLDVSisINTEGER- The leading dimension of the array VS.
LDVS >= 1; ifJOBVS = 'V',LDVS >= N.
WORKWORKisCOMPLEX*16array, dimension(MAX(1,LWORK))- On exit, if
INFO = 0,WORK(1)returns the optimalLWORK.
LWORKLWORKisINTEGER- The dimension of the array WORK.
LWORK >= max(1,2*N). - For good performance, LWORK must generally be larger.
- 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 byXERBLA.
RWORKRWORKisDOUBLE PRECISIONarray, dimension(N)
BWORKBWORKisLOGICALarray, dimension(N)- Not referenced if
SORT = 'N'.
INFOINFOisINTEGER= 0: successful exit< 0: ifINFO = -i, the i-th argument had an illegal value.> 0: ifINFO = i, and i is<= N: the QR algorithm failed to compute all the eigenvalues; elements1:ILO-1andi+1:Nof W contain those eigenvalues which have converged; ifJOBVS = 'V', VS contains the matrix which reduces A to its partially converged Schur form.= N+1: the eigenvalues could not be reordered because some eigenvalues were too close to separate (the problem is very ill-conditioned);= N+2: after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Schur form no longer satisfySELECT = .TRUE.. This could also be caused by underflow due to scaling.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
subroutine zgeesx
subroutine zgeesx (character JOBVS, character SORT, external SELECT,
character SENSE, integer N, complex*16, dimension( lda, * ) A, integer
LDA, integer SDIM, complex*16, dimension( * ) W, complex*16, dimension(
ldvs, * ) VS, integer LDVS, double precision RCONDE, double precision
RCONDV, complex*16, dimension( * ) WORK, integer LWORK, double
precision, dimension( * ) RWORK, logical, dimension( * ) BWORK, integer
INFO)
ZGEESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices π
Purpose
ZGEESX computes for an N-by-N complex nonsymmetric matrix A, the eigenvalues, the Schur form T, and, optionally, the matrix of Schur vectors Z. This gives the Schur factorization A = Z*T*(Z**H). β¨
Optionally, it also orders the eigenvalues on the diagonal of the Schur form so that selected eigenvalues are at the top left; computes a reciprocal condition number for the average of the selected eigenvalues (RCONDE); and computes a reciprocal condition number for the right invariant subspace corresponding to the selected eigenvalues (RCONDV). The leading columns of Z form an orthonormal basis for this invariant subspace. π¦
For further explanation of the reciprocal condition numbers RCONDE and RCONDV, see Section 4.10 of the LAPACK Users' Guide (where these quantities are called s and sep respectively). iykyk π
A complex matrix is in Schur form if it is upper triangular. π
Parameters
JOBVSJOBVSisCHARACTER*1= 'N': Schur vectors are not computed;= 'V': Schur vectors are computed.
SORTSORTisCHARACTER*1- Specifies whether or not to order the eigenvalues on the diagonal of the Schur form.
= 'N': Eigenvalues are not ordered;= 'S': Eigenvalues are ordered (seeSELECT).
SELECTSELECTis aLOGICAL FUNCTIONof oneCOMPLEX*16argumentSELECTmust be declaredEXTERNALin the calling subroutine.- If
SORT = 'S',SELECTis used to select eigenvalues to order to the top left of the Schur form. - If
SORT = 'N',SELECTis not referenced. - An eigenvalue
W(j)is selected ifSELECT(W(j))is true.
SENSESENSEisCHARACTER*1- Determines which reciprocal condition numbers are computed.
= 'N': None are computed;= 'E': Computed for average of selected eigenvalues only;= 'V': Computed for selected right invariant subspace only;= 'B': Computed for both.- If
SENSE = 'E','V'or'B',SORTmust equal'S'.
NNβ INTEGER. It's the order of the matrixA, bestie. AndN >= 0, no negativity allowed β¨Aβ COMPLEX*16 array, dimension(LDA, N). On entry, it's yourN-by-NmatrixA. On exit,Agets overwritten by its Schur formTπ so likeβ¦ say goodbye, she's not coming back the way you left her.LDAβ INTEGER. The leading dimension of the arrayA.LDA >= max(1,N), periodt.SDIMβ INTEGER. IfSORT = 'N', thenSDIM = 0. IfSORT = 'S', thenSDIM= the number of eigenvalues for whichSELECTis true πWβ COMPLEX*16 array, dimension(N).Wholds the computed eigenvalues, in the same order that they appear on the diagonal of the output Schur formT.VSβ COMPLEX*16 array, dimension(LDVS,N). IfJOBVS = 'V',VScontains the unitary matrixZof Schur vectors π¦. IfJOBVS = 'N',VSis not referenced.LDVSβ INTEGER. The leading dimension of the arrayVS.LDVS >= 1, and ifJOBVS = 'V', thenLDVS >= N.RCONDEβ DOUBLE PRECISION. IfSENSE = 'E'or'B',RCONDEcontains the reciprocal condition number for the average of the selected eigenvalues. Not referenced ifSENSE = 'N'or'V'.RCONDVβ DOUBLE PRECISION. IfSENSE = 'V'or'B',RCONDVcontains the reciprocal condition number for the selected right invariant subspace. Not referenced ifSENSE = 'N'or'E'.WORKβ COMPLEX*16 array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORKπLWORKβ INTEGER. The dimension of the arrayWORK.LWORK >= max(1,2*N). Also, ifSENSE = 'E'or'V'or'B', thenLWORK >= 2*SDIM*(N-SDIM), whereSDIMis the number of selected eigenvalues computed by this routine. Note that2*SDIM*(N-SDIM) <= N*N/2. Note also that an error is only returned ifLWORK < max(1,2*N), but ifSENSE = 'E'or'V'or'B'this may not be large enough. For good performance,LWORKmust generally be larger π IfLWORK = -1, then a workspace query is assumed; the routine only calculates an upper bound on the optimal size of the arrayWORK, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLAπRWORKβ DOUBLE PRECISION array, dimension(N).BWORKβ LOGICAL array, dimension(N). Not referenced ifSORT = 'N'.INFOβ INTEGER. The vibe check report, and it goes like this:= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value.> 0: ifINFO = i, and i is<= N: the QR algorithm failed to compute all the eigenvalues; elements1:ILO-1andi+1:NofWcontain those eigenvalues which have converged; ifJOBVS = 'V',VScontains the transformation which reducesAto its partially converged Schur form π= N+1: the eigenvalues could not be reordered because some eigenvalues were too close to separate (the problem is very ill-conditioned);= N+2: after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Schur form no longer satisfySELECT=.TRUE.This could also be caused by underflow due to scaling. π
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π subroutine zgeev π
subroutine zgeev (character JOBVL, character JOBVR, integer N, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( * ) W,
complex*16, dimension( ldvl, * ) VL, integer LDVL, complex*16,
dimension( ldvr, * ) VR, integer LDVR, complex*16, dimension( * ) WORK,
integer LWORK, double precision, dimension( * ) RWORK, integer INFO)
ZGEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices. She's the main character fr π
Purpose
ZGEEV computes, for an N-by-N complex nonsymmetric matrix A, the eigenvalues and, optionally, the left and/or right eigenvectors. Like, both? Only one? Your call, bestie π«Ά
The right eigenvector v(j) of A satisfies
A * v(j) = lambda(j) * v(j)
where lambda(j) is its eigenvalue.
The left eigenvector u(j) of A satisfies
u(j)**H * A = lambda(j) * u(j)**H
where u(j)**H denotes the conjugate transpose of u(j).
The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real. That's the glow-up, no cap β¨
Parameters
JOBVLβ CHARACTER*1.= 'N': left eigenvectors ofAare not computed;= 'V': left eigenvectors of are computed.
JOBVRβ CHARACTER*1.= 'N': right eigenvectors ofAare not computed;= 'V': right eigenvectors ofAare computed.
Nβ INTEGER. The order of the matrixA.N >= 0.Aβ COMPLEX*16 array, dimension(LDA,N). On entry, theN-by-NmatrixA. On exit,Ahas been overwritten πLDAβ INTEGER. The leading dimension of the arrayA.LDA >= max(1,N).Wβ COMPLEX*16 array, dimension(N).Wcontains the computed eigenvalues πVLβ COMPLEX*16 array, dimension(LDVL,N). IfJOBVL = 'V', the left eigenvectorsu(j)are stored one after another in the columns ofVL, in the same order as their eigenvalues. IfJOBVL = 'N',VLis not referenced. Andu(j) = VL(:,j), the j-th column ofVL.LDVLβ INTEGER. The leading dimension of the arrayVL.LDVL >= 1; ifJOBVL = 'V', thenLDVL >= N.VRβ COMPLEX*16 array, dimension(LDVR,N). IfJOBVR = 'V', the right eigenvectorsv(j)are stored one after another in the columns ofVR, in the same order as their eigenvalues. IfJOBVR = 'N',VRis not referenced. Andv(j) = VR(:,j), the j-th column ofVR.LDVRβ INTEGER. The leading dimension of the arrayVR.LDVR >= 1; ifJOBVR = 'V', thenLDVR >= N.WORKβ COMPLEX*16 array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORKπLWORKβ INTEGER. The dimension of the arrayWORK.LWORK >= max(1,2*N). For good performance,LWORKmust generally be larger. IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA.RWORKβ DOUBLE PRECISION array, dimension(2*N).INFOβ INTEGER.= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value.> 0: ifINFO = i, the QR algorithm failed to compute all the eigenvalues, and no eigenvectors have been computed; elementsi+1:NofWcontain eigenvalues which have converged.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ subroutine zgeevx π¦
subroutine zgeevx (character BALANC, character JOBVL, character JOBVR,
character SENSE, integer N, complex*16, dimension( lda, * ) A, integer
LDA, complex*16, dimension( * ) W, complex*16, dimension( ldvl, * ) VL,
integer LDVL, complex*16, dimension( ldvr, * ) VR, integer LDVR, integer
ILO, integer IHI, double precision, dimension( * ) SCALE, double
precision ABNRM, double precision, dimension( * ) RCONDE, double
precision, dimension( * ) RCONDV, complex*16, dimension( * ) WORK,
integer LWORK, double precision, dimension( * ) RWORK, integer INFO)
ZGEEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices. It's giving zgeev's overachieving older sister π
Purpose
ZGEEVX computes, for an N-by-N complex nonsymmetric matrix A, the eigenvalues and, optionally, the left and/or right eigenvectors.
Optionally also, it computes a balancing transformation to improve the conditioning of the eigenvalues and eigenvectors (ILO, IHI, SCALE, and ABNRM), reciprocal condition numbers for the eigenvalues (RCONDE), and reciprocal condition numbers for the right eigenvectors (RCONDV). Obsessed π
The right eigenvector v(j) of A satisfies
A * v(j) = lambda(j) * v(j)
where lambda(j) is its eigenvalue.
The left eigenvector u(j) of A satisfies
u(j)**H * A = lambda(j) * u(j)**H
where u(j)**H denotes the conjugate transpose of u(j).
The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real. Same energy, every time β¨
Balancing a matrix means permuting the rows and columns to make it more nearly upper triangular, and applying a diagonal similarity transformation D * A * D**(-1), where D is a diagonal matrix, to make its rows and columns closer in norm and the condition numbers of its eigenvalues and eigenvectors smaller. The computed reciprocal condition numbers correspond to the balanced matrix. Permuting rows and columns will not change the condition numbers (in exact arithmetic) but diagonal scaling will π For further explanation of balancing, see section 4.10.2 of the LAPACK Users' Guide.
Parameters
BALANCβ okay bestie, this one's deets are up nextβ¦
BALANC
okay so BALANC is CHARACTER*1 and it's basically the vibe check for your matrix π
β it tells the routine how to diagonally scale and/or permute the input so its eigenvalues behave better conditioned.
'N'β do not diagonally scale or permute. leave it alone, she's fine as she is.'P'β perform permutations to make the matrix more nearly upper triangular. do not diagonally scale.'S'β diagonally scale the matrix, i.e. replaceAbyD*A*D**(-1), whereDis a diagonal matrix chosen to make the rows and columns ofAmore equal in norm. do not permute.'B'β both diagonally scale and permuteA. the whole glow-up β¨
heads up bestie: the computed reciprocal condition numbers are for the matrix after balancing and/or permuting. permuting does not change condition numbers (in exact arithmetic), but balancing does. so that matters, fr fr.
JOBVL
JOBVL is CHARACTER*1.
'N'β left eigenvectors ofAare not computed;'V'β left eigenvectors ofAare computed.
if SENSE = 'E' or 'B', then JOBVL must = 'V'. non-negotiable, she said what she said.
JOBVR
JOBVR is CHARACTER*1.
'N'β right eigenvectors ofAare not computed;'V'β right eigenvectors ofAare computed.
if SENSE = 'E' or 'B', then JOBVR must = 'V'. same energy, periodt.
SENSE
SENSE is CHARACTER*1 and it decides which reciprocal condition numbers get computed.
'N'β none are computed;'E'β computed for eigenvalues only;'V'β computed for right eigenvectors only;'B'β computed for eigenvalues and right eigenvectors.
if SENSE = 'E' or 'B', then both left and right eigenvectors must also be computed (JOBVL = 'V' and JOBVR = 'V'). yeah, package deal π
N
N is INTEGER. it's the order of the matrix A, and N >= 0.
A
A is COMPLEX*16 array, dimension (LDA,N).
on entry, it's the N-by-N matrix A.
on exit, A has been overwritten. if JOBVL = 'V' or JOBVR = 'V', then A contains the Schur form of the balanced version of the matrix A. so likeβ¦ she's not who she was before, and that's okay π
LDA
LDA is INTEGER, the leading dimension of the array A. LDA >= max(1,N).
W
W is COMPLEX*16 array, dimension (N) and it holds the computed eigenvalues. main character data fr π
VL
VL is COMPLEX*16 array, dimension (LDVL,N).
if JOBVL = 'V', the left eigenvectors u(j) are stored one after another in the columns of VL, in the same order as their eigenvalues.
if JOBVL = 'N', VL is not referenced at all β ghosted π»
and u(j) = VL(:,j), the j-th column of VL.
LDVL
LDVL is INTEGER, the leading dimension of the array VL. LDVL >= 1; and if JOBVL = 'V', then LDVL >= N.
VR
VR is COMPLEX*16 array, dimension (LDVR,N).
if JOBVR = 'V', the right eigenvectors v(j) are stored one after another in the columns of VR, in the same order as their eigenvalues.
if JOBVR = 'N', VR is not referenced. gone, reduced to atoms π
and v(j) = VR(:,j), the j-th column of VR.
LDVR
LDVR is INTEGER, the leading dimension of the array VR. LDVR >= 1; and if JOBVR = 'V', then LDVR >= N.
ILO
ILO is INTEGER.
IHI
IHI is INTEGER.
ILO and IHI are integer values determined when A was balanced. the balanced A(i,j) = 0 if I > J and J = 1,...,ILO-1 or I = IHI+1,...,N. those are the structural zeros, she's keeping receipts π
SCALE
SCALE is DOUBLE PRECISION array, dimension (N) and it's got all the tea on the permutations and scaling factors applied when balancing A.
if P(j) is the index of the row and column interchanged with row and column j, and D(j) is the scaling factor applied to row and column j, then:
SCALE(J) = P(J), for J = 1,...,ILO-1
= D(J), for J = ILO,...,IHI
= P(J) for J = IHI+1,...,N.
and the order in which the interchanges are made is N to IHI+1, then 1 to ILO-1. order matters, bestie, don't skip steps π¦
ABNRM
ABNRM is DOUBLE PRECISION β the one-norm of the balanced matrix, which is the maximum of the sum of absolute values of elements of any column. basically the biggest column flex πͺ
RCONDE
RCONDE is DOUBLE PRECISION array, dimension (N), and RCONDE(j) is the reciprocal condition number of the j-th eigenvalue.
RCONDV
RCONDV is DOUBLE PRECISION array, dimension (N), and RCONDV(j) is the reciprocal condition number of the j-th right eigenvector.
WORK
WORK is COMPLEX*16 array, dimension (MAX(1,LWORK)).
on exit, if INFO = 0, then WORK(1) returns the optimal LWORK. she's telling you what she needs, listen π
LWORK
LWORK is INTEGER β the dimension of the array WORK.
if SENSE = 'N' or 'E', then LWORK >= max(1,2*N). and if SENSE = 'V' or 'B', then LWORK >= N*N+2*N.
for good performance, LWORK must generally be larger. no skimping, she deserves the space π
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. cute little loophole, iykyk.
RWORK
RWORK is DOUBLE PRECISION array, dimension (2*N).
INFO
INFO is INTEGER.
= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value. one of your args fumbled π> 0: ifINFO = i, the QR algorithm failed to compute all the eigenvalues, and no eigenvectors or condition numbers have been computed; elements1:ILO-1andi+1:NofWcontain eigenvalues which have converged.
Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
zgges
subroutine zgges (character JOBVSL, character JOBVSR, character SORT,
external SELCTG, integer N, complex*16, dimension( lda, * ) A, integer
LDA, complex*16, dimension( ldb, * ) B, integer LDB, integer SDIM,
complex*16, dimension( * ) ALPHA, complex*16, dimension( * ) BETA,
complex*16, dimension( ldvsl, * ) VSL, integer LDVSL, complex*16,
dimension( ldvsr, * ) VSR, integer LDVSR, complex*16, dimension( * )
WORK, integer LWORK, double precision, dimension( * ) RWORK, logical,
dimension( * ) BWORK, integer INFO)
ZGGES computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices. yeah. she does a lot. multi-talented π
Purpose
ZGGES computes, for a pair of N-by-N complex nonsymmetric matrices (A,B), the generalized eigenvalues, the generalized complex Schur form (S, T), and optionally left and/or right Schur vectors (VSL and VSR). this gives the generalized Schur factorization:
(A,B) = ( (VSL)*S*(VSR)**H, (VSL)*T*(VSR)**H )
where (VSR)**H is the conjugate-transpose of VSR. yes bestie, conjugate-transpose, we love her π
optionally, it also orders the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper triangular matrix S and the upper triangular matrix T. the leading columns of VSL and VSR then form an unitary basis for the corresponding left and right eigenspaces (deflating subspaces). iconique behaviour β¨
if you only need the generalized eigenvalues, use the driver ZGGEV instead β it's faster. know when to call the right girlie, fr fr.
a generalized eigenvalue for a pair of matrices (A,B) is a scalar w, or a ratio alpha/beta = w, such that A - w*B is singular. it's usually represented as the pair (alpha,beta), because there's a reasonable interpretation for beta=0, and even for both being zero. no division by zero drama here, we planned ahead π
a pair of matrices (S,T) is in generalized complex Schur form if S and T are upper triangular and, in addition, the diagonal elements of T are non-negative real numbers. that's the whole aesthetic.
Parameters
JOBVSL
JOBVSL is CHARACTER*1.
'N'β do not compute the left Schur vectors;'V'β compute the left Schur vectors.
JOBVSR
JOBVSR is CHARACTER*1.
'N'β do not compute the right Schur vectors;'V'β compute the right Schur vectors.
SORT
SORT is CHARACTER*1 and specifies whether or not to order the eigenvalues on the diagonal of the generalized Schur form.
'N'β eigenvalues are not ordered;'S'β eigenvalues are ordered (seeSELCTG).
SELCTG
SELCTG is a LOGICAL FUNCTION of two COMPLEX*16 arguments. SELCTG must be declared EXTERNAL in the calling subroutine.
if SORT = 'N', SELCTG is not referenced.
if SORT = 'S', SELCTG is used to select eigenvalues to sort to the top left of the Schur form.
an eigenvalue ALPHA(j)/BETA(j) is selected if SELCTG(ALPHA(j),BETA(j)) is true.
okay so listen: a selected complex eigenvalue may no longer satisfySELCTG(ALPHA(j),BETA(j)) = .TRUE.after ordering, since ordering may change the value of complex eigenvalues (especially if the eigenvalue is ill-conditioned). in this caseINFOis set toN+2(seeINFObelow). she's chaotic like that, not her fault π
N
N is INTEGER β the order of the matrices A, B, VSL, and VSR. N >= 0.
A
A is COMPLEX*16 array, dimension (LDA, N).
on entry, it's the first of the pair of matrices.
on exit, A has been overwritten by its generalized Schur form S.
LDA
LDA is INTEGER β the leading dimension of A. LDA >= max(1,N).
B
B is COMPLEX*16 array, dimension (LDB, N).
on entry, it's the second of the pair of matrices.
on exit, B has been overwritten by its generalized Schur form T.
LDB
LDB is INTEGER β the leading dimension of B. LDB >= max(1,N).
SDIM
SDIM is INTEGER.
if SORT = 'N', then SDIM = 0.
if SORT = 'S', then SDIM = number of eigenvalues (after sorting) for which SELCTG is true.
ALPHA
ALPHAβ isCOMPLEX*16 array, dimension (N)β just a lil array of eigenvalues, no cap π β¨BETAβ isCOMPLEX*16 array, dimension (N). On exit,ALPHA(j)/BETA(j),j=1,...,N, will be the generalized eigenvalues.ALPHA(j),j=1,...,NandBETA(j),j=1,...,Nare the diagonals of the complex Schur form(A,B)output byZGGES. TheBETA(j)will be non-negative real. π
Note: the quotientsALPHA(j)/BETA(j)may easily over- or underflow, andBETA(j)may even be zero. Thus, the user should avoid naively computing the ratioalpha/beta. However,ALPHAwill be always less than and usually comparable withnorm(A)in magnitude, andBETAalways less than and usually comparable withnorm(B). π So don't be out here dividing by zero, bestie, it's giving risky vibes π
VSLβ isCOMPLEX*16 array, dimension (LDVSL,N). IfJOBVSL = 'V',VSLwill contain the left Schur vectors. Not referenced ifJOBVSL = 'N'. π¦ left Schur vectors are lowkey iconicLDVSLβ isINTEGER. The leading dimension of the matrixVSL.LDVSL >= 1, and ifJOBVSL = 'V',LDVSL >= N. πΈVSRβ isCOMPLEX*16 array, dimension (LDVSR,N). IfJOBVSR = 'V',VSRwill contain the right Schur vectors. Not referenced ifJOBVSR = 'N'. π right Schur vectors, periodtLDVSRβ isINTEGER. The leading dimension of the matrixVSR.LDVSR >= 1, and ifJOBVSR = 'V',LDVSR >= N. β¨WORKβ isCOMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. πLWORKβ isINTEGER. The dimension of the arrayWORK.LWORK >= max(1,2*N). For good performance,LWORKmust generally be larger. π«Ά like, bigger is better, no cap IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. π₯RWORKβ isDOUBLE PRECISION array, dimension (8*N). πBWORKβ isLOGICAL array, dimension (N). Not referenced ifSORT = 'N'. πINFOβ isINTEGER= 0: successful exit π< 0: ifINFO = -i, the i-th argument had an illegal value. π©=1,...,N: The QZ iteration failed.(A,B)are not in Schur form, butALPHA(j)andBETA(j)should be correct forj=INFO+1,...,N. π> N:=N+1: other than QZ iteration failed inZHGEQZ=N+2: after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Generalized Schur form no longer satisfySELCTG=.TRUE.This could also be caused due to scaling.=N+3: reordering failed inZTGSEN. π
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ subroutine zgges3 π¦
subroutine zgges3 (character JOBVSL, character JOBVSR, character SORT,
external SELCTG, integer N, complex*16, dimension( lda, * ) A, integer
LDA, complex*16, dimension( ldb, * ) B, integer LDB, integer SDIM,
complex*16, dimension( * ) ALPHA, complex*16, dimension( * ) BETA,
complex*16, dimension( ldvsl, * ) VSL, integer LDVSL, complex*16,
dimension( ldvsr, * ) VSR, integer LDVSR, complex*16, dimension( * )
WORK, integer LWORK, double precision, dimension( * ) RWORK, logical,
dimension( * ) BWORK, integer INFO)
ZGGES3 computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices (blocked algorithm) π₯
π― Purpose: π―
ZGGES3 computes for a pair of N-by-N complex nonsymmetric matrices (A,B), the generalized eigenvalues, the generalized complex Schur form (S, T), and optionally left and/or right Schur vectors (VSL and VSR). This gives the generalized Schur factorization
(A,B) = ( (VSL)*S*(VSR)**H, (VSL)*T*(VSR)**H )
where (VSR)**H is the conjugate-transpose of VSR. β¨
Optionally, it also orders the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper triangular matrix S and the upper triangular matrix T. The leading columns of VSL and VSR then form an unitary basis for the corresponding left and right eigenspaces (deflating subspaces). π
(If only the generalized eigenvalues are needed, use the driver ZGGEV instead, which is faster.) ποΈ
A generalized eigenvalue for a pair of matrices (A,B) is a scalar w or a ratio alpha/beta = w, such that A - w*B is singular. It is usually represented as the pair (alpha,beta), as there is a reasonable interpretation for beta=0, and even for both being zero. π
A pair of matrices (S,T) is in generalized complex Schur form if S and T are upper triangular and, in addition, the diagonal elements of T are non-negative real numbers. π
π Parameters π
JOBVSLβ isCHARACTER*1= 'N': do not compute the left Schur vectors;= 'V': compute the left Schur vectors. π¦
JOBVSRβ isCHARACTER*1= 'N': do not compute the right Schur vectors;= 'V': compute the right Schur vectors. π
SORTβ isCHARACTER*1. Specifies whether or not to order the eigenvalues on the diagonal of the generalized Schur form.= 'N': Eigenvalues are not ordered;= 'S': Eigenvalues are ordered (seeSELCTG). πΈ
SELCTGβ is aLOGICAL FUNCTIONof twoCOMPLEX*16arguments.SELCTGmust be declaredEXTERNALin the calling subroutine. IfSORT = 'N',SELCTGis not referenced. IfSORT = 'S',SELCTGis used to select eigenvalues to sort to the top left of the Schur form. An eigenvalueALPHA(j)/BETA(j)is selected ifSELCTG(ALPHA(j),BETA(j))is true. π
Note that a selected complex eigenvalue may no longer satisfySELCTG(ALPHA(j),BETA(j)) = .TRUE.after ordering, since ordering may change the value of complex eigenvalues (especially if the eigenvalue is ill-conditioned), in this caseINFOis set toN+2(SeeINFObelow). π
Nβ isINTEGER. The order of the matricesA,B,VSL, andVSR.N >= 0. β¨Aβ isCOMPLEX*16 array, dimension (LDA, N). On entry, the first of the pair of matrices. On exit,Ahas been overwritten by its generalized Schur formS. π₯LDAβ isINTEGER. The leading dimension ofA.LDA >= max(1,N). πBβ isCOMPLEX*16 array, dimension (LDB, N). On entry, the second of the pair of matrices. On exit,Bhas been overwritten by its generalized Schur formT. πLDBβ isINTEGER. The leading dimension ofB.LDB >= max(1,N). πSDIMβ isINTEGER. IfSORT = 'N',SDIM = 0. IfSORT = 'S',SDIM = number of eigenvalues (after sorting) for which SELCTG is true. πALPHAβ isCOMPLEX*16 array, dimension (N). π¦BETAβ isCOMPLEX*16 array, dimension (N). On exit,ALPHA(j)/BETA(j),j=1,...,N, will be the generalized eigenvalues.ALPHA(j),j=1,...,NandBETA(j),j=1,...,Nare the diagonals of the complex Schur form(A,B)output byZGGES3. TheBETA(j)will be non-negative real. π
Note: the quotientsALPHA(j)/BETA(j)may easily over- or underflow, andBETA(j)may even be zero. Thus, the user should avoid naively computing the ratioalpha/beta. However,ALPHAwill be always less than and usually comparable withnorm(A)in magnitude, andBETAalways less than and usually comparable withnorm(B). π
VSLβ isCOMPLEX*16 array, dimension (LDVSL,N). IfJOBVSL = 'V',VSLwill contain the left Schur vectors. Not referenced ifJOBVSL = 'N'. πΈLDVSLβ isINTEGER. The leading dimension of the matrixVSL.LDVSL >= 1, and ifJOBVSL = 'V',LDVSL >= N. πVSRβ isCOMPLEX*16 array, dimension (LDVSR,N). IfJOBVSR = 'V',VSRwill contain the right Schur vectors. Not referenced ifJOBVSR = 'N'. β¨LDVSRβ isINTEGER. The leading dimension of the matrixVSR.LDVSR >= 1, and ifJOBVSR = 'V',LDVSR >= N. π₯WORKβ isCOMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. π«ΆLWORKβ isINTEGER. The dimension of the arrayWORK. IfLWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of theWORKarray, returns this value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. πRWORKβ isDOUBLE PRECISION array, dimension (8*N). πBWORKβ isLOGICAL array, dimension (N). Not referenced ifSORT = 'N'. πINFOβ
Ok so INFO is an INTEGER and honestly it's the β¨receiptβ¨ for everything that just went down β read it like your phone's notification stack:
= 0: successful exit π everything's cute, we ate, no notes< 0: ifINFO = -i, the i-th argument had an illegal value. yeah that one's on the caller bestie, argument number i showed up wrong π=1,...,N: The QZ iteration failed.(A,B)are not in Schur form, butALPHA(j)andBETA(j)should be correct forj=INFO+1,...,N. so it's giving "not a full slay, but the tail end of the eigenvalues still eats" π> N:=N+1: other than QZ iteration failed inZLAQZ0π=N+2: after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Generalized Schur form no longer satisfySELCTG=.TRUE.This could also be caused due to scaling. roundoff literally said "not today" π and scaling can be the culprit too, so watch out.=N+3: reordering failed inZTGSENπ
π Author π
Giving credit where it's due, because we always do β this one was cooked up by:
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ subroutine zggesx π¦
subroutine zggesx (character JOBVSL, character JOBVSR, character SORT,
external SELCTG, character SENSE, integer N, complex*16, dimension( lda,
* ) A, integer LDA, complex*16, dimension( ldb, * ) B, integer LDB,
integer SDIM, complex*16, dimension( * ) ALPHA, complex*16, dimension( *
) BETA, complex*16, dimension( ldvsl, * ) VSL, integer LDVSL,
complex*16, dimension( ldvsr, * ) VSR, integer LDVSR, double precision,
dimension( 2 ) RCONDE, double precision, dimension( 2 ) RCONDV,
complex*16, dimension( * ) WORK, integer LWORK, double precision,
dimension( * ) RWORK, integer, dimension( * ) IWORK, integer LIWORK,
logical, dimension( * ) BWORK, integer INFO)
so basically ZGGESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices β¨ iconic behaviour honestly.
β¨ Purpose β¨
okay so ZGGESX computes, for a pair of N-by-N complex nonsymmetric matrices (A,B), the generalized eigenvalues, the complex Schur form (S,T), and, optionally, the left and/or right matrices of Schur vectors (VSL and VSR). This gives the generalized Schur factorization
(A,B) = ( (VSL) S (VSR)**H, (VSL) T (VSR)**H )
where (VSR)**H is the conjugate-transpose of VSR. conjugate-transpose? obsessed, she's doing the most and we love her π«Ά
Optionally, it also orders the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper triangular matrix S and the upper triangular matrix T; computes a reciprocal condition number for the average of the selected eigenvalues (RCONDE); and computes a reciprocal condition number for the right and left deflating subspaces corresponding to the selected eigenvalues (RCONDV). The leading columns of VSL and VSR then form an orthonormal basis for the corresponding left and right eigenspaces (deflating subspaces). lowkey the glow-up pipeline of matrix decompositions π
A generalized eigenvalue for a pair of matrices (A,B) is a scalar w or a ratio alpha/beta = w, such that A - w*B is singular. It is usually represented as the pair (alpha,beta), as there is a reasonable interpretation for beta=0 or for both being zero.
A pair of matrices (S,T) is in generalized complex Schur form if T is upper triangular with non-negative diagonal and S is upper triangular. periodt π
π Parameters π
JOBVSL
JOBVSL is CHARACTER*1
= 'N': do not compute the left Schur vectors;= 'V': compute the left Schur vectors.
JOBVSR
JOBVSR is CHARACTER*1
= 'N': do not compute the right Schur vectors;= 'V': compute the right Schur vectors.
SORT
SORT is CHARACTER*1
Specifies whether or not to order the eigenvalues on the diagonal of the generalized Schur form.
= 'N': Eigenvalues are not ordered;= 'S': Eigenvalues are ordered (seeSELCTG).
SELCTG
SELCTG is a LOGICAL FUNCTION of two COMPLEX*16 arguments
SELCTG must be declared EXTERNAL in the calling subroutine.
If SORT = 'N', SELCTG is not referenced.
If SORT = 'S', SELCTG is used to select eigenvalues to sort to the top left of the Schur form.
Note that a selected complex eigenvalue may no longer satisfySELCTG(ALPHA(j),BETA(j)) = .TRUE.after ordering, since ordering may change the value of complex eigenvalues (especially if the eigenvalue is ill-conditioned), in this caseINFOis set toN+3seeINFObelow). yeah bestie, sorting can β¨changeβ¨ the vibes of an ill-conditioned eigenvalue, that's not a bug that's just the drama π
SENSE
SENSE is CHARACTER*1
Determines which reciprocal condition numbers are computed.
= 'N': None are computed;= 'E': Computed for average of selected eigenvalues only;= 'V': Computed for selected deflating subspaces only;= 'B': Computed for both.
If SENSE = 'E', 'V', or 'B', SORT must equal 'S'.
N
N is INTEGER
The order of the matrices A, B, VSL, and VSR. N >= 0.
A
A is COMPLEX*16 array, dimension (LDA, N)
On entry, the first of the pair of matrices.
On exit, A has been overwritten by its generalized Schur form S. she gets a whole new personality, love that for her π
LDA
LDA is INTEGER
The leading dimension of A. LDA >= max(1,N).
B
B is COMPLEX*16 array, dimension (LDB, N)
On entry, the second of the pair of matrices.
On exit, B has been overwritten by its generalized Schur form T.
LDB
LDB is INTEGER
The leading dimension of B. LDB >= max(1,N).
SDIM
SDIM is INTEGER
- If
SORT = 'N',SDIM = 0. - If
SORT = 'S',SDIM= number of eigenvalues (after sorting) for whichSELCTGis true.
ALPHA
ALPHA is COMPLEX*16 array, dimension (N)
BETA
BETA is COMPLEX*16 array, dimension (N)
On exit, ALPHA(j)/BETA(j), j=1,...,N, will be the generalized eigenvalues. ALPHA(j) and BETA(j),j=1,...,N are the diagonals of the complex Schur form (S,T). BETA(j) will be non-negative real.
Note: the quotientsALPHA(j)/BETA(j)may easily over- or underflow, andBETA(j)may even be zero. Thus, the user should avoid naively computing the ratioalpha/beta. However,ALPHAwill be always less than and usually comparable withnorm(A)in magnitude, andBETAalways less than and usually comparable withnorm(B). so like... do NOT just divide them and act surprised, bestie π
VSL
VSL is COMPLEX*16 array, dimension (LDVSL,N)
If JOBVSL = 'V', VSL will contain the left Schur vectors.
Not referenced if JOBVSL = 'N'.
LDVSL
LDVSL is INTEGER
The leading dimension of the matrix VSL. LDVSL >=1, and if JOBVSL = 'V', LDVSL >= N.
VSR
VSR is COMPLEX*16 array, dimension (LDVSR,N)
If JOBVSR = 'V', VSR will contain the right Schur vectors.
Not referenced if JOBVSR = 'N'.
LDVSR
LDVSR is INTEGER
The leading dimension of the matrix VSR. LDVSR >= 1, and if JOBVSR = 'V', LDVSR >= N.
RCONDE
RCONDE is DOUBLE PRECISION array, dimension ( 2 )
If SENSE = 'E' or 'B', RCONDE(1) and RCONDE(2) contain the reciprocal condition numbers for the average of the selected eigenvalues.
Not referenced if SENSE = 'N' or 'V'.
RCONDV
RCONDV is DOUBLE PRECISION array, dimension ( 2 )
If SENSE = 'V' or 'B', RCONDV(1) and RCONDV(2) contain the reciprocal condition number for the selected deflating subspaces.
Not referenced if SENSE = 'N' or 'E'.
WORK
WORK is COMPLEX*16 array, dimension (MAX(1,LWORK))
On exit, if INFO = 0, WORK(1) returns the optimal LWORK. the receipts are literally in the first slot, iconic π¬
LWORK
LWORK is INTEGER
The dimension of the array WORK.
If N = 0, LWORK >= 1, else if SENSE = 'E', 'V', or 'B', LWORK >= MAX(1,2*N,2*SDIM*(N-SDIM)), else LWORK >= MAX(1,2*N). Note that 2*SDIM*(N-SDIM) <= N*N/2. Note also that an error is only returned if LWORK < MAX(1,2*N), but if SENSE = 'E' or 'V' or 'B' this may not be large enough.
IfLWORK = -1, then a workspace query is assumed; the routine only calculates the bound on the optimal size of theWORKarray and the minimum size of theIWORKarray, returns these values as the first entries of theWORKandIWORKarrays, and no error message related toLWORKorLIWORKis issued byXERBLA. yes queen,-1is the "just tell me the size, no commitment" setting π
RWORK
RWORK is DOUBLE PRECISION array, dimension ( 8*N )
Real workspace.
IWORK
IWORK is INTEGER array, dimension (MAX(1,LIWORK))
On exit, if INFO = 0, IWORK(1) returns the minimum LIWORK.
LIWORK
LIWORK is INTEGER
The dimension of the array IWORK.
If SENSE = 'N' or N = 0, LIWORK >= 1, otherwise LIWORK >= N+2.
IfLIWORK = -1, then a workspace query is assumed; the routine only calculates the bound on the optimal size of theWORKarray and the minimum size of theIWORKarray, returns these values as the first entries of theWORKandIWORKarrays, and no error message related toLWORKorLIWORKis issued byXERBLA. same energy, different array π
BWORK
BWORK is LOGICAL array, dimension (N)
Not referenced if SORT = 'N'.
INFO
INFOβINFO is INTEGER= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value.= 1,...,N: The QZ iteration failed.(A,B)are not in Schur form, butALPHA(j)andBETA(j)should be correct forj=INFO+1,...,N.> N:=N+1: other than QZ iteration failed inZHGEQZ=N+2: after reordering, roundoff changed values of some complex eigenvalues so that leading eigenvalues in the Generalized Schur form no longer satisfySELCTG=.TRUE.This could also be caused due to scaling.=N+3: reordering failed inZTGSEN.
okay so bestie, if yourINFOcomes back> N, the QZ saga did NOT go how we wanted π but don't panic β the numbers you got are still the numbers you got, fr fr.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
πΈ subroutine zggev πΈ
subroutine zggev (character JOBVL, character JOBVR, integer N, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B,
integer LDB, complex*16, dimension( * ) ALPHA, complex*16, dimension( *
) BETA, complex*16, dimension( ldvl, * ) VL, integer LDVL, complex*16,
dimension( ldvr, * ) VR, integer LDVR, complex*16, dimension( * ) WORK,
integer LWORK, double precision, dimension( * ) RWORK, integer INFO)
ZGGEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices π
β¨ Purpose β¨
ZGGEV computes for a pair of N-by-N complex nonsymmetric matrices (A,B), the generalized eigenvalues, and optionally, the left and/or right generalized eigenvectors.
A generalized eigenvalue for a pair of matrices (A,B) is a scalar lambda or a ratio alpha/beta = lambda, such that A - lambda*B is singular. It is usually represented as the pair (alpha,beta), as there is a reasonable interpretation for beta=0, and even for both being zero.
The right generalized eigenvector v(j) corresponding to the generalized eigenvalue lambda(j) of (A,B) satisfies
A * v(j) = lambda(j) * B * v(j).
The left generalized eigenvector u(j) corresponding to the generalized eigenvalues lambda(j) of (A,B) satisfies
u(j)**H * A = lambda(j) * u(j)**H * B
where u(j)**H is the conjugate-transpose of u(j).
π Parameters π
JOBVLβJOBVL is CHARACTER*1= 'N': do not compute the left generalized eigenvectors;= 'V': compute the left generalized eigenvectors.
JOBVRβJOBVR is CHARACTER*1= 'N': do not compute the right generalized eigenvectors;= 'V': compute the right generalized eigenvectors.
NβN is INTEGER. The order of the matricesA,B,VL, andVR.N >= 0.AβA is COMPLEX*16 array, dimension (LDA, N). On entry, the matrixAin the pair(A,B). On exit,Ahas been overwritten. π«Ά (yes bestie, it's gone, it gets clobbered, that's the vibe.)LDAβLDA is INTEGER. The leading dimension ofA.LDA >= max(1,N).BβB is COMPLEX*16 array, dimension (LDB, N). On entry, the matrixBin the pair(A,B). On exit,Bhas been overwritten.LDBβLDB is INTEGER. The leading dimension ofB.LDB >= max(1,N).ALPHAβALPHA is COMPLEX*16 array, dimension (N)BETAβBETA is COMPLEX*16 array, dimension (N). On exit,ALPHA(j)/BETA(j),j=1,...,N, will be the generalized eigenvalues.
Note: the quotients ALPHA(j)/BETA(j) may easily over- or underflow, and BETA(j) may even be zero. Thus, the user should avoid naively computing the ratio alpha/beta. However, ALPHA will be always less than and usually comparable with norm(A) in magnitude, and BETA always less than and usually comparable with norm(B).
VLβVL is COMPLEX*16 array, dimension (LDVL,N). IfJOBVL = 'V', the left generalized eigenvectorsu(j)are stored one after another in the columns ofVL, in the same order as their eigenvalues. Each eigenvector is scaled so the largest component hasabs(real part) + abs(imag. part) = 1. Not referenced ifJOBVL = 'N'.LDVLβLDVL is INTEGER. The leading dimension of the matrixVL.LDVL >= 1, and ifJOBVL = 'V',LDVL >= N.VRβVR is COMPLEX*16 array, dimension (LDVR,N). IfJOBVR = 'V', the right generalized eigenvectorsv(j)are stored one after another in the columns ofVR, in the same order as their eigenvalues. Each eigenvector is scaled so the largest component hasabs(real part) + abs(imag. part) = 1. Not referenced ifJOBVR = 'N'.LDVRβLDVR is INTEGER. The leading dimension of the matrixVR.LDVR >= 1, and ifJOBVR = 'V',LDVR >= N.WORKβWORK is COMPLEX*16 array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβLWORK is INTEGER. The dimension of the arrayWORK.LWORK >= max(1,2*N). For good performance,LWORKmust generally be larger.
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.
RWORKβRWORK is DOUBLE PRECISION array, dimension (8*N)INFOβINFO is INTEGER= 0: successful exit β¨< 0: ifINFO = -i, the i-th argument had an illegal value.=1,...,N: The QZ iteration failed. No eigenvectors have been calculated, butALPHA(j)andBETA(j)should be correct forj=INFO+1,...,N.> N:=N+1: other then QZ iteration failed inZHGEQZ,=N+2: error return fromZTGEVC.
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
π¦ subroutine zggev3 π¦
subroutine zggev3 (character JOBVL, character JOBVR, integer N, complex*16,
dimension( lda, * ) A, integer LDA, complex*16, dimension( ldb, * ) B,
integer LDB, complex*16, dimension( * ) ALPHA, complex*16, dimension( *
) BETA, complex*16, dimension( ldvl, * ) VL, integer LDVL, complex*16,
dimension( ldvr, * ) VR, integer LDVR, complex*16, dimension( * ) WORK,
integer LWORK, double precision, dimension( * ) RWORK, integer INFO)
ZGGEV3 computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices (blocked algorithm) π₯
β¨ Purpose β¨
ZGGEV3 computes for a pair of N-by-N complex nonsymmetric matrices (A,B), the generalized eigenvalues, and optionally, the left and/or right generalized eigenvectors.
A generalized eigenvalue for a pair of matrices (A,B) is a scalar lambda or a ratio alpha/beta = lambda, such that A - lambda*B is singular. It is usually represented as the pair (alpha,beta), as there is a reasonable interpretation for beta=0, and even for both being zero.
The right generalized eigenvector v(j) corresponding to the generalized eigenvalue lambda(j) of (A,B) satisfies
A * v(j) = lambda(j) * B * v(j).
The left generalized eigenvector u(j) corresponding to the generalized eigenvalues lambda(j) of (A,B) satisfies
u(j)**H * A = lambda(j) * u(j)**H * B
where u(j)**H is the conjugate-transpose of u(j).
π Parameters π
JOBVLβJOBVL is CHARACTER*1= 'N': do not compute the left generalized eigenvectors;= 'V': compute the left generalized eigenvectors.
JOBVRβJOBVR is CHARACTER*1= 'N': do not compute the right generalized eigenvectors;= 'V': compute the right generalized eigenvectors.
NβN is INTEGER. The order of the matricesA,B,VL, andVR.N >= 0.AβA is COMPLEX*16 array, dimension (LDA, N). On entry, the matrixAin the pair(A,B). On exit,Ahas been overwritten.LDAβLDA is INTEGER. The leading dimension ofA.LDA >= max(1,N).BβB is COMPLEX*16 array, dimension (LDB, N). On entry, the matrixBin the pair(A,B). On exit,Bhas been overwritten.LDBβLDB is INTEGER. The leading dimension ofB.LDB >= max(1,N).ALPHAβALPHA is COMPLEX*16 array, dimension (N)BETAβBETA is COMPLEX*16 array, dimension (N). On exit,ALPHA(j)/BETA(j),j=1,...,N, will be the generalized eigenvalues.
Note: the quotients ALPHA(j)/BETA(j) may easily over- or underflow, and BETA(j) may even be zero. Thus, the user should avoid naively computing the ratio alpha/beta. However, ALPHA will be always less than and usually comparable with norm(A) in magnitude, and BETA always less than and usually comparable with norm(B).
VLβVL is COMPLEX*16 array, dimension (LDVL,N). IfJOBVL = 'V', the left generalized eigenvectorsu(j)are stored one after another in the columns ofVL, in the same order as their eigenvalues. Each eigenvector is scaled so the largest component hasabs(real part) + abs(imag. part) = 1. Not referenced ifJOBVL = 'N'.LDVLβLDVL is INTEGER. The leading dimension of the matrixVL.LDVL >= 1, and ifJOBVL = 'V',LDVL >= N.VRVRβ aCOMPLEX*16array, dimension(LDVR,N). IfJOBVR = 'V', the right generalized eigenvectorsv(j)get stacked one after another in the columns ofVR, in the same order as their eigenvalues. Each eigenvector is scaled so that its biggest component hasabs(real part) + abs(imag. part) = 1. And ifJOBVR = 'N'? Not referenced, bestie, we literally do not look at it πLDVRβ INTEGER, the leading dimension of the matrixVR. The rules areLDVR >= 1, and ifJOBVR = 'V'thenLDVR >= N.WORKβCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0, thenWORK(1)serves up the optimalLWORKlike it's nothing β¨LWORKβ INTEGER, the dimension of the arrayWORK.
IfLWORK = -1, a workspace query is assumed: the routine only calculates the optimal size of theWORKarray, returns that value as the first entry of theWORKarray, and no error message related toLWORKis issued byXERBLA. Sneaky lil thing but we respect it π«Ά
RWORKβDOUBLE PRECISIONarray, dimension(8*N).INFOβ INTEGER. The receipts, in order:= 0: successful exit, we ate π< 0: ifINFO = -i, the i-th argument had an illegal value= 1,...,N: the QZ iteration failed π. No eigenvectors have been calculated, butALPHA(j)andBETA(j)should be correct forj=INFO+1,...,N.> N:=N+1: other than QZ iteration failed inZHGEQZ;=N+2: error return fromZTGEVC.
βοΈ Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ subroutine zggevx π¦
subroutine zggevx (character BALANC, character JOBVL, character JOBVR,
character SENSE, integer N, complex*16, dimension( lda, * ) A, integer
LDA, complex*16, dimension( ldb, * ) B, integer LDB, complex*16,
dimension( * ) ALPHA, complex*16, dimension( * ) BETA, complex*16,
dimension( ldvl, * ) VL, integer LDVL, complex*16, dimension( ldvr, * )
VR, integer LDVR, integer ILO, integer IHI, double precision, dimension(
* ) LSCALE, double precision, dimension( * ) RSCALE, double precision
ABNRM, double precision BBNRM, double precision, dimension( * ) RCONDE,
double precision, dimension( * ) RCONDV, complex*16, dimension( * )
WORK, integer LWORK, double precision, dimension( * ) RWORK, integer,
dimension( * ) IWORK, logical, dimension( * ) BWORK, integer INFO)
ZGGEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices π
π― Purpose
ZGGEVX computes, for a pair of N-by-N complex nonsymmetric matrices (A,B), the generalized eigenvalues β and, if you want them, the left and/or right generalized eigenvectors. Iconic behavior honestly.
Optionally it also computes a balancing transformation to improve the conditioning of the eigenvalues and eigenvectors (ILO, IHI, LSCALE, RSCALE, ABNRM, and BBNRM), reciprocal condition numbers for the eigenvalues (RCONDE), and reciprocal condition numbers for the right eigenvectors (RCONDV). So many little guys, and they all matter π§
A generalized eigenvalue for a pair of matrices (A,B) is a scalar lambda, or a ratio alpha/beta = lambda, such that A - lambda*B is singular. It's usually represented as the pair (alpha,beta), because there's a reasonable interpretation for beta=0, and even for both of them being zero. Yes, both zero. We don't judge π
The right eigenvector v(j) corresponding to the eigenvalue lambda(j) of (A,B) satisfies
A * v(j) = lambda(j) * B * v(j) .
The left eigenvector u(j) corresponding to the eigenvalue lambda(j) of (A,B) satisfies
u(j)**H * A = lambda(j) * u(j)**H * B.
where u(j)**H is the conjugate-transpose of u(j). Conjugate-transpose, say it with your chest π
π οΈ Parameters
BALANCβCHARACTER*1. Tells the routine which balance option to perform:= 'N': do not diagonally scale or permute;= 'P': permute only;= 'S': scale only;= 'B': both permute and scale.
Computed reciprocal condition numbers will be for the matrices after permuting and/or balancing. Permuting does not change condition numbers (in exact arithmetic), but balancing does. That's the whole plot twist π₯
JOBVLβCHARACTER*1:= 'N': do not compute the left generalized eigenvectors;= 'V': compute the left generalized eigenvectors.
JOBVRβCHARACTER*1:= 'N': do not compute the right generalized eigenvectors;= 'V': compute the right generalized eigenvectors.
SENSEβCHARACTER*1. Determines which reciprocal condition numbers get computed:= 'N': none are computed;= 'E': computed for eigenvalues only;= 'V': computed for eigenvectors only;= 'B': computed for eigenvalues and eigenvectors.
Nβ INTEGER. The order of the matricesA,B,VL, andVR.N >= 0.AβCOMPLEX*16array, dimension(LDA, N). On entry, the matrixAin the pair(A,B). On exit,Ahas been overwritten. IfJOBVL='V'orJOBVR='V'or both, thenAcontains the first part of the complex Schur form of the 'balanced' versions of the inputAandB. She got a whole makeover πLDAβ INTEGER. The leading dimension ofA.LDA >= max(1,N).BβCOMPLEX*16array, dimension(LDB, N). On entry, the matrixBin the pair(A,B). On exit,Bhas been overwritten. IfJOBVL='V'orJOBVR='V'or both, thenBcontains the second part of the complex Schur form of the 'balanced' versions of the inputAandB. Matching set, obviously πLDBβ INTEGER. The leading dimension ofB.LDB >= max(1,N).ALPHAβCOMPLEX*16array, dimension(N).BETAβCOMPLEX*16array, dimension(N). On exit,ALPHA(j)/BETA(j),j=1,...,N, will be the generalized eigenvalues.
Note: the quotientALPHA(j)/BETA(j)may easily over- or underflow, andBETA(j)may even be zero. Thus, the user should avoid naively computing the ratioALPHA/BETA. However,ALPHAwill be always less than and usually comparable withnorm(A)in magnitude, andBETAalways less than and usually comparable withnorm(B). Do NOT just divide them, bestie, I'm begging π
VLβCOMPLEX*16array, dimension(LDVL,N). IfJOBVL = 'V', the left generalized eigenvectorsu(j)are stored one after another in the columns ofVL, in the same order as their eigenvalues. Each eigenvector will be scaled so the largest component will haveabs(real part) + abs(imag. part) = 1. Not referenced ifJOBVL = 'N'.LDVLβ INTEGER. The leading dimension of the matrixVL.LDVL >= 1, and ifJOBVL = 'V',LDVL >= N.VRβCOMPLEX*16array, dimension(LDVR,N). IfJOBVR = 'V', the right generalized eigenvectorsv(j)are stored one after another in the columns ofVR, in the same order as their eigenvalues. Each eigenvector will be scaled so the largest component will haveabs(real part) + abs(imag. part) = 1. Not referenced ifJOBVR = 'N'.LDVRβ INTEGER. The leading dimension of the matrixVR.LDVR >= 1, and ifJOBVR = 'V',LDVR >= N.ILOβ INTEGER.IHIβ INTEGER.ILOandIHIare integer values such that on exitA(i,j) = 0andB(i,j) = 0ifi > jandj = 1,...,ILO-1ori = IHI+1,...,N. IfBALANC = 'N'or'S',ILO = 1andIHI = N.LSCALEβDOUBLE PRECISIONarray, dimension(N). Details of the permutations and scaling factors applied to the left side ofAandB. IfPL(j)is the index of the row interchanged with rowj, andDL(j)is the scaling factor applied to rowj, then
LSCALE(j) = PL(j) for j = 1,...,ILO-1
= DL(j) for j = ILO,...,IHI
= PL(j) for j = IHI+1,...,N.
The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1.
RSCALEβDOUBLE PRECISIONarray, dimension(N). Details of the permutations and scaling factors applied to the right side ofAandB. IfPR(j)is the index of the column interchanged with columnj, andDR(j)is the scaling factor applied to columnj, then
RSCALE(j) = PR(j) for j = 1,...,ILO-1
= DR(j) for j = ILO,...,IHI
= PR(j) for j = IHI+1,...,N
The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1.
ABNRMβDOUBLE PRECISION. The one-norm of the balanced matrixA.BBNRMβDOUBLE PRECISION. The one-norm of the balanced matrixB.RCONDEβDOUBLE PRECISIONarray, dimension(N). IfSENSE = 'E'or'B', the reciprocal condition numbers of the eigenvalues, stored in consecutive elements of the array. IfSENSE = 'N'or'V',RCONDEis not referenced.RCONDVβDOUBLE PRECISIONarray, dimension(N). IfJOB = 'V'or'B', the estimated reciprocal condition numbers of the eigenvectors, stored in consecutive elements of the array. If the eigenvalues cannot be reordered to computeRCONDV(j),RCONDV(j)is set to0; this can only occur when the true value would be very small anyway. IfSENSE = 'N'or'E',RCONDVis not referenced.WORKβCOMPLEX*16array, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. π«ΆLWORKβ
LWORK
okay bestie, LWORK is an INTEGER, and it's literally the dimension of the WORK array. the rule is LWORK >= max(1,2*N). no cap.
if SENSE = 'E', then you need LWORK >= max(1,4*N).
if SENSE = 'V' or SENSE = 'B', then it's giving LWORK >= max(1,2*N*N+2*N). yes, that's the whole vibe.
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. iconic behavior, honestly.
RWORK
RWORK is a DOUBLE PRECISION array, dimension (lrwork). lrwork must be at least max(1,6*N) if BALANC = 'S' or BALANC = 'B', and at least max(1,2*N) otherwise. it's the real workspace, periodt.
IWORK
IWORK is an INTEGER array, dimension (N+2). if SENSE = 'E', IWORK is not referenced. so if that's your setting, she's just there for moral support. π
BWORK
BWORK is a LOGICAL array, dimension (N). if SENSE = 'N', BWORK is not referenced. okay? okay.
INFO
INFO is an INTEGER, and it's the final vibe check:
= 0: successful exit. we love a happy ending. β¨< 0: ifINFO = -i, the i-th argument had an illegal value. not the move, bestie.= 1,...,N: The QZ iteration failed. No eigenvectors have been calculated, butALPHA(j)andBETA(j)should be correct forj=INFO+1,...,N.> N:=N+1: other than QZ iteration failed inZHGEQZ.=N+2: error return fromZTGEVC.
β¨ Author β¨
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details π
Balancing a matrix pair (A,B) includes, first, permuting rows and columns to isolate eigenvalues, second, applying diagonal similarity transformation to the rows and columns to make the rows and columns as close in norm as possible. The computed reciprocal condition numbers correspond to the balanced matrix. Permuting rows and columns will not change the condition numbers (in exact arithmetic) but diagonal scaling will. For further explanation of balancing, see section 4.11.1.2 of LAPACK Users' Guide.
An approximate error bound on the chordal distance between the i-th computed generalized eigenvalue w and the corresponding exact eigenvalue lambda is
chord(w, lambda) <= EPS * norm(ABNRM, BBNRM) / RCONDE(I)
An approximate error bound for the angle between the i-th computed eigenvector VL(i) or VR(i) is given by
EPS * norm(ABNRM, BBNRM) / DIF(i).
For further explanation of the reciprocal condition numbers RCONDE and RCONDV, see section 4.11 of LAPACK User's Guide.
π«Ά Author π«Ά
Generated automatically by Doxygen for LAPACK from the source code.
and that's the whole page, bestie. this was LAPACK version 3.11.0, dated Sun Nov 27 2022, and it's the complex16GEeigen(3) manual page. go off, you understood the assignment. πβ¨
π¦ where this page comes from
- debian bookworm: liblapack-doc 3.11.0-2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms