PSLAHRD(l)
π PSLAHRD β the LAPACK auxiliary routine (version 1.5) π
okay bestie, sit down, hydrate, because we're about to get into a parallel LAPACK auxiliary routine and honestly? it's giving main character energy.
β¨ NAME β¨
PSLAHRD β reduce 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 π
πΈ SYNOPSIS πΈ
SUBROUTINE PSLAHRD( 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( * )
REAL A( * ), T( * ), TAU( * ), WORK( * ), Y( * )
π¦ PURPOSE π¦
so what does she do. PSLAHRD 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. lowkey iconic. 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.
she's an auxiliary routine, meaning she's called by PSGEHRD β she's the supportive bestie behind the scenes π«Ά. and 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 ). no cap,N >= 0.K(global input)INTEGERβ the offset for the reduction. elements below the k-th subdiagonal in the firstNBcolumns are reduced to zero. that's the whole gig fr fr.NB(global input)INTEGERβ the number of columns to be reduced. literally the count.A(local input/local output)REALpointer into the local memory to an array of dimension(LLD_A, LOCc(JA+N-K)). on entry, this array contains the 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, 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 below, bestie π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)INTEGERarray of dimensionDLEN_. the array descriptor for the distributed matrixA. she holds the map, okay πΊοΈTAU(local output)REALarray, dimensionLOCc(JA+N-2). the scalar factors of the elementary reflectors (see Further Details).TAUis tied to the distributed matrixA.T(local output)REALarray, dimension(NB_A,NB_A). the upper triangular matrixT. queen of the upper triangle πY(local output)REALpointer 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. also:LLD_Y >= LOCr(IA+N-1). don't skip that condition, she's not decorative π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.WORK(local workspace)REALarray, dimension(NB). the workspace. she works soYcan serve π
π 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 real scalar, and v is a real 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). (yes, note that it's ja+i-1, not ja+i. we said what we said β¨)
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:
adenotes an element of the original matrixA(ia:ia+n-1,ja:ja+n-k)hdenotes a modified element of the upper Hessenberg matrixHvidenotes an element of the vector definingH(i)
π«Ά okay so that's the whole page, no skips, no skimming, every single detail accounted for. she ate and left no crumbs.
that's it bestie!! ily, go call your routine responsibly π
this was PSLAHRD from LAPACK version 1.5, dated 12 May 1997 β yeah she's an old queen but she still slays β¨ππ
π¦ 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