geevx(3)
β¨ geevx(3) β¨ β like, the geevx of the LAPACK library functions manual, bestie π
okay so. gather round. this is the manual page for geevx from the Library Functions Manual, and honestly? it's giving eigen-everything. eigenvalues, eigenvectors, condition numbers, balancing β the whole glow-up. no cap, this one's a lot, so let's go π¦
πΈ NAME πΈ
geevx β ok so it's literally geevx: eig, expert. that's the whole vibe. eig but make it expert. periodt.
β¨ SYNOPSIS β¨
π Functions
here's the squad β four subroutines, all iconic, all doing the same job in different number flavours (complex, double, single, double-complex):
subroutine cgeevx (balanc, jobvl, jobvr, sense, n, a, lda, w, vl, ldvl, vr, ldvr, ilo, ihi, scale, abnrm, rconde, rcondv, work, lwork, rwork, info)β CGEEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices π«Άsubroutine dgeevx (balanc, jobvl, jobvr, sense, n, a, lda, wr, wi, vl, ldvl, vr, ldvr, ilo, ihi, scale, abnrm, rconde, rcondv, work, lwork, iwork, info)β DGEEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices βsubroutine sgeevx (balanc, jobvl, jobvr, sense, n, a, lda, wr, wi, vl, ldvl, vr, ldvr, ilo, ihi, scale, abnrm, rconde, rcondv, work, lwork, iwork, info)β SGEEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices π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 π₯
notice how dgeevx and sgeevx have wr, wi (real and imaginary parts, bestie β real matrices give complex answers, we been knew) and complex cgeevx/zgeevx just have w. also iwork vs rwork at the end there. main character details π
π Detailed Description π
π§ Function Documentation
π subroutine cgeevx π
subroutine cgeevx (character balanc, character jobvl, character jobvr,
character sense, integer n, complex, dimension( lda, * ) a, integer lda,
complex, dimension( * ) w, complex, dimension( ldvl, * ) vl, integer
ldvl, complex, dimension( ldvr, * ) vr, integer ldvr, integer ilo,
integer ihi, real, dimension( * ) scale, real abnrm, real, dimension( *
) rconde, real, dimension( * ) rcondv, complex, dimension( * ) work,
integer lwork, real, dimension( * ) rwork, integer info)
CGEEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices β¨
π Purpose:
!> CGEEVX 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). !> !> 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. !> !> 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. !>
so like β eigenvalues and eigenvectors and balancing and condition numbers. it's the full package bestie, we love a subroutine that does the most π
πΈ Parameters
BALANCβBALANCisCHARACTER*1. it tells the routine how to diagonally scale and/or permute the input matrix so its eigenvalues are better conditioned. options are:
!> BALANC is CHARACTER*1 !> Indicates how the input matrix should be diagonally scaled !> and/or permuted to improve the conditioning of its !> eigenvalues. !> = 'N': Do not diagonally scale or permute; !> = 'P': Perform permutations to make the matrix more nearly !> upper triangular. Do not diagonally scale; !> = 'S': Diagonally scale the matrix, ie. replace A by !> D*A*D**(-1), where D is a diagonal matrix chosen !> to make the rows and columns of A more equal in !> norm. Do not permute; !> = 'B': Both diagonally scale and permute A. !> !> Computed reciprocal condition numbers will be for the matrix !> after balancing and/or permuting. Permuting does not change !> condition numbers (in exact arithmetic), but balancing does. !>
(so 'N' = do nothing, 'P' = permute only, 'S' = scale only, 'B' = both. and heads up: the condition numbers you get back are for the balanced/permuted matrix, and permuting doesn't change them in exact arithmetic but scaling does π«Ά)
JOBVLβJOBVLisCHARACTER*1.
!> = 'N': left eigenvectors of A are not computed; !> = 'V': left eigenvectors of A are computed. !> If SENSE = 'E' or 'B', JOBVL must = 'V'. !>
(you want left eigenvectors? say 'V'. and if SENSE = 'E' or 'B', JOBVL must be 'V' β non-negotiable bestie π)
JOBVRβJOBVRisCHARACTER*1.
!> = 'N': right eigenvectors of A are not computed; !> = 'V': right eigenvectors of A are computed. !> If SENSE = 'E' or 'B', JOBVR must = 'V'. !>
(same deal for the right eigenvectors. SENSE = 'E' or 'B' means JOBVR must be 'V' π)
SENSEβSENSEisCHARACTER*1. it picks 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', both left and right eigenvectors !> must also be computed (JOBVL = 'V' and JOBVR = 'V'). !>
(if SENSE = 'E' or 'B' you gotta compute both left and right eigenvectors β JOBVL = 'V' and JOBVR = 'V'. them's the rules β¨)
NβNisINTEGER. the order of the matrixA.N >= 0. πAβAisCOMPLEX array, dimension (LDA,N).
!> On entry, the N-by-N matrix A. !> On exit, A has been overwritten. If JOBVL = 'V' or !> JOBVR = 'V', A contains the Schur form of the balanced !> version of the matrix A. !>
(β οΈ it gets overwritten, bestie. no take-backs. and if JOBVL = 'V' or JOBVR = 'V', you're left holding the Schur form of the balanced A.)
LDAβLDAisINTEGER. the leading dimension of the arrayA.LDA >= max(1,N). πWβWisCOMPLEX array, dimension (N).Wholds the computed eigenvalues. πVLβVLisCOMPLEX 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. !> u(j) = VL(:,j), the j-th column of VL. !>
(one per column, in eigenvalue order. u(j) = VL(:,j). and if JOBVL = 'N', VL is literally not even referenced, so don't stress about it π¦)
LDVLβLDVLisINTEGER. the leading dimension of the arrayVL.LDVL >= 1; ifJOBVL = 'V',LDVL >= N. πVRβVRisCOMPLEX 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. !> v(j) = VR(:,j), the j-th column of VR. !>
(same energy, right side: v(j) = VR(:,j). JOBVR = 'N' means VR isn't referenced at all π)
LDVRβLDVRisINTEGER. the leading dimension of the arrayVR.LDVR >= 1; ifJOBVR = 'V',LDVR >= N. πILOβILOisINTEGER. (just vibes here, the real explanation is underIHIπ)IHIβIHIisINTEGER.
!> 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. !>
(these two are the integer values that got figured out while balancing. and the balanced A(i,j) = 0 if I > J and J = 1,...,ILO-1 or I = IHI+1,...,N β like, those corners are zero, periodt π)
SCALEβSCALEisREAL array, dimension (N).
!> Details of 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. !> The order in which the interchanges are made is N to IHI+1, !> then 1 to ILO-1. !>
(the receipts of what balancing actually did π§Ύ. and the interchange order is N to IHI+1, then 1 to ILO-1 β iykyk)
ABNRMβABNRMisREAL. the one-norm of the balanced matrix (the maximum of the sum of absolute values of elements of any column). π₯RCONDEβRCONDEisREAL array, dimension (N).RCONDE(j)is the reciprocal condition number of the j-th eigenvalue. βRCONDVβRCONDVisREAL array, dimension (N).RCONDV(j)is the reciprocal condition number of the j-th right eigenvector. βWORKβWORKisCOMPLEX array, dimension (MAX(1,LWORK)).
!> On exit, if INFO = 0, WORK(1) returns the optimal LWORK. !>
(so if it exits clean with INFO = 0, WORK(1) is telling you the optimal LWORK. free intel π«Ά)
LWORKβLWORKisINTEGER. the dimension of the arrayWORK. the rules:
!> The dimension of the array WORK. If SENSE = 'N' or 'E', !> LWORK >= max(1,2*N), and if SENSE = 'V' or 'B', !> LWORK >= N*N+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 by XERBLA. !>
(so: SENSE = 'N' or 'E' β LWORK >= max(1,2*N); SENSE = 'V' or 'B' β LWORK >= N*N+2*N. and for good performance, LWORK must generally be larger β treat it like a recommendation from your friend who's always right. also!! LWORK = -1 means workspace query: it only calculates the optimal size of the WORK array, returns it as the first entry of WORK, and XERBLA won't throw any LWORK-related error at you. iconic π)
RWORKβRWORKisREAL array, dimension (2*N). πINFOβINFOisINTEGER.
!> = 0: successful exit !> < 0: if INFO = -i, the i-th argument had an illegal value. !> > 0: if INFO = i, the QR algorithm failed to compute all the !> eigenvalues, and no eigenvectors or condition numbers !> have been computed; elements 1:ILO-1 and i+1:N of W !> contain eigenvalues which have converged. !>
(the vibe check report: 0 = we slayed, < 0 = argument -i was illegal, > 0 = the QR algorithm couldn't get all the eigenvalues, so no eigenvectors or condition numbers were computed β only 1:ILO-1 and i+1:N of W have converged eigenvalues. so close bestie π)
π Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
(they ate, fr fr π)
β Definition
Definition at line 285 of file cgeevx.f.
okay that's cgeevx down π β and there's more coming, so don't go anywhereβ¦
subroutine dgeevx (character balanc, character jobvl, character jobvr,
character sense, integer n, double precision, dimension( lda, * ) a,
integer lda, double precision, dimension( * ) wr, double precision,
dimension( * ) wi, double precision, dimension( ldvl, * ) vl, integer
ldvl, double precision, dimension( ldvr, * ) vr, integer ldvr, integer
ilo, integer ihi, double precision, dimension( * ) scale, double
precision abnrm, double precision, dimension( * ) rconde, double
precision, dimension( * ) rcondv, double precision, dimension( * ) work,
integer lwork, integer, dimension( * ) iwork, integer info)
β¨ DGEEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices. β¨
β¨ Purpose β¨
okay so bestie, here's the whole vibe: DGEEVX computes, for an N-by-N real nonsymmetric matrix A, the eigenvalues and β if you want them β the left and/or right eigenvectors. π
Optionally, it also 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). It's giving "I did the math and also the glow-up." β¨
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. No cap, that's the standard.
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β is aCHARACTER*1that tells the routine how the input matrix should be diagonally scaled and/or permuted to improve the conditioning of its eigenvalues.'N': Do not diagonally scale or permute;'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.
Computed reciprocal condition numbers will be for the matrix after balancing and/or permuting. Permuting does not change condition numbers (in exact arithmetic), but balancing does. π₯
JOBVLβ is aCHARACTER*1.'N': left eigenvectors ofAare not computed;'V': left eigenvectors ofAare computed.
If SENSE = 'E' or 'B', JOBVL must = 'V'. π
JOBVRβ is aCHARACTER*1.'N': right eigenvectors ofAare not computed;'V': right eigenvectors ofAare computed.
If SENSE = 'E' or 'B', JOBVR must = 'V'. π
SENSEβ is aCHARACTER*1that determines which reciprocal condition numbers are 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', both left and right eigenvectors must also be computed (JOBVL = 'V' and JOBVR = 'V'). π
Nβ isINTEGER. The order of the matrixA.N >= 0.Aβ isDOUBLE PRECISION array, dimension (LDA,N). On entry, theN-by-NmatrixA. On exit,Ahas been overwritten. IfJOBVL = 'V'orJOBVR = 'V',Acontains the real Schur form of the balanced version of the input matrixA. πLDAβ isINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).WRβ isDOUBLE PRECISION array, dimension (N).WIβ isDOUBLE PRECISION array, dimension (N).WRandWIcontain the real and imaginary parts, respectively, of the computed eigenvalues. Complex conjugate pairs of eigenvalues will appear consecutively with the eigenvalue having the positive imaginary part first. πΈVLβ isDOUBLE PRECISION 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. If thej-th eigenvalue is real, thenu(j) = VL(:,j), thej-th column ofVL. If thej-th and(j+1)-st eigenvalues form a complex conjugate pair, thenu(j) = VL(:,j) + i*VL(:,j+1)andu(j+1) = VL(:,j) - i*VL(:,j+1). π¦LDVLβ isINTEGER. The leading dimension of the arrayVL.LDVL >= 1; ifJOBVL = 'V',LDVL >= N.VRβ isDOUBLE PRECISION 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. If thej-th eigenvalue is real, thenv(j) = VR(:,j), thej-th column ofVR. If thej-th and(j+1)-st eigenvalues form a complex conjugate pair, thenv(j) = VR(:,j) + i*VR(:,j+1)andv(j+1) = VR(:,j) - i*VR(:,j+1). π¦LDVRβ isINTEGER. The leading dimension of the arrayVR.LDVR >= 1, and ifJOBVR = 'V',LDVR >= N.ILOβ isINTEGER.IHIβ isINTEGER.ILOandIHIare integer values determined whenAwas balanced. The balancedA(i,j) = 0ifI > JandJ = 1,...,ILO-1orI = IHI+1,...,N. πSCALEβ isDOUBLE PRECISION array, dimension (N). Details of the permutations and scaling factors applied when balancingA. IfP(j)is the index of the row and column interchanged with row and columnj, andD(j)is the scaling factor applied to row and columnj, thenSCALE(J) = P(J)forJ = 1,...,ILO-1;= D(J)forJ = ILO,...,IHI;= P(J)forJ = IHI+1,...,N. The order in which the interchanges are made isNtoIHI+1, then1toILO-1. βABNRMβ isDOUBLE PRECISION. The one-norm of the balanced matrix (the maximum of the sum of absolute values of elements of any column). π₯RCONDEβ isDOUBLE PRECISION array, dimension (N).RCONDE(j)is the reciprocal condition number of thej-th eigenvalue. πRCONDVβ isDOUBLE PRECISION array, dimension (N).RCONDV(j)is the reciprocal condition number of thej-th right eigenvector. πWORKβ isDOUBLE PRECISION array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. β¨LWORKβ isINTEGER. The dimension of the arrayWORK. IfSENSE = 'N'or'E',LWORK >= max(1,2*N), and ifJOBVL = 'V'orJOBVR = 'V',LWORK >= 3*N. IfSENSE = 'V'or'B',LWORK >= N*(N+6). 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. π«Ά
IWORKβ isINTEGER array, dimension (2*N-2). IfSENSE = 'N'or'E', not referenced.INFOβ isINTEGER.= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value.> 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:NofWRandWIcontain eigenvalues which have converged. π
β¨ Author β¨
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
β¨ Definition β¨
Definition at line 303 of file dgeevx.f.
π¦ sgeevx β the real-valued one
subroutine sgeevx (character balanc, character jobvl, character jobvr,
character sense, integer n, real, dimension( lda, * ) a, integer lda,
real, dimension( * ) wr, real, dimension( * ) wi, real, dimension( ldvl,
* ) vl, integer ldvl, real, dimension( ldvr, * ) vr, integer ldvr,
integer ilo, integer ihi, real, dimension( * ) scale, real abnrm, real,
dimension( * ) rconde, real, dimension( * ) rcondv, real, dimension( * )
work, integer lwork, integer, dimension( * ) iwork, integer info)
SGEEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices π
β¨ Purpose β¨
okay so bestie, picture this β you hand SGEEVX an N-by-N real nonsymmetric matrix A, and it gives you back:
- the eigenvalues π₯
- and, if you want them, the left and/or right eigenvectors π
And that's not even the whole slay. Optionally it also computes:
- a balancing transformation to improve the conditioning of the eigenvalues and eigenvectors (
ILO,IHI,SCALE, andABNRM) π - reciprocal condition numbers for the eigenvalues (
RCONDE) β¨ - reciprocal condition numbers for the right eigenvectors (
RCONDV) π¦
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). yes, the H is doing a whole lot of work there, ik π
The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real. periodt.
Now, balancing a matrix β let me put you on, because this is the part people skip and then get confused: balancing means permuting the rows and columns to make the matrix 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βCHARACTER*1. Indicates how the input matrix should be diagonally scaled and/or permuted to improve the conditioning of its eigenvalues.= 'N': Do not diagonally scale or permute;= '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.
Computed reciprocal condition numbers will be for the matrix after balancing and/or permuting. Permuting does not change condition numbers (in exact arithmetic), but balancing does. lowkey important, don't skip π«Ά
JOBVLβCHARACTER*1.= 'N': left eigenvectors ofAare not computed;= 'V': left eigenvectors ofAare computed.
If SENSE = 'E' or 'B', JOBVL must = 'V'. no wiggle room, bestie π
JOBVRβCHARACTER*1.= 'N': right eigenvectors ofAare not computed;= 'V': right eigenvectors ofAare computed.
If SENSE = 'E' or 'B', JOBVR must = 'V'. same energy π
SENSEβCHARACTER*1. Determines which reciprocal condition numbers are 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', both left and right eigenvectors must also be computed (JOBVL = 'V' and JOBVR = 'V'). it's giving "you can't have one without the other" π
NβINTEGER. The order of the matrixA.N >= 0.AβREALarray, dimension(LDA,N). On entry, the N-by-N matrixA. On exit,Ahas been overwritten. IfJOBVL = 'V'orJOBVR = 'V',Acontains the real Schur form of the balanced version of the input matrixA. yeah she got a whole new look, that's the vibe check passing πΈLDAβINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).WRβREALarray, dimension(N).WIβREALarray, dimension(N).WRandWIcontain the real and imaginary parts, respectively, of the computed eigenvalues. Complex conjugate pairs of eigenvalues will appear consecutively with the eigenvalue having the positive imaginary part first. ik, it's a cute little pairing rule πVLβREALarray, 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. If the j-th eigenvalue is real, thenu(j) = VL(:,j), the j-th column ofVL. If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, thenu(j) = VL(:,j) + i*VL(:,j+1)andu(j+1) = VL(:,j) - i*VL(:,j+1). two columns, one vibe πLDVLβINTEGER. The leading dimension of the arrayVL.LDVL >= 1; ifJOBVL = 'V',LDVL >= N.VRβREALarray, 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. If the j-th eigenvalue is real, thenv(j) = VR(:,j), the j-th column ofVR. If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, thenv(j) = VR(:,j) + i*VR(:,j+1)andv(j+1) = VR(:,j) - i*VR(:,j+1). mirror ofVL, main character energy π¦LDVRβINTEGER. The leading dimension of the arrayVR.LDVR >= 1, and ifJOBVR = 'V',LDVR >= N.ILOβINTEGER.IHIβINTEGER.ILOandIHIare integer values determined whenAwas balanced. The balancedA(i,j) = 0ifI > JandJ = 1,...,ILO-1orI = IHI+1,...,N. those zeros are not an accident, they're the point β¨SCALEβREALarray, dimension(N). Details of the permutations and scaling factors applied when balancingA. IfP(j)is the index of the row and column interchanged with row and columnj, andD(j)is the scaling factor applied to row and columnj, then
SCALE(J) = P(J), for J = 1,...,ILO-1
= D(J), for J = ILO,...,IHI
= P(J) for J = IHI+1,...,N.
The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1. yes the order matters, do not come for me π€
ABNRMβREAL. The one-norm of the balanced matrix (the maximum of the sum of absolute values of elements of any column).RCONDEβREALarray, dimension(N).RCONDE(j)is the reciprocal condition number of the j-th eigenvalue.RCONDVβREALarray, dimension(N).RCONDV(j)is the reciprocal condition number of the j-th right eigenvector.WORKβREALarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKβINTEGER. The dimension of the arrayWORK. IfSENSE = 'N'or'E',LWORK >= max(1,2*N), and ifJOBVL = 'V'orJOBVR = 'V',LWORK >= 3*N. IfSENSE = 'V'or'B',LWORK >= N*(N+6). For good performance,LWORKmust generally be larger. (bigger workspace = happier routine, that's just facts π₯)
If LWORK = -1, then a workspace query is assumed; the routine only calculates the optimal size of the WORK array, returns this value as the first entry of the WORK array, and no error message related to LWORK is issued by XERBLA. so you can ask "how much do u need bestie" without getting yelled at, iconic π
IWORKβINTEGERarray, dimension(2*N-2). IfSENSE = 'N'or'E', not referenced.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 or condition numbers have been computed; elements1:ILO-1andi+1:NofWRandWIcontain eigenvalues which have converged. π partial results, but like, at least you got some of them
π Author π
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
Definition at line 303 of file sgeevx.f.
π zgeevx β now in complex π
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 π
β¨ Purpose β¨
...and the math bits? lowkey the whole point, so let's go π«Ά
The right eigenvector v(j) of A satisfies
A * v(j) = lambda(j) * v(j)
where lambda(j) is its eigenvalue. Slay.
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). Bestie, that conjugate transpose is doing so much work, respect.
The computed eigenvectors are normalized to have Euclidean norm equal to 1 and largest component real. Periodt β that's the normalization, don't come for me.
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
BALANC is CHARACTER*1 β it indicates how the input matrix should be diagonally scaled and/or permuted to improve the conditioning of its eigenvalues. The vibe check, basically:
'N'β Do not diagonally scale or permute;'P'β Perform permutations to make the matrix more nearly upper triangular. Do not diagonally scale;'S'β Diagonally scale the matrix, ie. 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.
Computed reciprocal condition numbers will be for the matrix after balancing and/or permuting. Permuting does not change condition numbers (in exact arithmetic), but balancing does. π
JOBVL
JOBVL is CHARACTER*1:
'N'β left eigenvectors ofAare not computed;'V'β left eigenvectors ofAare computed.
If SENSE = 'E' or 'B', JOBVL must = 'V'. Not optional, bestie, it's a rule.
JOBVR
JOBVR is CHARACTER*1:
'N'β right eigenvectors ofAare not computed;'V'β right eigenvectors ofAare computed.
If SENSE = 'E' or 'B', JOBVR must = 'V'. Same deal, no cap.
SENSE
SENSE is CHARACTER*1 β determines which reciprocal condition numbers are 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', both left and right eigenvectors must also be computed (JOBVL = 'V' and JOBVR = 'V'). Like, you literally can't skip them, that's the whole deal. π
N
N is INTEGER β the order of the matrix A. N >= 0. (Zero is legal, don't be weird about it.)
A
A is COMPLEX*16 array, dimension (LDA,N).
On entry, the N-by-N matrix A. On exit, A has been overwritten. If JOBVL = 'V' or JOBVR = 'V', A contains the Schur form of the balanced version of the matrix A. π¦
She's been through some things, okay β your input A is gone-gone on the way out. Plan accordingly.
LDA
LDA is INTEGER β the leading dimension of the array A. LDA >= max(1,N).
W
W is COMPLEX*16 array, dimension (N). W contains the computed eigenvalues. The main characters, honestly. π
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.
u(j) = VL(:,j), the j-th column of VL. Column energy, iconic.
LDVL
LDVL is INTEGER β the leading dimension of the array VL. LDVL >= 1; if JOBVL = 'V', 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.
v(j) = VR(:,j), the j-th column of VR. Same energy, other side. πΈ
LDVR
LDVR is INTEGER β the leading dimension of the array VR. LDVR >= 1; if JOBVR = 'V', LDVR >= N.
ILO
ILO is INTEGER. That's it, that's the entry β it's explained with its buddy below. π
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. Free zeros, we love to see it.
SCALE
SCALE is DOUBLE PRECISION array, dimension (N).
Details of 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.
The order in which the interchanges are made is N to IHI+1, then 1 to ILO-1. Yeah, it goes backwards first β read it twice, it's fine, I had to. π
ABNRM
ABNRM is DOUBLE PRECISION β the one-norm of the balanced matrix (the maximum of the sum of absolute values of elements of any column). Big number, one column at a time. π₯
RCONDE
RCONDE is DOUBLE PRECISION array, dimension (N). RCONDE(j) is the reciprocal condition number of the j-th eigenvalue.
RCONDV
RCONDV is DOUBLE PRECISION array, dimension (N). 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, WORK(1) returns the optimal LWORK. She snitches on the best workspace size for you, we stan a helpful queen. β¨
LWORK
LWORK is INTEGER β the dimension of the array WORK.
If SENSE = 'N' or 'E', LWORK >= max(1,2*N), and if SENSE = 'V' or 'B', LWORK >= N*N+2*N. For good performance, LWORK must generally be larger. (Like, minimum viable is not the flex.)
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. Sneaky little -1 trick, lowkey my fave.
RWORK
RWORK is DOUBLE PRECISION array, dimension (2*N). Just vibes and scratch space, that's all it says, that's all I got. π
INFO
INFO is INTEGER:
= 0: successful exit< 0: ifINFO = -i, thei-th argument had an illegal value.> 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.
If you getINFO > 0you got a partial result β a little bit of slay, but not the full slay. Check thoseWranges before you trust anything downstream. π
π«Ά Author π«Ά
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Definition at line 285 of file zgeevx.f
π§ Author π§
Generated automatically by Doxygen for LAPACK from the source code.
And that's the whole page, bestie β that was LAPACK Version 3.12.0, geevx(3), generated from the source code, and you made it all the way to the end so honestly you're the main character here. Go get those eigenvalues. ππ
π¦ 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