CTGEX2(3)
π CTGEX2(3) β the LAPACK girlies' guide to swapping blocks
ok so bestie, welcome to CTGEX2 from the LAPACK library manual (yes, that LAPACK, the linear algebra icon herself π). This page lives at /home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/ctgex2.f and honestly? She's giving main character energy in a very specific "reorder your generalized Schur form" way. Let's get into it β¨
πΈ NAME πΈ
/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/ctgex2.f
(it's a source file bestie, that's the whole name, no cap π)
π¦ SYNOPSIS π¦
Functions/Subroutines
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. literally her whole job π«Ά
π Function/Subroutine Documentation π
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. (yes that's the same sentence twice, she's consistent, we stan π)
β¨ 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 !> !>
so basically: two lil 1-by-1 diagonal blocks go in, one swap happens, and the Q/Z bookkeeping is optional but iconic. Note the requirement β (A, B) must be in generalized Schur canonical form, meaning A and B are both upper triangular. No shortcuts, no vibes-based input π
π Parameters π
WANTQ
!> WANTQ is LOGICAL !> .TRUE. : update the left transformation matrix Q; !> .FALSE.: do not update Q. !>
WANTQβ aLOGICAL. Set it.TRUE.to update the left transformation matrixQ, or.FALSE.to leaveQalone. choose wisely bestie π
WANTZ
!> WANTZ is LOGICAL !> .TRUE. : update the right transformation matrix Z; !> .FALSE.: do not update Z. !>
WANTZβ aLOGICAL..TRUE.updates the right transformation matrixZ;.FALSE.means don't touchZ. the right-side counterpart, we love a symmetrical moment π«Ά
N
!> N is INTEGER !> The order of the matrices A and B. N >= 0. !>
NβINTEGER, the order of the matricesAandB. Must satisfyN >= 0.
A
!> A is COMPLEX array, dimension (LDA,N) !> On entry, the matrix A in the pair (A, B). !> On exit, the updated matrix A. !>
AβCOMPLEXarray, dimension(LDA,N). On entry: the matrixAin the pair(A, B). On exit: the updated matrixA. she gets a glow-up on the way out β¨
LDA
!> LDA is INTEGER !> The leading dimension of the array A. LDA >= max(1,N). !>
LDAβINTEGER, the leading dimension of the arrayA. Must beLDA >= max(1,N).
B
!> B is COMPLEX array, dimension (LDB,N) !> On entry, the matrix B in the pair (A, B). !> On exit, the updated matrix B. !>
BβCOMPLEXarray, dimension(LDB,N). On entry: the matrixBin the pair(A, B). On exit: the updated matrixB.
LDB
!> LDB is INTEGER !> The leading dimension of the array B. LDB >= max(1,N). !>
LDBβINTEGER, the leading dimension of the arrayB. Must beLDB >= max(1,N).
Q
!> Q is COMPLEX array, dimension (LDQ,N) !> If WANTQ = .TRUE, on entry, the unitary matrix Q. On exit, !> the updated matrix Q. !> Not referenced if WANTQ = .FALSE.. !>
QβCOMPLEXarray, dimension(LDQ,N). IfWANTQ = .TRUE, on entry it's the unitary matrixQ, and on exit it's the updated matrixQ. Not referenced ifWANTQ = .FALSE..
LDQ
!> LDQ is INTEGER !> The leading dimension of the array Q. LDQ >= 1; !> If WANTQ = .TRUE., LDQ >= N. !>
LDQβINTEGER, the leading dimension of the arrayQ.LDQ >= 1; and ifWANTQ = .TRUE., thenLDQ >= N.
Z
!> Z is COMPLEX array, dimension (LDZ,N) !> If WANTZ = .TRUE, on entry, the unitary matrix Z. On exit, !> the updated matrix Z. !> Not referenced if WANTZ = .FALSE.. !>
ZβCOMPLEXarray, dimension(LDZ,N). IfWANTZ = .TRUE, on entry it's the unitary matrixZ, and on exit it's the updated matrixZ. Not referenced ifWANTZ = .FALSE..
LDZ
!> LDZ is INTEGER !> The leading dimension of the array Z. LDZ >= 1; !> If WANTZ = .TRUE., LDZ >= N. !>
LDZβINTEGER, the leading dimension of the arrayZ.LDZ >= 1; and ifWANTZ = .TRUE., thenLDZ >= N.
J1
!> J1 is INTEGER !> The index to the first block (A11, B11). !>
J1βINTEGER, the index to the first block(A11, B11). that's your starting point, periodt π
INFO
!> INFO is INTEGER !> =0: Successful exit. !> =1: The transformed matrix pair (A, B) would be too far !> from generalized Schur form; the problem is ill- !> conditioned. !>
INFOβINTEGER. Exit status, and she is not subtle:=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.
(academia said "we all wrote this" and honestly? teamwork makes the dream work π«Ά)
π₯ 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.
ok so heads up bestie β this is a "you can do it, but read the ref first" situation.WANDSis an internal logical parameter, and flipping it to.FALSE.drops the strong stability test. Check ref.[2]before you go messing with her internals, fr fr π
π§ Contributors: π§
Bo Kagstrom and Peter Poromaa, Department of Computing Science, Umea University, S-901 87 Umea, Sweden.
(shoutout to the Swedish math girlies πΈπͺπ)
π 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. π
π Author π
Generated automatically by Doxygen for LAPACK from the source code. (not a human, just a robot doing her little documentation duty, and honestly? she ate π€β¨)
and that's the whole page bestie!! π This was LAPACK, Version 3.12.0, dated /home/abui...RC/ctgex2.f(3) β go forth and swap those adjacent diagonal blocks, you absolute icon ππ¦
π¦ where this page comes from
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- opensuse-leap 16.0: lapack-man 3.12.0-160000.2.2 Β· BSD-3-Clause
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms