SRC/dtgex2.f(3)
okay bestie, welcome to SRC/dtgex2.f(3) β straight from the Library Functions Manual, and this one is lowkey iconic for LAPACK girlies. Itβs giving βswap adjacent diagonal blocksβ main character energy, no cap. π
πΈ NAME πΈ
SRC/dtgex2.f
β¨ SYNOPSIS β¨
π Functions/Subroutines π
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.
π Function/Subroutine Documentation π
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 π¦
okay so the whole serve is this: 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 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βAisDOUBLE PRECISIONarray, 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βBisDOUBLE PRECISIONarray, 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βQisDOUBLE PRECISIONarray, 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βZisDOUBLE PRECISIONarray, 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β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. Exit tea, bestie:=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 dtgex2.f.
π Author π
Generated automatically by Doxygen for LAPACK from the source code.
cute sign-off: this page is from LAPACK Version 3.12.0, source/page SRC/dtgex2.f(3). bye bestie, go swap those blocks responsibly πβ¨π
π¦ 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