ZTREVC(3)

πŸ“¦ version 3.12.0, in opensuse-leap 16.0

πŸ’… ZTREVC (3) β€” bestie edition ✨

okay so this page lives at /home/abui...RC/ztrevc.f(3) in the Library Functions Manual, and it's a Fortran routine page from the LAPACK library β€” buckle up, we're doing eigenvectors πŸŽ€


🌸 NAME 🌸

/home/abuild/rpmbuild/BUILD/lapack-static-3.12.0-build/lapack-3.12.0/SRC/ztrevc.f

that's it. that's the name. it's giving "my whole legal identity is a build path" 😭 but slay, it's the source file for ZTREVC and it's iconic.


✨ SYNOPSIS ✨

Functions/Subroutines

subroutine ZTREVC (side, howmny, select, n, t, ldt, vl, ldvl, vr, ldvr,
    mm, m, work, rwork, info)

ZTREVC β€” that's the whole vibe, no cap πŸ¦‹


πŸ‘‘ Function/Subroutine Documentation πŸ‘‘

subroutine ZTREVC (character side, character howmny, logical, dimension( * )
    select, integer n, complex*16, dimension( ldt, * ) t, integer ldt,
    complex*16, dimension( ldvl, * ) vl, integer ldvl, complex*16,
    dimension( ldvr, * ) vr, integer ldvr, integer mm, integer m,
    complex*16, dimension( * ) work, double precision, dimension( * ) rwork,
    integer info)

ZTREVC πŸ’œ

🎯 Purpose:

!>
!> ZTREVC computes some or all of the right and/or left eigenvectors of
!> a complex upper triangular matrix T.
!> Matrices of this type are produced by the Schur factorization of
!> a complex general matrix:  A = Q*T*Q**H, as computed by ZHSEQR.
!>
!> The right eigenvector x and the left eigenvector y of T corresponding
!> to an eigenvalue w are defined by:
!>
!>              T*x = w*x,     (y**H)*T = w*(y**H)
!>
!> where y**H denotes the conjugate transpose of the vector y.
!> The eigenvalues are not input to this routine, but are read directly
!> from the diagonal of T.
!>
!> This routine returns the matrices X and/or Y of right and left
!> eigenvectors of T, or the products Q*X and/or Q*Y, where Q is an
!> input matrix.  If Q is the unitary factor that reduces a matrix A to
!> Schur form T, then Q*X and Q*Y are the matrices of right and left
!> eigenvectors of A.
!>

so basically bestie: you hand it a complex upper triangular matrix T and it hands you back eigenvectors. where does a triangular T come from? from the Schur factorization of a complex general matrix β€” A = Q*T*Q**H, which is literally what ZHSEQR computes πŸ”₯

the definitions you need to keep in your notes app:

  • right eigenvector x and left eigenvector y of T for eigenvalue w are defined by T*x = w*x and (y**H)*T = w*(y**H)
  • y**H = the conjugate transpose of the vector y (yes, conjugate and transpose, both 😌)
  • eigenvalues are not an input here β€” it reads them straight off the diagonal of T, main character energy πŸ‘‘

and what you actually get out: the matrices X and/or Y of right and left eigenvectors of T, or the products Q*X and/or Q*Y where Q is an input matrix. and if Q is the unitary factor that reduces a matrix A to Schur form T, then Q*X and Q*Y are the matrices of right and left eigenvectors of A. periodt πŸ’…


🌈 Parameters 🌈

  • SIDE β€” SIDE is CHARACTER*1
    • = 'R': compute right eigenvectors only
    • = 'L': compute left eigenvectors only
    • = 'B': compute both right and left eigenvectors 🫢
  • HOWMNY β€” HOWMNY is CHARACTER*1
    • = 'A': compute all right and/or left eigenvectors
    • = 'B': compute all right and/or left eigenvectors, backtransformed using the matrices supplied in VR and/or VL
    • = 'S': compute selected right and/or left eigenvectors, as indicated by the logical array SELECT
  • SELECT β€” SELECT is LOGICAL array, dimension (N)

if HOWMNY = 'S', SELECT specifies which eigenvectors get computed. the eigenvector corresponding to the j-th eigenvalue is computed if SELECT(j) = .TRUE.. not referenced if HOWMNY = 'A' or 'B' πŸ™ˆ

  • N β€” N is INTEGER

the order of the matrix T. N >= 0. (yes it can be zero, she contains multitudes)

  • T β€” T is COMPLEX*16 array, dimension (LDT,N)

the upper triangular matrix T. heads up: T is modified, but restored on exit 🧚 so it gets rummaged through but she puts everything back, we love a considerate queen

  • LDT β€” LDT is INTEGER

the leading dimension of the array T. LDT >= max(1,N).

  • VL β€” VL is COMPLEX*16 array, dimension (LDVL,MM)

on entry, if SIDE = 'L' or 'B' and HOWMNY = 'B', VL must contain an N-by-N matrix Q (usually the unitary matrix Q of Schur vectors returned by ZHSEQR).

on exit, if SIDE = 'L' or 'B', VL contains:

  • if HOWMNY = 'A', the matrix Y of left eigenvectors of T
  • if HOWMNY = 'B', the matrix Q*Y
  • if HOWMNY = 'S', the left eigenvectors of T specified by SELECT, stored consecutively in the columns of VL, in the same order as their eigenvalues

not referenced if SIDE = 'R' ⭐

  • LDVL β€” LDVL is INTEGER

the leading dimension of the array VL. LDVL >= 1, and if SIDE = 'L' or 'B', LDVL >= N.

  • VR β€” VR is COMPLEX*16 array, dimension (LDVR,MM)

on entry, if SIDE = 'R' or 'B' and HOWMNY = 'B', VR must contain an N-by-N matrix Q (usually the unitary matrix Q of Schur vectors returned by ZHSEQR).

on exit, if SIDE = 'R' or 'B', VR contains:

  • if HOWMNY = 'A', the matrix X of right eigenvectors of T
  • if HOWMNY = 'B', the matrix Q*X
  • if HOWMNY = 'S', the right eigenvectors of T specified by SELECT, stored consecutively in the columns of VR, in the same order as their eigenvalues

not referenced if SIDE = 'L' πŸ’–

  • LDVR β€” LDVR is INTEGER

the leading dimension of the array VR. LDVR >= 1, and if SIDE = 'R' or 'B'; LDVR >= N. (yes the original really does say 'B' with a semicolon there, we're keeping it exactly, character for character 😌)

  • MM β€” MM is INTEGER

the number of columns in the arrays VL and/or VR. MM >= M.

  • M β€” M is INTEGER

the number of columns in the arrays VL and/or VR actually used to store the eigenvectors. if HOWMNY = 'A' or 'B', M is set to N. each selected eigenvector occupies one column. one eigenvector, one column, no sharing, we don't do that here πŸ’…

  • WORK β€” WORK is COMPLEX*16 array, dimension (2*N)
  • RWORK β€” RWORK is DOUBLE PRECISION array, dimension (N)
  • INFO β€” INFO is INTEGER
    • = 0: successful exit ✨
    • < 0: if INFO = -i, the i-th argument had an illegal value πŸ’€

🫢 Author

  • Univ. of Tennessee
  • Univ. of California Berkeley
  • Univ. of Colorado Denver
  • NAG Ltd.

look at that group project actually working, we love to see it 🌈


πŸ” Further Details:

!>
!>  The algorithm used in this program is basically backward (forward)
!>  substitution, with scaling to make the the code robust against
!>  possible overflow.
!>
!>  Each eigenvector is normalized so that the element of largest
!>  magnitude has magnitude 1; here the magnitude of a complex number
!>  (x,y) is taken to be |x| + |y|.
!>

okay so the algorithm is basically backward (forward) substitution, with scaling so the code stays robust against possible overflow πŸ”₯ (and yes the original says "the the", we are not fixing it, we respect the source πŸŽ€)

and the normalization tea: each eigenvector is normalized so that the element of largest magnitude has magnitude 1. and here's the catch β€” the magnitude of a complex number (x,y) is taken to be |x| + |y|. not the fancy square-root situation, just |x| + |y|. iykyk 😭


πŸ“ Definition at line 216 of file ztrevc.f.


🧚 Author

Generated automatically by Doxygen for LAPACK from the source code.


ngl if you got this far you're genuinely built different. go normalize an eigenvector, bestie πŸ¦‹

okay so that's the whole page!! πŸ’– this was LAPACK Version 3.12.0, dated to that same /home/abui...RC/ztrevc.f(3) path, and the manual page came from the Library Functions Manual β€” mwah, slay, bye πŸ‘‘πŸ’…πŸŒ·

πŸ“¦ where this page comes from