realGEeigen(3)
๐ realGEeigen(3) ๐ โ LAPACK
okay so bestie, welcome to the real eigenvalue driver page ๐ this is the whole squad of routines that do eigenvalue stuff for GE matrices, and yes it's a lot, but we're gonna get through it together, no cap.
๐ NAME
realGEeigen โ real
๐ SYNOPSIS
๐ ๏ธ Functions
sgees
subroutine sgees (JOBVS, SORT, SELECT, N, A, LDA, SDIM, WR, WI, VS,
LDVS, WORK, LWORK, BWORK, INFO)
SGEES computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices โจ
sgeesx
subroutine sgeesx (JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM, WR, WI,
VS, LDVS, RCONDE, RCONDV, WORK, LWORK, IWORK, LIWORK, BWORK, INFO)
SGEESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices โจ
sgeev
subroutine sgeev (JOBVL, JOBVR, N, A, LDA, WR, WI, VL, LDVL, VR, LDVR,
WORK, LWORK, INFO)
SGEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices ๐ซ
sgeevx
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 ๐ซ
sgges
subroutine sgges (JOBVSL, JOBVSR, SORT, SELCTG, N, A, LDA, B, LDB, SDIM,
ALPHAR, ALPHAI, BETA, VSL, LDVSL, VSR, LDVSR, WORK, LWORK, BWORK,
INFO)
SGGES computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices โจ
sgges3
subroutine sgges3 (JOBVSL, JOBVSR, SORT, SELCTG, N, A, LDA, B, LDB,
SDIM, ALPHAR, ALPHAI, BETA, VSL, LDVSL, VSR, LDVSR, WORK, LWORK,
BWORK, INFO)
SGGES3 computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices (blocked algorithm) ๐ง
sggesx
subroutine sggesx (JOBVSL, JOBVSR, SORT, SELCTG, SENSE, N, A, LDA, B,
LDB, SDIM, ALPHAR, ALPHAI, BETA, VSL, LDVSL, VSR, LDVSR, RCONDE,
RCONDV, WORK, LWORK, IWORK, LIWORK, BWORK, INFO)
SGGESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices โจ
sggev
subroutine sggev (JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHAR, ALPHAI, BETA,
VL, LDVL, VR, LDVR, WORK, LWORK, INFO)
SGGEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices ๐ซ
sggev3
subroutine sggev3 (JOBVL, JOBVR, N, A, LDA, B, LDB, ALPHAR, ALPHAI,
BETA, VL, LDVL, VR, LDVR, WORK, LWORK, INFO)
SGGEV3 computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices (blocked algorithm) ๐ง
sggevx
subroutine sggevx (BALANC, JOBVL, JOBVR, SENSE, N, A, LDA, B, LDB,
ALPHAR, ALPHAI, BETA, VL, LDVL, VR, LDVR, ILO, IHI, LSCALE, RSCALE,
ABNRM, BBNRM, RCONDE, RCONDV, WORK, LWORK, IWORK, BWORK, INFO)
SGGEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices ๐ซ
๐ฆ Detailed Description
This is the group of real eigenvalue driver functions for GE matrices ๐ธ
๐ Function Documentation
๐ subroutine sgees
subroutine sgees (character JOBVS, character SORT, external SELECT, integer
N, real, dimension( lda, * ) A, integer LDA, integer SDIM, real,
dimension( * ) WR, real, dimension( * ) WI, real, dimension( ldvs, * )
VS, integer LDVS, real, dimension( * ) WORK, integer LWORK, logical,
dimension( * ) BWORK, integer INFO)
SGEES computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices โจ
๐ฏ Purpose:
SGEES computes for an N-by-N real nonsymmetric matrix A, the eigenvalues, the real Schur form T, and, optionally, the matrix of Schur vectors Z. This gives the Schur factorization A = Z*T*(Z**T).
Optionally, it also orders the eigenvalues on the diagonal of the real 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 matrix is in real Schur form if it is upper quasi-triangular with 1-by-1 and 2-by-2 blocks. 2-by-2 blocks will be standardized in the form
[ a b ]
[ c a ]
where b*c < 0. The eigenvalues of such a block are a +- sqrt(bc).
๐ง Parameters
JOBVSโJOBVSisCHARACTER*1= 'N': Schur vectors are not computed;= 'V': Schur vectors are computed.
SORTโSORTisCHARACTER*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).
SELECTโSELECTis aLOGICAL FUNCTIONof twoREALarguments.SELECTmust be declaredEXTERNALin the calling subroutine. IfSORT = 'S',SELECTis used to select eigenvalues to sort to the top left of the Schur form. IfSORT = 'N',SELECTis not referenced. An eigenvalueWR(j)+sqrt(-1)*WI(j)is selected ifSELECT(WR(j),WI(j))is true; i.e., if either one of a complex conjugate pair of eigenvalues is selected, then both complex eigenvalues are selected. Note that a selected complex eigenvalue may no longer satisfySELECT(WR(j),WI(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โNisINTEGER. The order of the matrixA.N >= 0.AโAisREALarray, dimension(LDA,N). On entry, the N-by-N matrixA. On exit,Ahas been overwritten by its real Schur formT.LDAโLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).SDIMโSDIMisINTEGER. IfSORT = 'N',SDIM = 0. IfSORT = 'S',SDIM= number of eigenvalues (after sorting) for whichSELECTis true. (Complex conjugate pairs for whichSELECTis true for either eigenvalue count as 2.)WRโWRisREALarray, dimension(N)WIโWIisREALarray, dimension(N).WRandWIcontain the real and imaginary parts, respectively, of the computed eigenvalues in the same order that they appear on the diagonal of the output Schur formT. Complex conjugate pairs of eigenvalues will appear consecutively with the eigenvalue having the positive imaginary part first.VSโVSisREALarray, dimension(LDVS,N). IfJOBVS = 'V',VScontains the orthogonal matrixZof Schur vectors. IfJOBVS = 'N',VSis not referenced.LDVSโLDVSisINTEGER. The leading dimension of the arrayVS.LDVS >= 1; ifJOBVS = 'V',LDVS >= N.WORKโWORKisREALarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)contains the optimalLWORK.LWORKโLWORKisINTEGER. The dimension of the arrayWORK.LWORK >= max(1,3*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.BWORKโBWORKisLOGICALarray, dimension(N). Not referenced ifSORT = 'N'.INFOโINFOisINTEGER= 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:NofWRandWIcontain those eigenvalues which have converged; ifJOBVS = 'V',VScontains the matrix 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 sgeesx
subroutine sgeesx (character JOBVS, character SORT, external SELECT,
character SENSE, integer N, real, dimension( lda, * ) A, integer LDA,
integer SDIM, real, dimension( * ) WR, real, dimension( * ) WI, real,
dimension( ldvs, * ) VS, integer LDVS, real RCONDE, real RCONDV, real,
dimension( * ) WORK, integer LWORK, integer, dimension( * ) IWORK,
integer LIWORK, logical, dimension( * ) BWORK, integer INFO)
SGEESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices โจ
๐ฏ Purpose:
SGEESX computes for an N-by-N real nonsymmetric matrix A, the eigenvalues, the real Schur form T, and, optionally, the matrix of Schur vectors Z. This gives the Schur factorization A = Z*T*(Z**T).
Optionally, it also orders the eigenvalues on the diagonal of the real 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).
A real matrix is in real Schur form if it is upper quasi-triangular with 1-by-1 and 2-by-2 blocks. 2-by-2 blocks will be standardized in the form
[ a b ]
[ c a ]
where b*c < 0. The eigenvalues of such a block are a +- sqrt(bc).
๐ง Parameters
JOBVS
JOBVS ๐
JOBVS is CHARACTER*1
= 'N': Schur vectors are not computed;= 'V': Schur vectors are computed.
SORT โจ
SORT is CHARACTER*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 (see SELECT).
SELECT ๐ฆ
SELECT is a LOGICAL FUNCTION of two REAL arguments
SELECT must be declared EXTERNAL in the calling subroutine.
If SORT = 'S', SELECT is used to select eigenvalues to sort to the top left of the Schur form.
If SORT = 'N', SELECT is not referenced.
An eigenvalue WR(j)+sqrt(-1)*WI(j) is selected if SELECT(WR(j),WI(j)) is true; i.e., if either one of a complex conjugate pair of eigenvalues is selected, then both are. Note that a selected complex eigenvalue may no longer satisfy SELECT(WR(j),WI(j)) = .TRUE. after ordering, since ordering may change the value of complex eigenvalues (especially if the eigenvalue is ill-conditioned); in this case INFO may be set to N+3 (see INFO below).
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 right invariant subspace only;= 'B': Computed for both.
If SENSE = 'E', 'V' or 'B', SORT must equal 'S'.
bestie this is a vibe check on the math itself, not optional flavour ๐ซถ
N ๐ข
N is INTEGER
The order of the matrix A. N >= 0.
A ๐
A is REAL array, dimension (LDA, N)
On entry, the N-by-N matrix A.
On exit, A is overwritten by its real Schur form T.
LDA ๐
LDA is INTEGER
The leading dimension of the array A. LDA >= max(1,N).
SDIM ๐ธ
SDIM is INTEGER
- If
SORT = 'N',SDIM = 0. - If
SORT = 'S',SDIM = number of eigenvalues (after sorting) for which SELECT is true. (Complex conjugate pairs for which SELECT is true for either eigenvalue count as 2.)
WR ๐
WR is REAL array, dimension (N)
WI ๐ง
WI is REAL array, dimension (N)
WR and WI contain the real and imaginary parts, respectively, of the computed eigenvalues, in the same order that they appear on the diagonal of the output Schur form T. Complex conjugate pairs of eigenvalues appear consecutively with the eigenvalue having the positive imaginary part first.
VS ๐
VS is REAL array, dimension (LDVS,N)
- If
JOBVS = 'V',VScontains the orthogonal matrixZof Schur vectors. - If
JOBVS = 'N',VSis not referenced.
LDVS ๐
LDVS is INTEGER
The leading dimension of the array VS. LDVS >= 1, and if JOBVS = 'V', LDVS >= N.
RCONDE ๐
RCONDE is REAL
If SENSE = 'E' or 'B', RCONDE contains the reciprocal condition number for the average of the selected eigenvalues.
Not referenced if SENSE = 'N' or 'V'.
RCONDV โญ
RCONDV is REAL
If SENSE = 'V' or 'B', RCONDV contains the reciprocal condition number for the selected right invariant subspace.
Not referenced if SENSE = 'N' or 'E'.
WORK ๐ฅ
WORK is REAL array, dimension (MAX(1,LWORK))
On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK ๐ ๏ธ
LWORK is INTEGER
The dimension of the array WORK. LWORK >= max(1,3*N).
Also, if SENSE = 'E' or 'V' or 'B', LWORK >= N+2*SDIM*(N-SDIM), where SDIM is the number of selected eigenvalues computed by this routine. Note that N+2*SDIM*(N-SDIM) <= N+N*N/2. Note also that an error is only returned if LWORK < max(1,3*N), but if SENSE = 'E' or 'V' or 'B' this may not be large enough.
For good performance, LWORK must generally be larger.
If LWORK = -1, then a workspace query is assumed; the routine only calculates upper bounds on the optimal sizes of the arrays WORK and IWORK, returns these values as the first entries of the WORK and IWORK arrays, and no error messages related to LWORK or LIWORK are issued by XERBLA.
IWORK ๐งฎ
IWORK is INTEGER array, dimension (MAX(1,LIWORK))
On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
LIWORK ๐งท
LIWORK is INTEGER
The dimension of the array IWORK.
LIWORK >= 1; if SENSE = 'V' or 'B', LIWORK >= SDIM*(N-SDIM). Note that SDIM*(N-SDIM) <= N*N/4. Note also that an error is only returned if LIWORK < 1, but if SENSE = 'V' or 'B' this may not be large enough.
If LIWORK = -1, then a workspace query is assumed; the routine only calculates upper bounds on the optimal sizes of the arrays WORK and IWORK, returns these values as the first entries of the WORK and IWORK arrays, and no error messages related to LWORK or LIWORK are issued by XERBLA.
BWORK ๐ซถ
BWORK is LOGICAL array, dimension (N)
Not referenced if SORT = 'N'.
INFO ๐
INFO is INTEGER
= 0: successful exit< 0: if INFO = -i, the i-th argument had an illegal value.> 0: if INFO = i, and i is<= N: the QR algorithm failed to compute all the eigenvalues; elements 1:ILO-1 and i+1:N of WR and WI contain those eigenvalues which have converged; if JOBVS = 'V', VS contains the transformation 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 satisfy SELECT=.TRUE. This could also be caused by underflow due to scaling.
heads up bestie: thoseN+1andN+2cases are the code politely telling you your problem is ill-conditioned, it's not a you-bug, it's a math-is-crying situation ๐ญ
Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ subroutine sgeev ๐
subroutine sgeev (character JOBVL, character JOBVR, 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, real, dimension( * ) WORK,
integer LWORK, integer INFO)
SGEEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices
Purpose
SGEEV computes for an N-by-N real nonsymmetric matrix A, the eigenvalues and, optionally, the left and/or right eigenvectors.
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.
Parameters
JOBVL ๐
JOBVL is CHARACTER*1
= 'N': left eigenvectors of A are not computed;= 'V': left eigenvectors of A are computed.
JOBVR โจ
JOBVR is CHARACTER*1
= 'N': right eigenvectors of A are not computed;= 'V': right eigenvectors of A are computed.
N ๐ข
N is INTEGER
The order of the matrix A. N >= 0.
A ๐
A is REAL array, dimension (LDA,N)
On entry, the N-by-N matrix A.
On exit, A has been overwritten.
LDA ๐
LDA is INTEGER
The leading dimension of the array A. LDA >= max(1,N).
WR ๐
WR is REAL array, dimension (N)
WI ๐ง
WI is REAL array, dimension (N)
WR and WI contain the real and imaginary parts, respectively, of the computed eigenvalues. Complex conjugate pairs of eigenvalues appear consecutively with the eigenvalue having the positive imaginary part first.
VL ๐ฆ
VL is REAL 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.
If the j-th eigenvalue is real, then u(j) = VL(:,j), the j-th column of VL.
If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then u(j) = VL(:,j) + i*VL(:,j+1) and u(j+1) = VL(:,j) - i*VL(:,j+1).
LDVL ๐
LDVL is INTEGER
The leading dimension of the array VL. LDVL >= 1; if JOBVL = 'V', LDVL >= N.
VR ๐ธ
VR is REAL 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.
If the j-th eigenvalue is real, then v(j) = VR(:,j), the j-th column of VR.
If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then v(j) = VR(:,j) + i*VR(:,j+1) and v(j+1) = VR(:,j) - i*VR(:,j+1).
LDVR ๐
LDVR is INTEGER
The leading dimension of the array VR. LDVR >= 1; if JOBVR = 'V', LDVR >= N.
WORK ๐ฅ
WORKโ okay soWORKis aREAL array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. Periodt. ๐LWORKโLWORKisINTEGER. It's literally the dimension of the arrayWORK. SoLWORK >= max(1,3*N), and ifJOBVL = 'V'orJOBVR = 'V', thenLWORK >= 4*N. And bestie, for good performance,LWORKmust generally be larger. 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.
INFOโINFOisINTEGER. It's giving status report:= 0: successful exit. We love to see it. โจ< 0: ifINFO = -i, the i-th argument had an illegal value. Oops. ๐> 0: ifINFO = i, the QR algorithm failed to compute all the eigenvalues, and no eigenvectors have been computed; elementsi+1:NofWRandWIcontain eigenvalues which have converged. It's a whole thing. ๐ญ
๐ Author ๐
The icons behind LAPACK:
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ฆ subroutine sgeevx ๐ฆ
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 ๐
SGEEVX computes for an N-by-N real 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.
๐ธ Parameters ๐ธ
BALANCโBALANCisCHARACTER*1. It indicates how the input matrix should be diagonally scaled and/or permuted to improve the conditioning of its eigenvalues. Your options are:= '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. replace A byD*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.
JOBVLโJOBVLisCHARACTER*1= 'N': left eigenvectors of A are not computed;= 'V': left eigenvectors of A are computed.- If
SENSE = 'E'or'B',JOBVLmust= 'V'.
JOBVRโJOBVRisCHARACTER*1= 'N': right eigenvectors of A are not computed;= 'V': right eigenvectors of A are computed.- If
SENSE = 'E'or'B',JOBVRmust= 'V'.
SENSEโSENSEisCHARACTER*1. It 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โNisINTEGER. The order of the matrix A.N >= 0.AโAisREAL array, dimension (LDA,N). On entry, the N-by-N matrix A. On exit, A has been overwritten. IfJOBVL = 'V'orJOBVR = 'V', A contains the real Schur form of the balanced version of the input matrix A.LDAโLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,N).WRโWRisREAL array, dimension (N).WIโWIisREAL 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โVLisREAL array, dimension (LDVL,N). IfJOBVL = 'V', the left eigenvectors u(j) are stored one after another in the columns of VL, in the same order as their eigenvalues. IfJOBVL = 'N', VL is not referenced. If the j-th eigenvalue is real, thenu(j) = VL(:,j), the j-th column of VL. 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).LDVLโLDVLisINTEGER. The leading dimension of the array VL.LDVL >= 1; ifJOBVL = 'V',LDVL >= N.VRโVRisREAL array, dimension (LDVR,N). IfJOBVR = 'V', the right eigenvectors v(j) are stored one after another in the columns of VR, in the same order as their eigenvalues. IfJOBVR = 'N', VR is not referenced. If the j-th eigenvalue is real, thenv(j) = VR(:,j), the j-th column of VR. 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).LDVRโLDVRisINTEGER. The leading dimension of the array VR.LDVR >= 1, and ifJOBVR = 'V',LDVR >= N.ILOโILOisINTEGER.IHIโIHIisINTEGER.ILOandIHIare integer values determined when A was balanced. The balancedA(i,j) = 0ifI > JandJ = 1,...,ILO-1orI = IHI+1,...,N.SCALEโSCALEisREAL array, dimension (N). Details of the permutations and scaling factors applied when balancing A. IfP(j)is the index of the row and column interchanged with row and column j, andD(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.
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โWORKisREAL array, dimension (MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK.LWORKโLWORKisINTEGER. 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.
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.
IWORKโIWORKisINTEGER array, dimension (2*N-2). IfSENSE = 'N'or'E', not referenced.INFOโINFOisINTEGER= 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.
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ซถ the sgges era ๐ซถ
subroutine sgges (character JOBVSL, character JOBVSR, character SORT,
external SELCTG, integer N, real, dimension( lda, * ) A, integer LDA,
real, dimension( ldb, * ) B, integer LDB, integer SDIM, real, dimension(
* ) ALPHAR, real, dimension( * ) ALPHAI, real, dimension( * ) BETA,
real, dimension( ldvsl, * ) VSL, integer LDVSL, real, dimension( ldvsr,
* ) VSR, integer LDVSR, real, dimension( * ) WORK, integer LWORK,
logical, dimension( * ) BWORK, integer INFO)
okay so bestie, SGGES computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices ๐
Purpose โจ
SGGES computes, for a pair of N-by-N real nonsymmetric matrices (A,B), the generalized eigenvalues, the generalized real 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)**T, (VSL)*T*(VSR)**T )
Optionally, it also orders the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper quasi-triangular matrix S and the upper triangular matrix T. The leading columns of VSL and VSR then form an orthonormal basis for the corresponding left and right eigenspaces (deflating subspaces). ๐ฆ
(If only the generalized eigenvalues are needed, use the driver SGGEV instead, which is faster.) โ yes bestie, that's the shortcut, iykyk.
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 both being zero. ๐
A pair of matrices (S,T) is in generalized real Schur form if T is upper triangular with non-negative diagonal and S is block upper triangular with 1-by-1 and 2-by-2 blocks. The 1-by-1 blocks correspond to real generalized eigenvalues, while 2-by-2 blocks of S will be 'standardized' by making the corresponding elements of T have the form:
[ a 0 ]
[ 0 b ]
and the pair of corresponding 2-by-2 blocks in S and T will have a complex conjugate pair of generalized eigenvalues. iconic behaviour fr fr ๐ธ
Parameters ๐
JOBVSLโJOBVSLisCHARACTER*1.= 'N': do not compute the left Schur vectors;= 'V': compute the left Schur vectors.
JOBVSRโJOBVSRisCHARACTER*1.= 'N': do not compute the right Schur vectors;= 'V': compute the right Schur vectors.
SORTโSORTisCHARACTER*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โSELCTGis aLOGICAL FUNCTIONof threeREALarguments.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 eigenvalue(ALPHAR(j)+ALPHAI(j))/BETA(j)is selected ifSELCTG(ALPHAR(j),ALPHAI(j),BETA(j))is true; i.e. if either one of a complex conjugate pair of eigenvalues is selected, then both complex eigenvalues are selected.
Note that in the ill-conditioned case, a selected complex eigenvalue may no longer satisfy SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) = .TRUE. after ordering. INFO is to be set to N+2 in this case. ๐
NโNisINTEGER. The order of the matricesA,B,VSL, andVSR.N >= 0.AโAisREALarray, dimension(LDA, N). On entry, the first of the pair of matrices. On exit,Ahas been overwritten by its generalized Schur formS. โจLDAโLDAisINTEGER. The leading dimension ofA.LDA >= max(1,N).BโBisREALarray, dimension(LDB, N). On entry, the second of the pair of matrices. On exit,Bhas been overwritten by its generalized Schur formT. ๐ฆLDBโLDBisINTEGER. The leading dimension ofB.LDB >= max(1,N).SDIMโSDIMisINTEGER. IfSORT = 'N',SDIM = 0. IfSORT = 'S',SDIM =number of eigenvalues (after sorting) for whichSELCTGis true. (Complex conjugate pairs for whichSELCTGis true for either eigenvalue count as2.) ๐ALPHARโALPHARisREALarray, dimension(N).ALPHAIโALPHAIisREALarray, dimension(N).BETAโBETAisREALarray, dimension(N). On exit,(ALPHAR(j) + ALPHAI(j)*i)/BETA(j),j=1,...,N, will be the generalized eigenvalues.ALPHAR(j) + ALPHAI(j)*i, andBETA(j),j=1,...,Nare the diagonals of the complex Schur form(S,T)that would result if the 2-by-2 diagonal blocks of the real Schur form of(A,B)were further reduced to triangular form using 2-by-2 complex unitary transformations. IfALPHAI(j)is zero, then thej-th eigenvalue is real; if positive, then thej-th and(j+1)-st eigenvalues are a complex conjugate pair, withALPHAI(j+1)negative. ๐
Note: the quotients ALPHAR(j)/BETA(j) and ALPHAI(j)/BETA(j) may easily over- or underflow, and BETA(j) may even be zero. Thus, the user should avoid naively computing the ratio. no cap, don't do the naive thing bestie ๐ญ However, ALPHAR and ALPHAI will be always less than and usually comparable with norm(A) in magnitude, and BETA always less than and usually comparable with norm(B). ๐ซถ
VSLโVSLisREALarray, dimension(LDVSL,N). IfJOBVSL = 'V',VSLwill contain the left Schur vectors. Not referenced ifJOBVSL = 'N'.LDVSLโLDVSLisINTEGER. The leading dimension of the matrixVSL.LDVSL >=1, and ifJOBVSL = 'V',LDVSL >= N.VSRโVSRisREALarray, dimension(LDVSR,N). IfJOBVSR = 'V',VSRwill contain the right Schur vectors. Not referenced ifJOBVSR = 'N'.LDVSRโLDVSRisINTEGER. The leading dimension of the matrixVSR.LDVSR >= 1, and ifJOBVSR = 'V',LDVSR >= N.WORKโWORKisREALarray, dimension(MAX(1,LWORK)). On exit, ifINFO = 0,WORK(1)returns the optimalLWORK. โญLWORKโLWORKisINTEGER. The dimension of the arrayWORK. IfN = 0,LWORK >= 1, elseLWORK >= max(8*N,6*N+16). 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. ๐ง (sneaky little peek, love that for us)
BWORKโBWORKisLOGICALarray, dimension(N). Not referenced ifSORT = 'N'.INFOโINFOisINTEGER.= 0: successful exit ๐< 0: ifINFO = -i, thei-th argument had an illegal value.= 1,...,N: The QZ iteration failed.(A,B)are not in Schur form, butALPHAR(j),ALPHAI(j), andBETA(j)should be correct forj=INFO+1,...,N. ๐> N:=N+1: other than QZ iteration failed inSHGEQZ.=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 inSTGSEN.
Author ๐
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
๐ and nowโฆ the sgges3 era ๐
subroutine sgges3 (character JOBVSL, character JOBVSR, character SORT,
external SELCTG, integer N, real, dimension( lda, * ) A, integer LDA,
real, dimension( ldb, * ) B, integer LDB, integer SDIM, real, dimension(
* ) ALPHAR, real, dimension( * ) ALPHAI, real, dimension( * ) BETA,
real, dimension( ldvsl, * ) VSL, integer LDVSL, real, dimension( ldvsr,
* ) VSR, integer LDVSR, real, dimension( * ) WORK, integer LWORK,
logical, dimension( * ) BWORK, integer INFO)
SGGES3 computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices (blocked algorithm) โ yes, that's the glow-up, the blocked version, main character energy only ๐ฅ
Purpose โจ
SGGES3 computes, for a pair of N-by-N real nonsymmetric matrices (A,B), the generalized eigenvalues, the generalized real 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)**T, (VSL)*T*(VSR)**T )
Optionally, it also orders the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper quasi-triangular matrix S and the upper triangular matrix T. The leading columns of VSL and VSR then form an orthonormal basis for the corresponding left and right eigenspaces (deflating subspaces). ๐ฆ
(If only the generalized eigenvalues are needed, use the driver SGGEV 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 or both being zero. ๐
A pair of matrices (S,T) is in generalized real Schur form if T is upper triangular with non-negative diagonal and S is block upper triangular with 1-by-1 and 2-by-2 blocks. The 1-by-1 blocks correspond to real generalized eigenvalues, while 2-by-2 blocks of S will be 'standardized' by making the corresponding elements of T have the form:
[ a 0 ]
[ 0 b ]
and the pair of corresponding 2-by-2 blocks in S and T will have a complex conjugate pair of generalized eigenvalues. ๐ธ
Parameters ๐
JOBVSLโ
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 three REAL arguments
SELCTG must be declared EXTERNAL in the calling subroutine. Like, don't forget that part bestie, the compiler will absolutely side-eye you.
- If
SORT = 'N',SELCTGis not referenced. - If
SORT = 'S',SELCTGis used to select eigenvalues to sort to the top left of the Schur form.
An eigenvalue (ALPHAR(j)+ALPHAI(j))/BETA(j) is selected if SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) is true; i.e. if either one of a complex conjugate pair of eigenvalues is selected, then both complex eigenvalues are selected.
โ ๏ธ Note that in the ill-conditioned case, a selected complex eigenvalue may no longer satisfySELCTG(ALPHAR(j),ALPHAI(j), BETA(j)) = .TRUE.after ordering.INFOis to be set toN+2in this case.
N โ N is INTEGER
The order of the matrices A, B, VSL, and VSR. N >= 0.
A โ A is REAL 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's a changed matrix, your honor.
LDA โ LDA is INTEGER
The leading dimension of A. LDA >= max(1,N).
B โ B is REAL 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 which SELCTG is true.(Complex conjugate pairs for whichSELCTGis true for either eigenvalue count as2.)
ALPHAR โ ALPHAR is REAL array, dimension (N)
ALPHAI โ ALPHAI is REAL array, dimension (N)
BETA โ BETA is REAL array, dimension (N)
On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will be the generalized eigenvalues. ALPHAR(j) + ALPHAI(j)*i, and BETA(j), j=1,...,N are the diagonals of the complex Schur form (S,T) that would result if the 2-by-2 diagonal blocks of the real Schur form of (A,B) were further reduced to triangular form using 2-by-2 complex unitary transformations.
If ALPHAI(j) is zero, then the j-th eigenvalue is real; if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with ALPHAI(j+1) negative. cute little pair, matching energy fr
โ ๏ธ Note: the quotientsALPHAR(j)/BETA(j)andALPHAI(j)/BETA(j)may easily over- or underflow, andBETA(j)may even be zero. Thus, the user should avoid naively computing the ratio. However,ALPHARandALPHAIwill be always less than and usually comparable withnorm(A)in magnitude, andBETAalways less than and usually comparable withnorm(B).
VSL โ VSL is REAL 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 REAL 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.
WORK โ WORK is REAL array, dimension (MAX(1,LWORK))
On exit, if INFO = 0, WORK(1) returns the optimal LWORK. she's telling you what she needs, listen to her
LWORK โ LWORK is INTEGER
The dimension of the array WORK.
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.
BWORK โ BWORK is LOGICAL array, dimension (N)
Not referenced if SORT = '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.(A,B)are not in Schur form, butALPHAR(j),ALPHAI(j), andBETA(j)should be correct forj=INFO+1,...,N.> N:=N+1: other than QZ iteration failed inSLAQZ0.=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 inSTGSEN.
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
โจ subroutine sggesx โจ
subroutine sggesx (character JOBVSL, character JOBVSR, character SORT,
external SELCTG, character SENSE, integer N, real, dimension( lda, * )
A, integer LDA, real, dimension( ldb, * ) B, integer LDB, integer SDIM,
real, dimension( * ) ALPHAR, real, dimension( * ) ALPHAI, real,
dimension( * ) BETA, real, dimension( ldvsl, * ) VSL, integer LDVSL,
real, dimension( ldvsr, * ) VSR, integer LDVSR, real, dimension( 2 )
RCONDE, real, dimension( 2 ) RCONDV, real, dimension( * ) WORK, integer
LWORK, integer, dimension( * ) IWORK, integer LIWORK, logical,
dimension( * ) BWORK, integer INFO)
SGGESX computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE matrices ๐
Purpose
SGGESX computes for a pair of N-by-N real nonsymmetric matrices (A,B), the generalized eigenvalues, the real 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)**T, (VSL) T (VSR)**T )
Optionally, it also orders the eigenvalues so that a selected cluster of eigenvalues appears in the leading diagonal blocks of the upper quasi-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). she does the whole package, no half measures โจ
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 real Schur form if T is upper triangular with non-negative diagonal and S is block upper triangular with 1-by-1 and 2-by-2 blocks. 1-by-1 blocks correspond to real generalized eigenvalues, while 2-by-2 blocks of S will be 'standardized' by making the corresponding elements of T have the form:
[ a 0 ]
[ 0 b ]
and the pair of corresponding 2-by-2 blocks in S and T will have a complex conjugate pair of generalized eigenvalues.
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 three REAL arguments
SELCTG must be declared EXTERNAL in the calling subroutine.
- If
SORT = 'N',SELCTGis not referenced. - If
SORT = 'S',SELCTGis used to select eigenvalues to sort to the top left of the Schur form.
An eigenvalue (ALPHAR(j)+ALPHAI(j))/BETA(j) is selected if SELCTG(ALPHAR(j),ALPHAI(j),BETA(j)) is true; i.e. if either one of a complex conjugate pair of eigenvalues is selected, then both complex eigenvalues are selected.
โ ๏ธ Note that a selected complex eigenvalue may no longer satisfySELCTG(ALPHAR(j),ALPHAI(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+3.
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'. no sneaky mismatch, she WILL notice
N โ N is INTEGER
The order of the matrices A, B, VSL, and VSR. N >= 0.
A
A
A is a REAL array, dimension (LDA, N).
On entry: the first of the pair of matrices, bestie. ๐
On exit: A has been overwritten by its generalized Schur form S. it said "new me" and meant it ๐
LDA
LDA is INTEGER. it's the leading dimension of A, and LDA >= max(1,N). no negotiating, fr fr.
B
B is a REAL 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. slay, but like, it's gone now ๐ธ
LDB
LDB is INTEGER. the leading dimension of B, and LDB >= max(1,N). periodt.
SDIM
SDIM is INTEGER.
- If
SORT = 'N', thenSDIM = 0. nothing to see here ๐ - If
SORT = 'S', thenSDIM= the number of eigenvalues (after sorting) for whichSELCTGis true. and heads up: complex conjugate pairs whereSELCTGis true for either eigenvalue count as 2. yes, two. both of them. ๐
ALPHAR
ALPHAR is a REAL array, dimension (N). โจ
ALPHAI
ALPHAI is a REAL array, dimension (N). โจ
BETA
BETA is a REAL array, dimension (N).
On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), for j=1,...,N, will be the generalized eigenvalues. ALPHAR(j) + ALPHAI(j)*i and BETA(j), j=1,...,N, are the diagonals of the complex Schur form (S,T) that would result if the 2-by-2 diagonal blocks of the real Schur form of (A,B) were further reduced to triangular form using 2-by-2 complex unitary transformations. big math energy, i know ๐ง
If ALPHAI(j) is zero, then the j-th eigenvalue is real; if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with ALPHAI(j+1) negative.
Note bestie, this one's important: the quotientsALPHAR(j)/BETA(j)andALPHAI(j)/BETA(j)may easily over- or underflow, andBETA(j)may even be zero. so likeโฆ please don't naively compute the ratio, it's giving chaos ๐ However!ALPHARandALPHAIwill always be less than โ and usually comparable with โnorm(A)in magnitude, andBETAalways less than and usually comparable withnorm(B). so the vibes are safe, the ratio is not.
VSL
VSL is a REAL array, dimension (LDVSL,N).
If JOBVSL = 'V', VSL will contain the left Schur vectors. Not referenced if JOBVSL = 'N'. it's shy like that ๐
LDVSL
LDVSL is INTEGER. the leading dimension of the matrix VSL. LDVSL >= 1, and if JOBVSL = 'V', then LDVSL >= N. ๐
VSR
VSR is a REAL 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', then LDVSR >= N. ๐
RCONDE
RCONDE is a REAL array, dimension ( 2 ).
If SENSE = 'E' or 'B', then RCONDE(1) and RCONDE(2) contain the reciprocal condition numbers for the average of the selected eigenvalues. Not referenced if SENSE = 'N' or 'V'. if you're not sensing, it's not speaking โจ
RCONDV
RCONDV is a REAL array, dimension ( 2 ).
If SENSE = 'V' or 'B', then RCONDV(1) and RCONDV(2) contain the reciprocal condition numbers for the selected deflating subspaces. Not referenced if SENSE = 'N' or 'E'.
WORK
WORK is a REAL array, dimension (MAX(1,LWORK)).
On exit, if INFO = 0, then WORK(1) returns the optimal LWORK. little self-referential moment, we love a callback ๐
LWORK
LWORK is INTEGER โ the dimension of the array WORK.
If N = 0, then LWORK >= 1. Otherwise, if SENSE = 'E', 'V', or 'B', then LWORK >= max( 8*N, 6*N+16, 2*SDIM*(N-SDIM) ). Otherwise, LWORK >= max( 8*N, 6*N+16 ).
Note that 2*SDIM*(N-SDIM) <= N*N/2.
Note also that an error is only returned if LWORK < max( 8*N, 6*N+16), but if SENSE = 'E' or 'V' or 'B' then this may not be large enough. so like, read the whole sentence bestie ๐ญ
If LWORK = -1, then a workspace query is assumed; the routine only calculates the bound on the optimal size of the WORK array and the minimum size of the IWORK array, returns these values as the first entries of the WORK and IWORK arrays, and no error message related to LWORK or LIWORK is issued by XERBLA. it's just vibing, not judging ๐ฆ
IWORK
IWORK is INTEGER array, dimension (MAX(1,LIWORK)).
On exit, if INFO = 0, then IWORK(1) returns the minimum LIWORK.
LIWORK
LIWORK is INTEGER โ the dimension of the array IWORK.
If SENSE = 'N' or N = 0, then LIWORK >= 1; otherwise LIWORK >= N+6.
If LIWORK = -1, then a workspace query is assumed; the routine only calculates the bound on the optimal size of the WORK array and the minimum size of the IWORK array, returns these values as the first entries of the WORK and IWORK arrays, and no error message related to LWORK or LIWORK is issued by XERBLA. same energy, different variable ๐
BWORK
BWORK is a LOGICAL array, dimension (N). Not referenced if SORT = 'N'. it's not ignoring you, it's justโฆ not sorting ๐
INFO
INFO is INTEGER. the moment of truth:
= 0: successful exit. we ate and left no crumbs ๐< 0: ifINFO = -i, then the i-th argument had an illegal value. bestie, check your inputs ๐ญ= 1,...,N: the QZ iteration failed.(A,B)are not in Schur form, butALPHAR(j),ALPHAI(j), andBETA(j)should be correct forj=INFO+1,...,N. so partially iconic, partially not ๐> N:=N+1: other than QZ iteration failed inSHGEQZ=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 inSTGSEN. it tried its best ๐ซถ
Author โจ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the whole squad showed up, no cap ๐ซถ
Further Details ๐
An approximate (asymptotic) bound on the average absolute error of the selected eigenvalues is:
EPS * norm((A, B)) / RCONDE( 1 ).
An approximate (asymptotic) bound on the maximum angular error in the computed deflating subspaces is:
EPS * norm((A, B)) / RCONDV( 2 ).
See the LAPACK User's Guide, section 4.11 for more information. iykyk ๐
subroutine sggev
subroutine sggev (character JOBVL, character JOBVR, integer N, real,
dimension( lda, * ) A, integer LDA, real, dimension( ldb, * ) B, integer
LDB, real, dimension( * ) ALPHAR, real, dimension( * ) ALPHAI, real,
dimension( * ) BETA, real, dimension( ldvl, * ) VL, integer LDVL, real,
dimension( ldvr, * ) VR, integer LDVR, real, dimension( * ) WORK,
integer LWORK, integer INFO)
SGGEV computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices ๐ธ
Purpose:
SGGEV computes, for a pair of N-by-N real 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's usually represented as the pair (alpha,beta), since there's a reasonable interpretation for beta=0, and even for both being zero. yes, both zero. no thoughts, just vibes ๐
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). star girl behavior โจ
Parameters
JOBVL
JOBVL is CHARACTER*1.
= 'N': do not compute the left generalized eigenvectors;= 'V': compute the left generalized eigenvectors.
pick your fighter ๐
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 matrices A, B, VL, and VR. N >= 0. ๐
A
A is a REAL array, dimension (LDA, N).
On entry: the matrix A in the pair (A,B).
On exit: A has been overwritten. gone. transformed. main character arc ๐ฆ
LDA
LDA is INTEGER. the leading dimension of A. LDA >= max(1,N).
B
B is a REAL array, dimension (LDB, N).
On entry: the matrix B in the pair (A,B).
On exit: B has been overwritten. it too has changed ๐
LDB
LDB is INTEGER. the leading dimension of B. LDB >= max(1,N).
ALPHAR
ALPHAR is a REAL array, dimension (N). โจ
ALPHAI
ALPHAI is a REAL array, dimension (N). โจ
BETA
BETA is a REAL array, dimension (N).
On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), for j=1,...,N, will be the generalized eigenvalues. If ALPHAI(j) is zero, then the j-th eigenvalue is real; if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with ALPHAI(j+1) negative.
Note, again, because it matters: the quotientsALPHAR(j)/BETA(j)andALPHAI(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,ALPHARandALPHAIwill always be less than โ and usually comparable with โnorm(A)in magnitude, andBETAalways less than and usually comparable withnorm(B). same warning, same truth, no cap ๐ญ
VL
VL ๐ฆ
VL is a REAL array, dimension (LDVL,N). Okay so if JOBVL = 'V', the left eigenvectors u(j) get stacked one after another in the columns of VL, in the exact same order as their eigenvalues, no cap. If the j-th eigenvalue is real, then u(j) = VL(:,j), literally just the j-th column of VL. But if the j-th and (j+1)-th eigenvalues form a complex conjugate pair, then u(j) = VL(:,j)+i*VL(:,j+1) and u(j+1) = VL(:,j)-i*VL(:,j+1). Each eigenvector is scaled so the largest component has abs(real part)+abs(imag. part)=1. Not referenced if JOBVL = 'N'.
LDVL โจ
LDVL is INTEGER โ it's the leading dimension of the matrix VL. So LDVL >= 1, and if JOBVL = 'V', then LDVL >= N. Periodt.
VR ๐ธ
VR is a REAL 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, bestie. If the j-th eigenvalue is real, then v(j) = VR(:,j), the j-th column of VR. If the j-th and (j+1)-th eigenvalues form a complex conjugate pair, then v(j) = VR(:,j)+i*VR(:,j+1) and v(j+1) = VR(:,j)-i*VR(:,j+1). Each eigenvector is scaled so the largest component has abs(real part)+abs(imag. part)=1. Not referenced if JOBVR = 'N'.
LDVR ๐
LDVR is INTEGER โ the leading dimension of the matrix VR. LDVR >= 1, and if JOBVR = 'V', then LDVR >= N. Slay.
WORK ๐ง
WORK is a REAL array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, then WORK(1) returns the optimal LWORK. She tells you what she needed, iconic behaviour tbh.
LWORK ๐
LWORK is INTEGER โ the dimension of the array WORK. So LWORK >= max(1,8*N). And for good performance? LWORK must generally be larger. Like, bigger. Trust. ๐
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.
INFO ๐ฅ
INFO is INTEGER:
= 0: successful exit ๐< 0: ifINFO = -i, the i-th argument had an illegal value. Rude.= 1,...,N: The QZ iteration failed. No eigenvectors have been calculated, butALPHAR(j),ALPHAI(j), andBETA(j)should be correct forj=INFO+1,...,N.> N:=N+1: other than QZ iteration failed inSHGEQZ.=N+2: error return fromSTGEVC.
๐ Author ๐
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐
subroutine sggev3 ๐
subroutine sggev3 (character JOBVL, character JOBVR, integer N, real,
dimension( lda, * ) A, integer LDA, real, dimension( ldb, * ) B, integer
LDB, real, dimension( * ) ALPHAR, real, dimension( * ) ALPHAI, real,
dimension( * ) BETA, real, dimension( ldvl, * ) VL, integer LDVL, real,
dimension( ldvr, * ) VR, integer LDVR, real, dimension( * ) WORK,
integer LWORK, integer INFO)
SGGEV3 computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices (blocked algorithm). Blocked algorithm era. โจ
Purpose:
SGGEV3 computes for a pair of N-by-N real 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. Bestie, both being zero is a whole mood and she said "valid".
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). Transpose but make it fancy ๐
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 matrices A, B, VL, and VR. N >= 0.
A
A is REAL array, dimension (LDA, N). On entry, the matrix A in the pair (A,B). On exit, A has been overwritten. She does NOT survive. RIP bozo ๐ชฆ
LDA
LDA is INTEGER โ the leading dimension of A. LDA >= max(1,N).
B
B is REAL array, dimension (LDB, N). On entry, the matrix B in the pair (A,B). On exit, B has been overwritten. Same fate, bestie. Gone. ๐
LDB
LDB is INTEGER โ the leading dimension of B. LDB >= max(1,N).
ALPHAR
ALPHAR is REAL array, dimension (N)
ALPHAI
ALPHAI is REAL array, dimension (N)
BETA
BETA is REAL array, dimension (N). On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will be the generalized eigenvalues. If ALPHAI(j) is zero, then the j-th eigenvalue is real; if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with ALPHAI(j+1) negative.
Note: the quotientsALPHAR(j)/BETA(j)andALPHAI(j)/BETA(j)may easily over- or underflow, andBETA(j)may even be zero. So like, do NOT naively compute the ratioalpha/beta, bestie, that's how you get hurt. However,ALPHARandALPHAIwill be always less than and usually comparable withnorm(A)in magnitude, andBETAalways less than and usually comparable withnorm(B).
VL
VL is REAL 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 the j-th eigenvalue is real, then u(j) = VL(:,j), the j-th column of VL. If the j-th and (j+1)-th eigenvalues form a complex conjugate pair, then u(j) = VL(:,j)+i*VL(:,j+1) and u(j+1) = VL(:,j)-i*VL(:,j+1). Each eigenvector is scaled so the largest component has abs(real part)+abs(imag. part)=1. Not referenced if JOBVL = 'N'.
LDVL
LDVL is INTEGER โ the leading dimension of the matrix VL. LDVL >= 1, and if JOBVL = 'V', LDVL >= N.
VR
VR is REAL 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 the j-th eigenvalue is real, then v(j) = VR(:,j), the j-th column of VR. If the j-th and (j+1)-th eigenvalues form a complex conjugate pair, then v(j) = VR(:,j)+i*VR(:,j+1) and v(j+1) = VR(:,j)-i*VR(:,j+1). Each eigenvector is scaled so the largest component has abs(real part)+abs(imag. part)=1. Not referenced if JOBVR = 'N'.
LDVR
LDVR is INTEGER โ the leading dimension of the matrix VR. LDVR >= 1, and if JOBVR = 'V', LDVR >= N.
WORK
WORK is REAL array, dimension (MAX(1,LWORK)). On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
LWORK
LWORK is INTEGER
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.
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, butALPHAR(j),ALPHAI(j), andBETA(j)should be correct forj=INFO+1,...,N.> N:=N+1: other than QZ iteration failed inSLAQZ0.=N+2: error return fromSTGEVC.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
๐ฆ subroutine sggevx ๐ฆ
subroutine sggevx (character BALANC, character JOBVL, character JOBVR,
character SENSE, integer N, real, dimension( lda, * ) A, integer LDA,
real, dimension( ldb, * ) B, integer LDB, real, dimension( * ) ALPHAR,
real, dimension( * ) ALPHAI, real, dimension( * ) BETA, real, dimension(
ldvl, * ) VL, integer LDVL, real, dimension( ldvr, * ) VR, integer LDVR,
integer ILO, integer IHI, real, dimension( * ) LSCALE, real, dimension(
* ) RSCALE, real ABNRM, real BBNRM, real, dimension( * ) RCONDE, real,
dimension( * ) RCONDV, real, dimension( * ) WORK, integer LWORK,
integer, dimension( * ) IWORK, logical, dimension( * ) BWORK, integer
INFO)
SGGEVX computes the eigenvalues and, optionally, the left and/or right eigenvectors for GE matrices. The deluxe edition, fr fr โจ
Purpose:
SGGEVX computes for a pair of N-by-N real nonsymmetric matrices (A,B) the generalized eigenvalues, and optionally, the left and/or right generalized eigenvectors.
Optionally also, it 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). She does it ALL. Main character energy honestly. ๐
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 eigenvector v(j) corresponding to the eigenvalue lambda(j) of (A,B) satisfies
A * v(j) = lambda(j) * B * v(j) .
okay bestie so real quick, before we get into the โจgoodsโจ, here's the vibe: the left eigenvector u(j) that matches up with 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). ๐ซถ
โจ Parameters โจ
BALANC
BALANC is CHARACTER*1 ๐
and it's the one that picks your balance option:
= 'N': do not diagonally scale or permute;= 'P': permute only;= 'S': scale only;= 'B': both permute and scale.
The computed reciprocal condition numbers are gonna be for the matrices after all that permuting and/or balancing, okay? And like โ permuting does not change condition numbers (in exact arithmetic), but balancing does. Not me being dramatic, that's just the math. ๐
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.
SENSE
SENSE is CHARACTER*1 and it decides which reciprocal condition numbers get computed, periodt:
= 'N': none are computed;= 'E': computed for eigenvalues only;= 'V': computed for eigenvectors only;= 'B': computed for eigenvalues and eigenvectors.
N
N is INTEGER โ the order of the matrices A, B, VL, and VR. Requirement: N >= 0. ๐
A
A is REAL array, dimension (LDA, N).
- On entry: the matrix
Ain the pair(A,B). - On exit:
Ahas been overwritten. IfJOBVL='V'orJOBVR='V'or both, thenAcontains the first part of the real Schur form of the 'balanced' versions of the inputAandB.
LDA
LDA is INTEGER โ the leading dimension of A. Requirement: LDA >= max(1,N). ๐
B
B is REAL array, dimension (LDB, N).
- On entry: the matrix
Bin the pair(A,B). - On exit:
Bhas been overwritten. IfJOBVL='V'orJOBVR='V'or both, thenBcontains the second part of the real Schur form of the 'balanced' versions of the inputAandB.
LDB
LDB is INTEGER โ the leading dimension of B. Requirement: LDB >= max(1,N). ๐
ALPHAR
ALPHAR is REAL array, dimension (N)
ALPHAI
ALPHAI is REAL array, dimension (N)
BETA
BETA is REAL array, dimension (N)
On exit, (ALPHAR(j) + ALPHAI(j)*i)/BETA(j), j=1,...,N, will be the generalized eigenvalues. ๐ฅ If ALPHAI(j) is zero, then the j-th eigenvalue is real; if positive, then the j-th and (j+1)-st eigenvalues are a complex conjugate pair, with ALPHAI(j+1) negative.
ngl bestie listen up: the quotientsALPHAR(j)/BETA(j)andALPHAI(j)/BETA(j)may easily over- or underflow, andBETA(j)may even be zero. So pls, do not naively compute the ratioALPHA/BETA. ๐ However,ALPHARandALPHAIwill be always less than and usually comparable withnorm(A)in magnitude, andBETAalways less than and usually comparable withnorm(B). So like. it's fine, just don't be weird about it. ๐
VL
VL is REAL 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 the j-th eigenvalue is real, then u(j) = VL(:,j), the j-th column of VL. If the j-th and (j+1)-th eigenvalues form a complex conjugate pair, then u(j) = VL(:,j)+i*VL(:,j+1) and u(j+1) = VL(:,j)-i*VL(:,j+1). โจ
Each eigenvector will be scaled so the largest component has abs(real part) + abs(imag. part) = 1.
Not referenced if JOBVL = 'N'.
LDVL
LDVL is INTEGER โ the leading dimension of the matrix VL. LDVL >= 1, and if JOBVL = 'V', LDVL >= N. ๐ฆ
VR
VR is REAL 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 the j-th eigenvalue is real, then v(j) = VR(:,j), the j-th column of VR. If the j-th and (j+1)-th eigenvalues form a complex conjugate pair, then v(j) = VR(:,j)+i*VR(:,j+1) and v(j+1) = VR(:,j)-i*VR(:,j+1). โจ
Each eigenvector will be scaled so the largest component has abs(real part) + abs(imag. part) = 1.
Not referenced if JOBVR = 'N'.
LDVR
LDVR is INTEGER โ the leading dimension of the matrix VR. LDVR >= 1, and if JOBVR = 'V', LDVR >= N. ๐ฆ
ILO
ILO is INTEGER
IHI
IHI is INTEGER
ILO and IHI are integer values such that on exit A(i,j) = 0 and B(i,j) = 0 if i > j and j = 1,...,ILO-1 or i = IHI+1,...,N.
If BALANC = 'N' or 'S', ILO = 1 and IHI = N.
LSCALE
LSCALE is REAL array, dimension (N).
Details of the permutations and scaling factors applied to the left side of A and B. ๐ธ If PL(j) is the index of the row interchanged with row j, and DL(j) is the scaling factor applied to row j, 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
RSCALE is REAL array, dimension (N).
Details of the permutations and scaling factors applied to the right side of A and B. ๐ธ If PR(j) is the index of the column interchanged with column j, and DR(j) is the scaling factor applied to column j, 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
ABNRM is REAL โ the one-norm of the balanced matrix A. โญ
BBNRM
BBNRM is REAL โ the one-norm of the balanced matrix B. โญ
RCONDE
RCONDE is REAL array, dimension (N).
If SENSE = 'E' or 'B', the reciprocal condition numbers of the eigenvalues, stored in consecutive elements of the array. For a complex conjugate pair of eigenvalues two consecutive elements of RCONDE are set to the same value. So like, RCONDE(j), RCONDV(j), and the j-th columns of VL and VR all correspond to the j-th eigenpair. ๐
If SENSE = 'N' or 'V', RCONDE is not referenced.
RCONDV
RCONDV is REAL array, dimension (N).
If SENSE = 'V' or 'B', the estimated reciprocal condition numbers of the eigenvectors, stored in consecutive elements of the array. For a complex eigenvector two consecutive elements of RCONDV are set to the same value. If the eigenvalues cannot be reordered to compute RCONDV(j), RCONDV(j) is set to 0; this can only occur when the true value would be very small anyway. ๐
If SENSE = 'N' or 'E', RCONDV is not referenced.
WORK
WORK is REAL array, dimension (MAX(1,LWORK)).
On exit, if INFO = 0, WORK(1) returns the optimal LWORK. ๐
LWORK
LWORK is INTEGER โ the dimension of the array WORK.
LWORK >= max(1,2*N).- If
BALANC = 'S'or'B', orJOBVL = 'V', orJOBVR = 'V',LWORK >= max(1,6*N). - If
SENSE = 'E',LWORK >= max(1,10*N). - If
SENSE = 'V'or'B',LWORK >= 2*N*N+8*N+16.
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 shortcut, we love her ๐
IWORK
IWORK is INTEGER array, dimension (N+6).
If SENSE = 'E', IWORK is not referenced.
BWORK
BWORK is LOGICAL array, dimension (N).
If SENSE = 'N', BWORK is not referenced.
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, butALPHAR(j),ALPHAI(j), andBETA(j)should be correct forj=INFO+1,...,N. ๐ญ> N:=N+1: other than QZ iteration failed inSHGEQZ.=N+2: error return fromSTGEVC.
โจ Author โจ
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
the whole squad, iconic, no notes ๐ซถ
โจ 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 โจ
Okay bestie, real talk โ this page wasn't lovingly hand-typed by some wise Unix elder sipping tea ๐ต. It was generated automatically by Doxygen for LAPACK from the source code. So like, the source code is the main character here ๐, and Doxygen is just the lil scribe that showed up, took notes, and formatted everything pretty ๐ . Respect the pipeline, fr fr.
And that's a wrap on realGEeigen(3)! ๐ You made it all the way to the end, and honestly? Iconic behavior. ๐
This lil masterpiece is LAPACK Version 3.11.0, dated Sun Nov 27 2022 ๐ โ so if you're reading this way later, hi, hello, hope your linear algebra is thriving ๐ฆ.
Go forth and compute, bestie. Your eigenvalues are lowkey shook. ๐ ๐ซถ
๐ฆ 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