PZLAHRD(l)

πŸ“¦ version 1.5, in ubuntu jammy

✨ PZLAHRD ✨

okay so bestie, sit down, hydrate, because today we're getting into PZLAHRD β€” a LAPACK auxiliary routine from the l corner of the manual πŸ’… it's giving linear algebra, it's giving distributed matrix energy, and yes it's a supporting character in somebody else's redemption arc (we'll get to that, bestie, don't worry) 🫢


🌸 NAME 🌸

PZLAHRD β€” the routine that reduces the first NB columns of a complex general N-by-(N-K+1) distributed matrix A(IA:IA+N-1,JA:JA+N-K) so that elements below the k-th subdiagonal are zero ✨ like, that's the whole assignment and she ate πŸ”₯


πŸŽ€ SYNOPSIS πŸŽ€

SUBROUTINE PZLAHRD( N, K, NB, A, IA, JA, DESCA, TAU, T, Y, IY, JY,
                    DESCY, WORK )

    INTEGER         IA, IY, JA, JY, K, N, NB

    INTEGER         DESCA( * ), DESCY( * )

    COMPLEX*16      A( * ), T( * ), TAU( * ), WORK( * ), Y( * )

πŸ’« PURPOSE πŸ’«

So here's the vibe: PZLAHRD reduces the first NB columns of a complex general N-by-(N-K+1) distributed matrix A(IA:IA+N-1,JA:JA+N-K) so that elements below the k-th subdiagonal are zero. Periodt. πŸ’…

The reduction is performed by an unitary similarity transformation Q' * A * Q. The routine returns the matrices V and T which determine Q as a block reflector I - V*T*V', and also the matrix Y = A * V * T πŸ‘‘

And yes, she's an auxiliary routine β€” called by PZGEHRD, bestie. Supporting role, main character performance 🌟 In the following comments sub( A ) denotes A(IA:IA+N-1,JA:JA+N-1).


πŸ’– ARGUMENTS πŸ’–

  • N (global input) INTEGER β€” the number of rows and columns to be operated on, i.e. the order of the distributed submatrix sub( A ). And listen, N >= 0. no cap 🫑
  • K (global input) INTEGER β€” the offset for the reduction. Elements below the k-th subdiagonal in the first NB columns are reduced to zero 🧚
  • NB (global input) INTEGER β€” the number of columns to be reduced. iconic, love that for her ✨
  • A (local input/local output) COMPLEX*16 pointer into the local memory to an array of dimension (LLD_A, LOCc(JA+N-K)). On entry, this array contains the local pieces of the N-by-(N-K+1) general distributed matrix A(IA:IA+N-1,JA:JA+N-K). On exit, the elements on and above the k-th subdiagonal in the first NB columns are overwritten with the corresponding elements of the reduced distributed matrix; the elements below the k-th subdiagonal, with the array TAU, represent the matrix Q as a product of elementary reflectors. The other columns of A(IA:IA+N-1,JA:JA+N-K) are unchanged. See Further Details πŸ‘€
    • IA (global input) INTEGER β€” the row index in the global array A indicating the first row of sub( A ). (yeah bestie, IA got squished inside the A entry in the original and we are honoring the canon πŸ’€)
  • JA (global input) INTEGER β€” the column index in the global array A indicating the first column of sub( A ) πŸ¦‹
  • DESCA (global and local input) INTEGER array of dimension DLEN_. The array descriptor for the distributed matrix A β€” she's the vibe check for where everything lives πŸ“
  • TAU (local output) COMPLEX*16 array, dimension LOCc(JA+N-2) β€” the scalar factors of the elementary reflectors (see Further Details). TAU is tied to the distributed matrix A πŸ”—
  • T (local output) COMPLEX*16 array, dimension (NB_A,NB_A) β€” the upper triangular matrix T ⭐
  • Y (local output) COMPLEX*16 pointer into the local memory to an array of dimension (LLD_Y,NB_A). On exit, this array contains the local pieces of the N-by-NB distributed matrix Y. And bestie, LLD_Y >= LOCr(IA+N-1) β€” respect the constraint or perish πŸ™ˆ
  • IY (global input) INTEGER β€” the row index in the global array Y indicating the first row of sub( Y ) πŸŽ€
  • JY (global input) INTEGER β€” the column index in the global array Y indicating the first column of sub( Y ) πŸŽ€
  • DESCY (global and local input) INTEGER array of dimension DLEN_. The array descriptor for the distributed matrix Y πŸ’œ
  • WORK (local workspace) COMPLEX*16 array, dimension (NB) β€” the little scratch pad, tiny but mighty 🌈

πŸ” FURTHER DETAILS πŸ”

The matrix Q is represented as a product of nb elementary reflectors:

Q = H(1) H(2) . . . H(nb).

Each H(i) has the form:

H(i) = I - tau * v * v'

where tau is a complex scalar, and v is a complex vector with v(1:i+k-1) = 0, v(i+k) = 1; v(i+k+1:n) is stored on exit in A(ia+i+k:ia+n-1,ja+i-1), and tau in TAU(ja+i-1) πŸ’…

The elements of the vectors v together form the (n-k+1)-by-nb matrix V which is needed, with T and Y, to apply the transformation to the unreduced part of the matrix, using an update of the form:

A(ia:ia+n-1,ja:ja+n-k) := (I-V*T*V')*(A(ia:ia+n-1,ja:ja+n-k)-Y*V').

The contents of A(ia:ia+n-1,ja:ja+n-k) on exit are illustrated by the following example with n = 7, k = 3 and nb = 2:

   ( a   h   a   a   a )
   ( a   h   a   a   a )
   ( a   h   a   a   a )
   ( h   h   a   a   a )
   ( v1  h   a   a   a )
   ( v1  v2  a   a   a )
   ( v1  v2  a   a   a )

where a denotes an element of the original matrix A(ia:ia+n-1,ja:ja+n-k), h denotes a modified element of the upper Hessenberg matrix H, and vi denotes an element of the vector defining H(i) 🌸

fr fr, stare at that little grid for a sec. it's literally the whole personality of the routine. the as are untouched, the hs got a glow-up, and the vs are the receipts πŸ’–

and that's the whole page, bestie 🫢 this was LAPACK version 1.5, dated 12 May 1997 β€” yes, she's vintage, she's classic, she's still running on machines that were built before you were born πŸ‘‘ go call PZGEHRD and be free πŸ’œ

πŸ“¦ where this page comes from