SRC/dsptrd.f(3)

πŸ’… SRC/dsptrd.f β€” a.k.a. the LAPACK Library Functions Manual entry you didn't know you needed πŸ¦‹

okay so bestie, buckle up, because this is the glow-up of a lifetime for a symmetric matrix ✨ We're talking DSPTRD, and no cap, it's giving main character energy in the packed-storage department.


πŸŽ€ NAME πŸŽ€

SRC/dsptrd.f β€” literally the file, that's the name, periodt.


✨ SYNOPSIS ✨

🌸 Functions/Subroutines 🌸

  • subroutine dsptrd (uplo, n, ap, d, e, tau, info) β€” the whole vibe, right here, DSPTRD πŸ‘‘

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

🫢 subroutine dsptrd (character uplo, integer n, double precision, dimension( * ) ap, double precision, dimension( * ) d, double precision, dimension( * ) e, double precision, dimension( * ) tau, integer info)

DSPTRD β€” say it with me, icon behavior πŸ’…

🌈 Purpose:

!>
!> DSPTRD reduces a real symmetric matrix A stored in packed form to
!> symmetric tridiagonal form T by an orthogonal similarity
!> transformation: Q**T * A * Q = T.
!>

so basically: take a real symmetric matrix A that's chilling in packed form, and reduce it to symmetric tridiagonal form T via an orthogonal similarity transformation. It's a whole transformation arc, and honestly? obsessed πŸ”₯


πŸ“ Parameters

πŸ’œ UPLO

!>          UPLO is CHARACTER*1
!>          = 'U':  Upper triangle of A is stored;
!>          = 'L':  Lower triangle of A is stored.
!>

it's a CHARACTER*1, and it's literally just picking sides: 'U' means the upper triangle of A is the one being stored, 'L' means the lower triangle gets the spotlight. choose your fighter πŸ’€

πŸ’œ N

!>          N is INTEGER
!>          The order of the matrix A.  N >= 0.
!>

an INTEGER, the order of matrix A, and it must be N >= 0 β€” no negatives allowed, we don't do that here πŸ™ˆ

πŸ’œ AP

!>          AP is DOUBLE PRECISION array, dimension (N*(N+1)/2)
!>          On entry, the upper or lower triangle of the symmetric matrix
!>          A, packed columnwise in a linear array.  The j-th column of A
!>          is stored in the array AP as follows:
!>          if UPLO = 'U', AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j;
!>          if UPLO = 'L', AP(i + (j-1)*(2*n-j)/2) = A(i,j) for j<=i<=n.
!>          On exit, if UPLO = 'U', the diagonal and first superdiagonal
!>          of A are overwritten by the corresponding elements of the
!>          tridiagonal matrix T, and the elements above the first
!>          superdiagonal, with the array TAU, represent the orthogonal
!>          matrix Q as a product of elementary reflectors; if UPLO
!>          = 'L', the diagonal and first subdiagonal of A are over-
!>          written by the corresponding elements of the tridiagonal
!>          matrix T, and the elements below the first subdiagonal, with
!>          the array TAU, represent the orthogonal matrix Q as a product
!>          of elementary reflectors. See Further Details.
!>

a DOUBLE PRECISION array, dimension (N*(N+1)/2), and this is where it gets spicy 🌢️ On entry it's holding the upper or lower triangle of the symmetric matrix A, packed columnwise in a linear array. The j-th column of A lives in AP like this: if UPLO = 'U', then AP(i + (j-1)*j/2) = A(i,j) for 1<=i<=j; if UPLO = 'L', then AP(i + (j-1)*(2*n-j)/2) = A(i,j) for j<=i<=n.

On exit? oh she changes. If UPLO = 'U', the diagonal and first superdiagonal of A get overwritten by the corresponding elements of the tridiagonal matrix T, and the elements above the first superdiagonal, together with the array TAU, represent the orthogonal matrix Q as a product of elementary reflectors. If UPLO = 'L', it's the diagonal and first subdiagonal of A that get overwritten by the corresponding elements of T, and the elements below the first subdiagonal, with TAU, represent Q as a product of elementary reflectors. See Further Details, iykyk πŸ’–

πŸ’œ D

!>          D is DOUBLE PRECISION array, dimension (N)
!>          The diagonal elements of the tridiagonal matrix T:
!>          D(i) = A(i,i).
!>

a DOUBLE PRECISION array, dimension (N), holding the diagonal elements of the tridiagonal matrix T: D(i) = A(i,i). it's giving diagonal realness ✨

πŸ’œ E

!>          E is DOUBLE PRECISION array, dimension (N-1)
!>          The off-diagonal elements of the tridiagonal matrix T:
!>          E(i) = A(i,i+1) if UPLO = 'U', E(i) = A(i+1,i) if UPLO = 'L'.
!>

a DOUBLE PRECISION array, dimension (N-1), the off-diagonal elements of T: E(i) = A(i,i+1) if UPLO = 'U', and E(i) = A(i+1,i) if UPLO = 'L'. off-diagonal but still iconic πŸ¦‹

πŸ’œ TAU

!>          TAU is DOUBLE PRECISION array, dimension (N-1)
!>          The scalar factors of the elementary reflectors (see Further
!>          Details).
!>

a DOUBLE PRECISION array, dimension (N-1), holding the scalar factors of the elementary reflectors β€” check Further Details for the lore πŸ“–

πŸ’œ INFO

!>          INFO is INTEGER
!>          = 0:  successful exit
!>          < 0:  if INFO = -i, the i-th argument had an illegal value
!>

an INTEGER, and it's the vibes report: = 0 means successful exit, slay πŸ’š and < 0 means if INFO = -i, the i-th argument had an illegal value β€” so something showed up to the function underdressed 😭


🌟 Author 🌟

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

the whole squad collaborated, we love a group project that actually worked 🫢


🧚 Further Details:

!>
!>  If UPLO = 'U', the matrix Q is represented as a product of elementary
!>  reflectors
!>
!>     Q = H(n-1) . . . H(2) H(1).
!>
!>  Each H(i) has the form
!>
!>     H(i) = I - tau * v * v**T
!>
!>  where tau is a real scalar, and v is a real vector with
!>  v(i+1:n) = 0 and v(i) = 1; v(1:i-1) is stored on exit in AP,
!>  overwriting A(1:i-1,i+1), and tau is stored in TAU(i).
!>
!>  If UPLO = 'L', the matrix Q is represented as a product of elementary
!>  reflectors
!>
!>     Q = H(1) H(2) . . . H(n-1).
!>
!>  Each H(i) has the form
!>
!>     H(i) = I - tau * v * v**T
!>
!>  where tau is a real scalar, and v is a real vector with
!>  v(1:i) = 0 and v(i+1) = 1; v(i+2:n) is stored on exit in AP,
!>  overwriting A(i+2:n,i), and tau is stored in TAU(i).
!>

so here's the tea β˜• if UPLO = 'U', matrix Q is a product of elementary reflectors, and the order matters: Q = H(n-1) . . . H(2) H(1). Each H(i) looks like H(i) = I - tau * v * v**T, where tau is a real scalar and v is a real vector with v(i+1:n) = 0 and v(i) = 1; v(1:i-1) gets stored on exit in AP, overwriting A(1:i-1,i+1), and tau is stored in TAU(i).

If UPLO = 'L', Q is again a product of elementary reflectors but read the other way: Q = H(1) H(2) . . . H(n-1). Each H(i) is H(i) = I - tau * v * v**T, where tau is a real scalar and v is a real vector with v(1:i) = 0 and v(i+1) = 1; v(i+2:n) gets stored on exit in AP, overwriting A(i+2:n,i), and tau is stored in TAU(i). it's symmetric in spirit but the indices said "not today" πŸ’€βœ¨


πŸ’‘ friendly heads-up, bestie: AP does not survive unchanged. once this subroutine is done with it, the original A data up there is overwritten. like, gone. so if you needed it, save a copy β€” that's not a drill πŸ”₯

πŸ“Œ Definition at line 149 of file dsptrd.f.

literally line 149, go look, she's right there πŸ‘‘


🌈 Author 🌈

Generated automatically by Doxygen for LAPACK from the source code. the robots did the paperwork so we didn't have to, we stan πŸ€–πŸ’–


and that's the whole page, bestie! brought to you by LAPACK, Version 3.12.0, filed neatly under SRC/dsptrd.f(3) β€” go forth and tridiagonalize responsibly, mwah πŸ’‹πŸŽ€πŸŒΈ

πŸ“¦ where this page comes from