p?orm2r/p?unm2r
p?orm2r/p?unm2r
Multiplies a general matrix by the orthogonal/unitary matrix from a QR factorization determined by
p?geqrf
(unblocked algorithm).Syntax
void
psorm2r
(
char
*side
,
char
*trans
,
MKL_INT
*m
,
MKL_INT
*n
,
MKL_INT
*k
,
float
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
float
*tau
,
float
*c
,
MKL_INT
*ic
,
MKL_INT
*jc
,
MKL_INT
*descc
,
float
*work
,
MKL_INT
*lwork
,
MKL_INT
*info
);
void
pdorm2r
(
char
*side
,
char
*trans
,
MKL_INT
*m
,
MKL_INT
*n
,
MKL_INT
*k
,
double
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
double
*tau
,
double
*c
,
MKL_INT
*ic
,
MKL_INT
*jc
,
MKL_INT
*descc
,
double
*work
,
MKL_INT
*lwork
,
MKL_INT
*info
);
void
pcunm2r
(
char
*side
,
char
*trans
,
MKL_INT
*m
,
MKL_INT
*n
,
MKL_INT
*k
,
MKL_Complex8
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
MKL_Complex8
*tau
,
MKL_Complex8
*c
,
MKL_INT
*ic
,
MKL_INT
*jc
,
MKL_INT
*descc
,
MKL_Complex8
*work
,
MKL_INT
*lwork
,
MKL_INT
*info
);
void
pzunm2r
(
char
*side
,
char
*trans
,
MKL_INT
*m
,
MKL_INT
*n
,
MKL_INT
*k
,
MKL_Complex16
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
MKL_Complex16
*tau
,
MKL_Complex16
*c
,
MKL_INT
*ic
,
MKL_INT
*jc
,
MKL_INT
*descc
,
MKL_Complex16
*work
,
MKL_INT
*lwork
,
MKL_INT
*info
);
Include Files
- mkl_scalapack.h
Description
The
p?orm2r/p?unm2r
function
overwrites the general real/complex m
-by-n
distributed matrix sub (
withC
)=C
(ic
:ic
+m
-1, jc
:jc
+n
-1)Q
*sub(C
) if side
= 'L'
trans
= 'N'
Q
T
C
) / Q
H
C
)side
= 'L'
trans
= 'T'
trans
= 'C'
sub(' and , or
C
)*Q
if side
= 'R
trans
= 'N'
sub( / sub( if and (for real flavors) or (for complex flavors).
C
)*Q
T
C
)*Q
H
side
= 'R'
trans
= 'T'
trans
= 'C'
where
Q
is a real orthogonal or complex unitary matrix defined as the product of k
elementary reflectorsQ = H(
as returned by k
)*...*H
(2)*H
(1)p?geqrf
. Q
is of order m
if side
= 'L'
n
if side
= 'R'
Input Parameters
- side
- (global)='L': applyQorQfor real flavors (TQfor complex flavors) from the left,H='R': applyQorQfor real flavors (TQfor complex flavors) from the right.H
- trans
- (global)='N': applyQ(no transpose)='T': applyQ(transpose, for real flavors)T='C': applyQ(conjugate transpose, for complex flavors)H
- m
- (global)The number of rows in the distributed matrix sub(C)..m≥0
- n
- (global)The number of columns in the distributed matrix sub(C)..n≥0
- k
- (global)The number of elementary reflectors whose product defines the matrixQ.If,side='L';m≥k≥0if,side='R'.n≥k≥0
- a
- (local)Pointer into the local memory to an array of size.lld_a*LOCc(ja+k-1)On entry, thej-th columnof the matrix stored inmust contain the vector that defines the elementary reflectoraH(j),ja≤j≤ja+k-1, as returned byp?geqrfin thekcolumns of its distributed matrix argumentA(. The argumentia:*,ja:ja+k-1)A(is modified by theia:*,ja:ja+k-1)functionbut restored on exit.If,side='L'lld_a,≥max(1,LOCr(ia+m-1))if,side='R'lld_a.≥max(1,LOCr(ia+n-1))
- ia
- (global)The row index in the global matrixAindicating the first row of sub(A).
- ja
- (global)The column index in the global matrixAindicating the first column of sub(A).
- desca
- (global and local) array of sizedlen_. The array descriptor for the distributed matrixA.
- tau
- (local)Array of size.LOCc(ja+k-1)tau[contains the scalar factor of the elementary reflectorj]H(, as returned byj+1),j= 0, 1, ...,-1LOCc(ja+k-1)p?geqrf. This array is tied to the distributed matrixA.
- c
- (local)Pointer into the local memory to an array of size.lld_c*LOCc(jc+n-1)On entry, the local pieces of the distributed matrix sub (C).
- ic
- (global)The row index in the global matrixCindicating the first row of sub(C).
- jc
- (global)The column index in the global matrixCindicating the first column of sub(C).
- descc
- (global and local) array of sizedlen_.The array descriptor for the distributed matrixC.
- work
- (local)Workspace array of sizelwork.
- lwork
- (local or global)The size of the arraywork.lworkis local input and must be at leastif,side='L',lwork≥mpc0 + max(1,nqc0)if,side='R',lwork≥nqc0 + max(max(1,mpc0),numroc(numroc(n+icoffc,nb_a, 0, 0,npcol),nb_a, 0, 0,lcmq))where,lcmq=lcm/npcol,lcm=iclm(nprow,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),Mqc0=numroc(m+icoffc,nb_c,mycol,icrow,nprow),Npc0=numroc(n+iroffc,mb_c,myrow,iccol,npcol)ilcm,indxg2pandnumrocare ScaLAPACK tool functions;myrow,mycol,nprow, andnpcolcan be determined by calling thefunctionblacs_gridinfo.If, thenlwork= -1lworkis global input and a workspace query is assumed; thefunctiononly calculates the minimum and optimal size for all work arrays. Each of these values is returned in the first entry of the corresponding work array, and no error message is issued bypxerbla.
Output Parameters
- c
- On exit,cis overwritten byQ*sub(C), orQ*sub(TC)/Q*sub(HC), or sub(C)*Q, or sub(C)*Q/ sub(TC)*QH
- work
- On exit,returns the minimal and optimalwork[0]lwork.
- info
- (local)= 0: successful exit< 0: if thei-th argument is an array and thej-th entry, indexedhad an illegal value,j-1,theninfo= - (i*100 +j),if thei-th argument is a scalar and had an illegal value,theninfo= -i.
The distributed submatrices must verify some alignment properties, namely the following expressions should be true:
A
(
and ia
:*, ja
:*)C
(
, ic
:ic
+m
-1jc
:jc
+n
-1)If ,
side
= 'L'
(
.mb_a
== mb_c
) && (iroffa
== iroffc
) && (iarow
== icrow
)If ,
side
= 'R'
(
.mb_a
== nb_c
) && (iroffa
== iroffc
)