PCLAHRD(l)
π PCLAHRD(l) β the LAPACK auxiliary routine that eats subdiagonals for breakfast π
okay bestie, sit down, hydrate, because we're talking about PCLAHRD β a LAPACK auxiliary routine, version 1.5, and she is lowkey the backbone of your whole Hessenberg reduction era. no cap. π¦
β¨ NAME β¨
PCLAHRD β reduce 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. yes she really said all of that in one breath and she meant every word π
β¨ SYNOPSIS β¨
SUBROUTINE PCLAHRD( 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 A( * ), T( * ), TAU( * ), WORK( * ), Y( * )
like. look at that argument list. it's giving organized. it's giving parallel. π
β¨ PURPOSE β¨
so here's the tea β β PCLAHRD 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 the elements below the k-th subdiagonal are zero. periodt.
the reduction gets done by a unitary similarity transformation Q' * A * Q. and then β because she's generous β the routine hands you back the matrices V and T that determine Q as a block reflector I - V*T*V', plus the matrix Y = A * V * T. three gifts. no receipt needed. π«Ά
she's an auxiliary routine, meaning she's called by PCGEHRD β she's the supportive bestie in the group chat who does the real work behind the scenes and lets someone else take the credit. iconic behavior honestly.
and just so we're all on the same page: in the comments below, sub( A ) denotes A(IA:IA+N-1,JA:JA+N-1). noted. memorized. moving on. π
β¨ ARGUMENTS β¨
Nβ (global input)INTEGER. the number of rows and columns to be operated on, i.e. the order of the distributed submatrixsub( A ). and she hasN >= 0as a hard requirement, so don't come at her with negatives, she will simply not πKβ (global input)INTEGER. the offset for the reduction. the elements below the k-th subdiagonal in the firstNBcolumns get reduced to zero. that's the whole assignment. that's the job. π₯NBβ (global input)INTEGER. the number of columns to be reduced. how many columns are we cooking today, bestie? πAβ (local input/local output)COMPLEXpointer into the local memory to an array of dimension(LLD_A, LOCc(JA+N-K)). on entry, this array contains the local pieces of theN-by-(N-K+1)general distributed matrixA(IA:IA+N-1,JA:JA+N-K). on exit, the elements on and above the k-th subdiagonal in the firstNBcolumns are overwritten with the corresponding elements of the reduced distributed matrix; the elements below the k-th subdiagonal, together with the arrayTAU, represent the matrixQas a product of elementary reflectors. the other columns ofA(IA:IA+N-1,JA:JA+N-K)are unchanged β she does not touch what she was not asked to touch, we love a boundary-respecting queen πIAβ (global input)INTEGER. the row index in the global arrayAindicating the first row ofsub( A ). (see Further Details, she has lore π)JAβ (global input)INTEGER. the column index in the global arrayAindicating the first column ofsub( A ). β¨DESCAβ (global and local input)INTEGERarray of dimensionDLEN_. the array descriptor for the distributed matrixA. she's the ID card. she's the vibe check. πͺͺTAUβ (local output)COMPLEXarray, dimensionLOCc(JA+N-2). the scalar factors of the elementary reflectors (again: see Further Details).TAUis tied to the distributed matrixAβ they're a package deal, inseparable, main character duo energy πTβ (local output)COMPLEXarray, dimension(NB_A,NB_A). the upper triangular matrixT. triangle-shaped and thriving πΊYβ (local output)COMPLEXpointer into the local memory to an array of dimension(LLD_Y,NB_A). on exit, this array contains the local pieces of theN-by-NBdistributed matrixY. and heads up:LLD_Y >= LOCr(IA+N-1)β respect the leading dimension, she's not asking twice π«IYβ (global input)INTEGER. the row index in the global arrayYindicating the first row ofsub( Y ). πΈJYβ (global input)INTEGER. the column index in the global arrayYindicating the first column ofsub( Y ). πΈDESCYβ (global and local input)INTEGERarray of dimensionDLEN_. the array descriptor for the distributed matrixY. the other ID card πͺͺWORKβ (local workspace)COMPLEXarray, dimension(NB). just vibing. doing her little job. we stan a workspace π
β¨ FURTHER DETAILS β¨
okay this is the part where it gets real pretty. 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
and 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). π memorize that indexing, bestie, it WILL be on the exam.
the elements of the vectors v together form the (n-k+1)-by-nb matrix V β which is needed, together 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').
like. that's a whole transformation. that's a whole glow-up. π β¨
π the illustration (yes, she drew you a picture) π
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 )
and now the legend, because we do not gatekeep knowledge in this house:
aβ an element of the original matrixA(ia:ia+n-1,ja:ja+n-k)(untouched, unbothered, thriving π±)hβ a modified element of the upper Hessenberg matrixH(she got the makeover πββοΈ)viβ an element of the vector definingH(i)(the reflection-vector girlies π§)
β οΈ real talk though: the reduction only overwrites what it says it overwrites, and the below-subdiagonal entries are where Q lives β so if you mess with them expecting them to still be your original data, that's on you, not on her. π
that's the whole page, bestie. PCLAHRD, LAPACK auxiliary routine, version 1.5 β and yes, she's from 12 May 1997, a certified vintage icon still out here reducing subdiagonals with full main character energy ππ
π¦ where this page comes from
- ubuntu jammy: scalapack-doc 1.5-11
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms