PZLARZ(l)
π PZLARZ β okay bestie, it's giving distributed reflectors π
so like, this page is PZLARZ(l) β¨ β a LAPACK auxiliary routine, version 1.5 β and it is lowkey a lot, but we're gonna get through it together, fr fr. Grab a strawberry π, hydrate, and let's lock in.
β¨ NAME β¨
PZLARZ applies a complex elementary reflector Q to a complex M-by-N distributed matrix sub( C ) = C(IC:IC+M-1,JC:JC+N-1), from either the left or the right. that's the whole vibe. π¦
π SYNOPSIS π
SUBROUTINE PZLARZ( SIDE, M, N, L, V, IV, JV, DESCV, INCV, TAU, C, IC,
JC, DESCC, WORK )
CHARACTER SIDE
INTEGER IC, INCV, IV, JC, JV, L, M, N
INTEGER DESCC( * ), DESCV( * )
COMPLEX*16 C( * ), TAU( * ), V( * ), WORK( * )
πΈ PURPOSE πΈ
PZLARZ applies a complex elementary reflector Q to a complex M-by-N distributed matrix sub( C ) = C(IC:IC+M-1,JC:JC+N-1), from either the left or the right. Q is represented in the form
Q = I - tau * v * v'
where tau is a complex scalar and v is a complex vector. π
If tau = 0, then Q is taken to be the unit matrix. (iconic, effortless, does nothing, we love her.)
Q is a product of k elementary reflectors as returned by PZTZRZF.
π Notes π
Every global data object is described by an associated description vector. This vector stores the information required to establish the mapping between an object element and its corresponding process and memory location.
Let A be a generic term for any 2D block cyclicly distributed array. Such a global array has an associated description vector DESCA. In the following comments, the character _ should be read as "of the global array".
DTYPE_A(global) βDESCA( DTYPE_ )β the descriptor type. In this case,DTYPE_A = 1.CTXT_A(global) βDESCA( CTXT_ )β the BLACS context handle, indicating the BLACS process grid A is distributed over. The context itself is global, but the handle (the integer value) may vary.M_A(global) βDESCA( M_ )β the number of rows in the global array A.N_A(global) βDESCA( N_ )β the number of columns in the global array A.MB_A(global) βDESCA( MB_ )β the blocking factor used to distribute the rows of the array.NB_A(global) βDESCA( NB_ )β the blocking factor used to distribute the columns of the array.RSRC_A(global) βDESCA( RSRC_ )β the process row over which the first row of the array A is distributed.CSRC_A(global) βDESCA( CSRC_ )β the process column over which the first column of the array A is distributed.LLD_A(local) βDESCA( LLD_ )β the leading dimension of the local array.LLD_A >= MAX(1,LOCr(M_A)).
Let K be the number of rows or columns of a distributed matrix, and assume that its process grid has dimension p x q.
LOCr( K ) denotes the number of elements of K that a process would receive if K were distributed over the p processes of its process column.
Similarly, LOCc( K ) denotes the number of elements of K that a process would receive if K were distributed over the q processes of its process row.
The values of LOCr() and LOCc() may be determined via a call to the ScaLAPACK tool function, NUMROC:
LOCr( M ) = NUMROC( M, MB_A, MYROW, RSRC_A, NPROW ),
LOCc( N ) = NUMROC( N, NB_A, MYCOL, CSRC_A, NPCOL ).
An upper bound for these quantities may be computed by:
LOCr( M ) <= ceil( ceil(M/MB_A)/NPROW )*MB_A
LOCc( N ) <= ceil( ceil(N/NB_A)/NPCOL )*NB_A
Because vectors may be viewed as a subclass of matrices, a distributed vector is considered to be a distributed matrix. π«Ά (yes bestie, vectors are just matrices with main character energy.)
π§ Restrictions π§
IfSIDE = 'Left'andINCV = 1, then the row process having the first entryV(IV,JV)must also ownC(IC+M-L,JC:JC+N-1). Moreover,MOD(IV-1,MB_V)must be equal toMOD(IC+N-L-1,MB_C), ifINCV=M_V, only the last equality must be satisfied.
IfSIDE = 'Right'andINCV = M_Vthen the column process having the first entryV(IV,JV)must also ownC(IC:IC+M-1,JC+N-L)andMOD(JV-1,NB_V)must be equal toMOD(JC+N-L-1,NB_C), ifINCV = 1only the last equality must be satisfied.
π ARGUMENTS π
SIDEβ (global input)CHARACTER= 'L': formQ * sub( C ),= 'R': formsub( C ) * Q.
Mβ (global input)INTEGERThe number of rows to be operated on i.e the number of rows of the distributed submatrixsub( C ).M >= 0.Nβ (global input)INTEGERThe number of columns to be operated on i.e the number of columns of the distributed submatrixsub( C ).N >= 0.Lβ (global input)INTEGERThe columns of the distributed submatrixsub( A )containing the meaningful part of the Householder reflectors. IfSIDE = 'L',M >= L >= 0, ifSIDE = 'R',N >= L >= 0.Vβ (local input)COMPLEX*16pointer into the local memory to an array of dimension(LLD_V,*)containing the local pieces of the distributed vectors V representing the Householder transformation Q,V(IV:IV+L-1,JV)ifSIDE = 'L'andINCV = 1,V(IV,JV:JV+L-1)ifSIDE = 'L'andINCV = M_V,V(IV:IV+L-1,JV)ifSIDE = 'R'andINCV = 1,V(IV,JV:JV+L-1)ifSIDE = 'R'andINCV = M_V,
The vector v in the representation of Q. V is not used if TAU = 0. π«₯
IVβ (global input)INTEGERThe row index in the global array V indicating the first row ofsub( V ).JVβ (global input)INTEGERThe column index in the global array V indicating the first column ofsub( V ).DESCVβ (global and local input)INTEGERarray of dimensionDLEN_. The array descriptor for the distributed matrix V.INCVβ (global input)INTEGERThe global increment for the elements of V. Only two values ofINCVare supported in this version, namely1andM_V.INCVmust not be zero.TAUβ (local input)COMPLEX*16, array, dimensionLOCc(JV)ifINCV = 1, andLOCr(IV)otherwise. This array contains the Householder scalars related to the Householder vectors. TAU is tied to the distributed matrix V. πCβ (local input/local output)COMPLEX*16pointer into the local memory to an array of dimension(LLD_C, LOCc(JC+N-1) ), containing the local pieces ofsub( C ). On exit,sub( C )is overwritten by theQ * sub( C )ifSIDE = 'L', orsub( C ) * QifSIDE = 'R'.ICβ (global input)INTEGERThe row index in the global array C indicating the first row ofsub( C ).JCβ (global input)INTEGERThe column index in the global array C indicating the first column ofsub( C ).DESCCβ (global and local input)INTEGERarray of dimensionDLEN_. The array descriptor for the distributed matrix C.WORKβ (local workspace)COMPLEX*16array, dimension(LWORK)
okay so this one is a whole choose-your-own-adventure, no cap. brace yourself π« :
If INCV = 1,
if SIDE = 'L',
if IVCOL = ICCOL,
LWORK >= NqC0
else
LWORK >= MpC0 + MAX( 1, NqC0 )
end if
else if SIDE = 'R',
LWORK >= NqC0 + MAX( MAX( 1, MpC0 ), NUMROC( NUMROC(
N+ICOFFC,NB_V,0,0,NPCOL ),NB_V,0,0,LCMQ ) )
end if
else if INCV = M_V,
if SIDE = 'L',
LWORK >= MpC0 + MAX( MAX( 1, NqC0 ), NUMROC( NUMROC(
M+IROFFC,MB_V,0,0,NPROW ),MB_V,0,0,LCMP ) )
else if SIDE = 'R',
if IVROW = ICROW,
LWORK >= MpC0
else
LWORK >= NqC0 + MAX( 1, MpC0 )
end if
end if
end if
where LCM is the least common multiple of NPROW and NPCOL and
LCM = ILCM( NPROW, NPCOL ), LCMP = LCM / NPROW, LCMQ = LCM / NPCOL,
IROFFC = MOD( IC-1, MB_C ), ICOFFC = MOD( JC-1, NB_C ), ICROW =
INDXG2P( IC, MB_C, MYROW, RSRC_C, NPROW ), ICCOL = INDXG2P( JC,
NB_C, MYCOL, CSRC_C, NPCOL ), MpC0 = NUMROC( M+IROFFC, MB_C,
MYROW, ICROW, NPROW ), NqC0 = NUMROC( N+ICOFFC, NB_C, MYCOL,
ICCOL, NPCOL ),
ILCM, INDXG2P and NUMROC are ScaLAPACK tool functions; MYROW, MYCOL, NPROW and NPCOL can be determined by calling the subroutine BLACS_GRIDINFO. β
π Alignment requirements π
The distributed submatrices V(IV:*, JV:*) and C(IC:IC+M-1,JC:JC+N-1) must verify some alignment properties, namely the following expressions should be true:
MB_V = NB_V,
If INCV = 1,
If SIDE = 'Left', ( MB_V.EQ.MB_C .AND. IROFFV.EQ.IROFFC .AND.
IVROW.EQ.ICROW )
If SIDE = 'Right', ( MB_V.EQ.NB_A .AND. MB_V.EQ.NB_C .AND.
IROFFV.EQ.ICOFFC )
else if INCV = M_V,
If SIDE = 'Left', ( MB_V.EQ.NB_V .AND. MB_V.EQ.MB_C .AND.
ICOFFV.EQ.IROFFC )
If SIDE = 'Right', ( NB_V.EQ.NB_C .AND. ICOFFV.EQ.ICOFFC .AND.
IVCOL.EQ.ICCOL )
end if
and that's the whole page bestie, you ate that π β¨ go forth and distribute your reflectors responsibly.
with love from LAPACK version 1.5, dated 12 May 1997 π (yes she's an elder icon and we stan her, periodt) ππ
π¦ 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