PDLAHRD(l)
π PDLAHRD β the LAPACK auxiliary routine that's lowkey carrying the whole reduction π
okay bestie, gather round, because today we're talking about a LAPACK auxiliary routine from way back (version 1.5, we love a vintage icon) and honestly? she's a supporting character with main character energy. no cap. π
β¨ NAME β¨
PDLAHRD reduces the first NB columns of a real 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. that's the whole gig. she zeroes the vibes below the subdiagonal and she does it flawlessly π
π¦ SYNOPSIS π¦
SUBROUTINE PDLAHRD( 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( * )
DOUBLE PRECISION A( * ), T( * ), TAU( * ), WORK( * ), Y( *
)
πΈ PURPOSE πΈ
so here's the tea β β PDLAHRD reduces the first NB columns of a real 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 orthogonal similarity transformation Q' * A * Q. and then the routine hands you back the matrices V and T which determine Q as a block reflector I - V*T*V', plus the matrix Y = A * V * T. iconic behavior honestly π«Ά
she's an auxiliary routine called by PDGEHRD. not the star of the show, but the show literally does not happen without her. in the following comments, sub( A ) denotes A(IA:IA+N-1,JA:JA+N-1). iykyk β¨
π ARGUMENTS π
N(global input) INTEGER β the number of rows and columns to be operated on, i.e. the order of the distributed submatrixsub( A ). bestie,N >= 0. non-negotiable. πK(global input) INTEGER β the offset for the reduction. elements below the k-th subdiagonal in the firstNBcolumns are reduced to zero. β¨NB(global input) INTEGER β the number of columns to be reduced. that's how many we're doing. πA(local input/local output) DOUBLE PRECISION 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 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. see Further Details. π¦IA(global input) INTEGER β the row index in the global arrayAindicating the first row ofsub( A ). πJA(global input) INTEGER β the column index in the global arrayAindicating the first column ofsub( A ). πDESCA(global and local input) INTEGER array of dimensionDLEN_. the array descriptor for the distributed matrixA. she's the map, the matrix is the territory πΊοΈTAU(local output) DOUBLE PRECISION array, dimensionLOCc(JA+N-2). the scalar factors of the elementary reflectors (see Further Details).TAUis tied to the distributed matrixA. they're bonded, fr fr π«ΆT(local output) DOUBLE PRECISION array, dimension(NB_A,NB_A). the upper triangular matrixT. βY(local output) DOUBLE PRECISION pointer 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 listen:LLD_Y >= LOCr(IA+N-1). no cap. π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) INTEGER array of dimensionDLEN_. the array descriptor for the distributed matrixY. πΊοΈWORK(local workspace) DOUBLE PRECISION array, dimension(NB). just the little scratchpad. do not perceive her π
π§ FURTHER DETAILS π§
okay this is the part where it gets good. 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 real scalar, and v is a real 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). yes, all of that. every index. she's precise like that π
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').
and because visuals eat every time, here's what the contents of A(ia:ia+n-1,ja:ja+n-k) look like on exit, illustrated 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). π
ok real talk bestie, this is a distributed-memory auxiliary routine β the descriptorsDESCAandDESCYand the index argumentsIA,JA,IY,JYare not decoration, they're the whole point. get them wrong and nothing means anything. π
that's the page!! go forth and reduce some columns, you absolute icon π
this has been PDLAHRD from LAPACK version 1.5, dated 12 May 1997 β yes she's older than you and she's still slaying, we love a timeless queen πβ¨
π¦ 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