tgex2(3)
π tgex2 β Library Functions Manual π
okay so bestie, welcome to tgex2 β the page that's all about reordering the generalized Schur form. it's giving "linear algebra but make it a glow-up" β¨
π NAME π
tgex2 β reorder generalized Schur form
πΈ SYNOPSIS πΈ
π« Functions π«
subroutine ctgex2 (wantq, wantz, n, a, lda, b, ldb, q, ldq, z, ldz, j1,
info)
CTGEX2 swaps adjacent diagonal blocks in an upper (quasi) triangular matrix pair by an unitary equivalence transformation.
subroutine dtgex2 (wantq, wantz, n, a, lda, b, ldb, q, ldq, z, ldz, j1,
n1, n2, work, lwork, info)
DTGEX2 swaps adjacent diagonal blocks in an upper (quasi) triangular matrix pair by an orthogonal equivalence transformation.
subroutine stgex2 (wantq, wantz, n, a, lda, b, ldb, q, ldq, z, ldz, j1,
n1, n2, work, lwork, info)
STGEX2 swaps adjacent diagonal blocks in an upper (quasi) triangular matrix pair by an orthogonal equivalence transformation.
subroutine ztgex2 (wantq, wantz, n, a, lda, b, ldb, q, ldq, z, ldz, j1,
info)
ZTGEX2 swaps adjacent diagonal blocks in an upper (quasi) triangular matrix pair by an unitary equivalence transformation.
π Detailed Description π
(the source page keeps this one super quiet β no prose here at all. all the actual tea is down in the Function Documentation section, so scroll with me π )
π₯ Function Documentation π₯
π subroutine ctgex2
subroutine ctgex2 (logical wantq, logical wantz, integer n, complex,
dimension( lda, * ) a, integer lda, complex, dimension( ldb, * ) b,
integer ldb, complex, dimension( ldq, * ) q, integer ldq, complex,
dimension( ldz, * ) z, integer ldz, integer j1, integer info)
CTGEX2 swaps adjacent diagonal blocks in an upper (quasi) triangular matrix pair by an unitary equivalence transformation.
β¨ Purpose
!>!> CTGEX2 swaps adjacent diagonal 1 by 1 blocks (A11,B11) and (A22,B22)!> in an upper triangular matrix pair (A, B) by an unitary equivalence!> transformation.!>!> (A, B) must be in generalized Schur canonical form, that is, A and!> B are both upper triangular.!>!> Optionally, the matrices Q and Z of generalized Schur vectors are!> updated.!>!> Q(in) * A(in) * Z(in)**H = Q(out) * A(out) * Z(out)**H!> Q(in) * B(in) * Z(in)**H = Q(out) * B(out) * Z(out)**H!>!>
π Parameters
WANTQβWANTQisLOGICAL.TRUE.: update the left transformation matrix Q;.FALSE.: do not update Q.
WANTZβWANTZisLOGICAL.TRUE.: update the right transformation matrix Z;.FALSE.: do not update Z.
NβNisINTEGER. The order of the matrices A and B.N >= 0.AβAisCOMPLEXarray, dimension(LDA,N). On entry, the matrix A in the pair (A, B). On exit, the updated matrix A.LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,N).BβBisCOMPLEXarray, dimension(LDB,N). On entry, the matrix B in the pair (A, B). On exit, the updated matrix B.LDBβLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,N).QβQisCOMPLEXarray, dimension(LDQ,N). IfWANTQ = .TRUE, on entry, the unitary matrix Q. On exit, the updated matrix Q. Not referenced ifWANTQ = .FALSE..LDQβLDQisINTEGER. The leading dimension of the array Q.LDQ >= 1; IfWANTQ = .TRUE.,LDQ >= N.ZβZisCOMPLEXarray, dimension(LDZ,N). IfWANTZ = .TRUE, on entry, the unitary matrix Z. On exit, the updated matrix Z. Not referenced ifWANTZ = .FALSE..LDZβLDZisINTEGER. The leading dimension of the array Z.LDZ >= 1; IfWANTZ = .TRUE.,LDZ >= N.J1βJ1isINTEGER. The index to the first block (A11, B11).INFOβINFOisINTEGER=0: Successful exit.=1: The transformed matrix pair (A, B) would be too far from generalized Schur form; the problem is ill-conditioned.
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ Further Details
In the current code both weak and strong stability tests are performed. The user can omit the strong stability test by changing the internal logical parameter WANDS to .FALSE.. See ref. [2] for details.
π Contributors
Bo Kagstrom and Peter Poromaa, Department of Computing Science, Umea University, S-901 87 Umea, Sweden.
π References
[1] B. Kagstrom; A Direct Method for Reordering Eigenvalues in the Generalized Real Schur Form of a Regular Matrix Pair (A, B), in M.S. Moonen et al (eds), Linear Algebra for Large Scale and Real-Time Applications, Kluwer Academic Publ. 1993, pp 195-218.
[2] B. Kagstrom and P. Poromaa; Computing Eigenspaces with Specified Eigenvalues of a Regular Matrix Pair (A, B) and Condition Estimation: Theory, Algorithms and Software, Report UMINF-94.04, Department of Computing Science, Umea University, S-901 87 Umea, Sweden, 1994. Also as LAPACK Working Note 87. To appear in Numerical Algorithms, 1996.
Definition at line 188 of file ctgex2.f.
π subroutine dtgex2
subroutine dtgex2 (logical wantq, logical wantz, integer n, double
precision, dimension( lda, * ) a, integer lda, double precision,
dimension( ldb, * ) b, integer ldb, double precision, dimension( ldq, *
) q, integer ldq, double precision, dimension( ldz, * ) z, integer ldz,
integer j1, integer n1, integer n2, double precision, dimension( * )
work, integer lwork, integer info)
DTGEX2 swaps adjacent diagonal blocks in an upper (quasi) triangular matrix pair by an orthogonal equivalence transformation.
β¨ Purpose
!>!> DTGEX2 swaps adjacent diagonal blocks (A11, B11) and (A22, B22)!> of size 1-by-1 or 2-by-2 in an upper (quasi) triangular matrix pair!> (A, B) by an orthogonal equivalence transformation.!>!> (A, B) must be in generalized real Schur canonical form (as returned!> by DGGES), i.e. A is block upper triangular with 1-by-1 and 2-by-2!> diagonal blocks. B is upper triangular.!>!> Optionally, the matrices Q and Z of generalized Schur vectors are!> updated.!>!> Q(in) * A(in) * Z(in)**T = Q(out) * A(out) * Z(out)**T!> Q(in) * B(in) * Z(in)**T = Q(out) * B(out) * Z(out)**T!>!>
π Parameters
WANTQβWANTQisLOGICAL.TRUE.: update the left transformation matrix Q;.FALSE.: do not update Q.
WANTZβWANTZisLOGICAL.TRUE.: update the right transformation matrix Z;.FALSE.: do not update Z.
NβNisINTEGER. The order of the matrices A and B.N >= 0.AβAisDOUBLE PRECISIONarray, dimensions(LDA,N). On entry, the matrix A in the pair (A, B). On exit, the updated matrix A.LDAβLDAisINTEGER. The leading dimension of the array A.LDA >= max(1,N).BβBisDOUBLE PRECISIONarray, dimensions(LDB,N). On entry, the matrix B in the pair (A, B). On exit, the updated matrix B.LDBβLDBisINTEGER. The leading dimension of the array B.LDB >= max(1,N).QβQisDOUBLE PRECISIONarray, dimension(LDQ,N). On entry, ifWANTQ = .TRUE., the orthogonal matrix Q. On exit, the updated matrix Q. Not referenced ifWANTQ = .FALSE..LDQβLDQisINTEGER. The leading dimension of the array Q.LDQ >= 1. IfWANTQ = .TRUE.,LDQ >= N.ZβZisDOUBLE PRECISIONarray, dimension(LDZ,N). On entry, ifWANTZ =.TRUE., the orthogonal matrix Z. On exit, the updated matrix Z. Not referenced ifWANTZ = .FALSE..LDZβLDZisINTEGER. The leading dimension of the array Z.LDZ >= 1. IfWANTZ = .TRUE.,LDZ >= N.J1βJ1isINTEGER. The index to the first block (A11, B11).1 <= J1 <= N.N1βN1isINTEGER. The order of the first block (A11, B11).N1 = 0,1or2.N2βN2isINTEGER. The order of the second block (A22, B22).N2 = 0,1or2.WORKβWORKisDOUBLE PRECISIONarray, dimension(MAX(1,LWORK)).LWORKβLWORKisINTEGER. The dimension of the arrayWORK.LWORK >= MAX( 1, N*(N2+N1), (N2+N1)*(N2+N1)*2 )INFOβINFOisINTEGER=0: Successful exit>0: IfINFO = 1, the transformed matrix (A, B) would be too far from generalized Schur form; the blocks are not swapped and (A, B) and (Q, Z) are unchanged. The problem of swapping is too ill-conditioned.<0: IfINFO = -16:LWORKis too small. Appropriate value forLWORKis returned inWORK(1).
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π¦ Further Details
In the current code both weak and strong stability tests are performed. The user can omit the strong stability test by changing the internal logical parameter WANDS to .FALSE.. See ref. [2] for details.
π Contributors
Bo Kagstrom and Peter Poromaa, Department of Computing Science, Umea University, S-901 87 Umea, Sweden.
π References
(and that's exactly where part 1 wraps up β refs are incoming in the next part, bestie π«Ά)
okay so the rest of dtgex2's reference list is literally this, and we are not skipping the receipts:
[1] B. Kagstrom; A Direct Method for Reordering Eigenvalues in the Generalized Real Schur Form of a Regular Matrix Pair (A, B), in M.S. Moonen et al (eds), Linear Algebra for Large Scale and Real-Time Applications, Kluwer Academic Publ. 1993, pp 195-218.[2] B. Kagstrom and P. Poromaa; Computing Eigenspaces with Specified Eigenvalues of a Regular Matrix Pair (A, B) and Condition Estimation: Theory, Algorithms and Software, Report UMINF - 94.04, Department of Computing Science, Umea University, S-901 87 Umea, Sweden, 1994. Also as LAPACK Working Note 87. To appear in Numerical Algorithms, 1996.
And the source location for that one is Definition at line 219 of file dtgex2.f..
π stgex2 β the real-valued adjacent-block swapper
subroutine stgex2 (logical wantq, logical wantz, integer n, real, dimension(
lda, * ) a, integer lda, real, dimension( ldb, * ) b, integer ldb, real,
dimension( ldq, * ) q, integer ldq, real, dimension( ldz, * ) z, integer
ldz, integer j1, integer n1, integer n2, real, dimension( * ) work,
integer lwork, integer info)
STGEX2 swaps adjacent diagonal blocks in an upper (quasi) triangular
matrix pair by an orthogonal equivalence transformation.
so STGEX2 is the real-valued one that swaps adjacent diagonal blocks in an upper (quasi) triangular matrix pair by an orthogonal equivalence transformation. iconic, honestly.
π― Purpose
STGEX2 swaps adjacent diagonal blocks (A11, B11) and (A22, B22) of size 1-by-1 or 2-by-2 in an upper (quasi) triangular matrix pair (A, B) by an orthogonal equivalence transformation.
(A, B) must be in generalized real Schur canonical form (as returned by SGGES), i.e. A is block upper triangular with 1-by-1 and 2-by-2 diagonal blocks. B is upper triangular.
Optionally, the matrices Q and Z of generalized Schur vectors are updated.
Q(in) * A(in) * Z(in)**T = Q(out) * A(out) * Z(out)**T
Q(in) * B(in) * Z(in)**T = Q(out) * B(out) * Z(out)**T
π§Ύ Parameters
WANTQβWANTQisLOGICAL..TRUE.: update the left transformation matrixQ;.FALSE.: do not updateQ.WANTZβWANTZisLOGICAL..TRUE.: update the right transformation matrixZ;.FALSE.: do not updateZ.NβNisINTEGER. The order of the matricesAandB.N >= 0.AβAisREALarray, dimension(LDA,N). On entry, the matrixAin the pair(A, B). On exit, the updated matrixA.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).BβBisREALarray, dimension(LDB,N). On entry, the matrixBin the pair(A, B). On exit, the updated matrixB.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).QβQisREALarray, dimension(LDQ,N). On entry, ifWANTQ = .TRUE., the orthogonal matrixQ. On exit, the updated matrixQ. Not referenced ifWANTQ = .FALSE..LDQβLDQisINTEGER. The leading dimension of the arrayQ.LDQ >= 1. IfWANTQ = .TRUE.,LDQ >= N.ZβZisREALarray, dimension(LDZ,N). On entry, ifWANTZ = .TRUE., the orthogonal matrixZ. On exit, the updated matrixZ. Not referenced ifWANTZ = .FALSE..LDZβLDZisINTEGER. The leading dimension of the arrayZ.LDZ >= 1. IfWANTZ = .TRUE.,LDZ >= N.J1βJ1isINTEGER. The index to the first block(A11, B11).1 <= J1 <= N.N1βN1isINTEGER. The order of the first block(A11, B11).N1 = 0, 1 or 2.N2βN2isINTEGER. The order of the second block(A22, B22).N2 = 0, 1 or 2.WORKβWORKisREALarray, dimension(MAX(1,LWORK)).LWORKβLWORKisINTEGER. The dimension of the arrayWORK.LWORK >= MAX( N*(N2+N1), (N2+N1)*(N2+N1)*2 ).INFOβINFOisINTEGER.=0: Successful exit.>0: IfINFO = 1, the transformed matrix(A, B)would be too far from generalized Schur form; the blocks are not swapped and(A, B)and(Q, Z)are unchanged. The problem of swapping is too ill-conditioned.<0: IfINFO = -16:LWORKis too small. Appropriate value forLWORKis returned inWORK(1).
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details:
In the current code both weak and strong stability tests are performed. The user can omit the strong stability test by changing the internal logical parameter WANDS to .FALSE.. See ref. [2] for details.
π«Ά Contributors:
Bo Kagstrom and Peter Poromaa, Department of Computing Science, Umea University, S-901 87 Umea, Sweden.
π References:
[1] B. Kagstrom; A Direct Method for Reordering Eigenvalues in the Generalized Real Schur Form of a Regular Matrix Pair (A, B), in M.S. Moonen et al (eds), Linear Algebra for Large Scale and Real-Time Applications, Kluwer Academic Publ. 1993, pp 195-218.[2] B. Kagstrom and P. Poromaa; Computing Eigenspaces with Specified Eigenvalues of a Regular Matrix Pair (A, B) and Condition Estimation: Theory, Algorithms and Software, Report UMINF - 94.04, Department of Computing Science, Umea University, S-901 87 Umea, Sweden, 1994. Also as LAPACK Working Note 87. To appear in Numerical Algorithms, 1996.
Definition at line 219 of file stgex2.f.
π¦ ztgex2 β the COMPLEX*16 adjacent-block swapper
subroutine ztgex2 (logical wantq, logical wantz, integer n, complex*16,
dimension( lda, * ) a, integer lda, complex*16, dimension( ldb, * ) b,
integer ldb, complex*16, dimension( ldq, * ) q, integer ldq, complex*16,
dimension( ldz, * ) z, integer ldz, integer j1, integer info)
ZTGEX2 swaps adjacent diagonal blocks in an upper (quasi) triangular
matrix pair by an unitary equivalence transformation.
ZTGEX2 is the complex*16 version, and it swaps adjacent diagonal blocks in an upper (quasi) triangular matrix pair by an unitary equivalence transformation. <sparkle>slay</sparkle>.
π― Purpose
ZTGEX2 swaps adjacent diagonal 1 by 1 blocks (A11,B11) and (A22,B22) in an upper triangular matrix pair (A, B) by an unitary equivalence transformation.
(A, B) must be in generalized Schur canonical form, that is, A and B are both upper triangular.
Optionally, the matrices Q and Z of generalized Schur vectors are updated.
Q(in) * A(in) * Z(in)**H = Q(out) * A(out) * Z(out)**H
Q(in) * B(in) * Z(in)**H = Q(out) * B(out) * Z(out)**H
π§Ύ Parameters
WANTQβWANTQisLOGICAL..TRUE.: update the left transformation matrixQ;.FALSE.: do not updateQ.WANTZβWANTZisLOGICAL..TRUE.: update the right transformation matrixZ;.FALSE.: do not updateZ.NβNisINTEGER. The order of the matricesAandB.N >= 0.AβAisCOMPLEX*16array, dimensions(LDA,N). On entry, the matrixAin the pair(A, B). On exit, the updated matrixA.LDAβLDAisINTEGER. The leading dimension of the arrayA.LDA >= max(1,N).BβBisCOMPLEX*16array, dimensions(LDB,N). On entry, the matrixBin the pair(A, B). On exit, the updated matrixB.LDBβLDBisINTEGER. The leading dimension of the arrayB.LDB >= max(1,N).QβQisCOMPLEX*16array, dimension(LDQ,N). IfWANTQ = .TRUE, on entry, the unitary matrixQ. On exit, the updated matrixQ. Not referenced ifWANTQ = .FALSE..LDQβLDQisINTEGER. The leading dimension of the arrayQ.LDQ >= 1; IfWANTQ = .TRUE.,LDQ >= N.ZβZisCOMPLEX*16array, dimension(LDZ,N). IfWANTZ = .TRUE, on entry, the unitary matrixZ. On exit, the updated matrixZ. Not referenced ifWANTZ = .FALSE..LDZβLDZisINTEGER. The leading dimension of the arrayZ.LDZ >= 1; IfWANTZ = .TRUE.,LDZ >= N.J1βJ1isINTEGER. The index to the first block(A11, B11).INFOβINFOisINTEGER.=0: Successful exit.=1: The transformed matrix pair(A, B)would be too far from generalized Schur form; the problem is ill-conditioned.
π Author
- Univ. of Tennessee
- Univ. of California Berkeley
- Univ. of Colorado Denver
- NAG Ltd.
π Further Details:
In the current code both weak and strong stability tests are performed. The user can omit the strong stability test by changing the internal logical parameter WANDS to .FALSE.. See ref. [2] for details.
π«Ά Contributors:
Bo Kagstrom and Peter Poromaa, Department of Computing Science, Umea University, S-901 87 Umea, Sweden.
π References
okay so if you want the full lore β like, the actual math-girlie receipts behind all of this β here's where it lives, bestie π
[1]B. Kagstrom; A Direct Method for Reordering Eigenvalues in the Generalized Real Schur Form of a Regular Matrix Pair (A, B), in M.S. Moonen et al (eds), Linear Algebra for Large Scale and Real-Time Applications, Kluwer Academic Publ. 1993, pp 195-218.[2]B. Kagstrom and P. Poromaa; Computing Eigenspaces with Specified Eigenvalues of a Regular Matrix Pair (A, B) and Condition Estimation: Theory, Algorithms and Software, Report UMINF-94.04, Department of Computing Science, Umea University, S-901 87 Umea, Sweden, 1994. Also as LAPACK Working Note 87. To appear in Numerical Algorithms, 1996.
ngl these are the citations you cite when someone asks "wait, why does reordering eigenvalues in a generalized real Schur form work like that" β like, the vibes are academic but the receipts are real π
Also, tiny housekeeping detail so you know exactly where the actual code lives: Definition at line 188 of file ztgex2.f.
β¨ Author β¨
Generated automatically by Doxygen for LAPACK from the source code.
(it wasn't a human who sat down and wrote this β it's literally the computer doing its little documentation glow-up π«Ά the source code is the main character here, Doxygen just took the notes.)
and that's the whole page, bestie!! ππβ¨
Cute lil sign-off before you close the tab: this gorgeousness comes to you from LAPACK, Version 3.12.0, living on the tgex2(3) page β that's the footer energy right there, version stamp and all. Go forth and reorder those eigenvalues, you absolute icon ππ
π¦ 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