p?ggrqf
p?ggrqf
Computes the generalized RQ factorization.
Syntax
void
psggrqf
(
MKL_INT
*m
,
MKL_INT
*p
,
MKL_INT
*n
,
float
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
float
*taua
,
float
*b
,
MKL_INT
*ib
,
MKL_INT
*jb
,
MKL_INT
*descb
,
float
*taub
,
float
*work
,
MKL_INT
*lwork
,
MKL_INT
*info
);
void
pdggrqf
(
MKL_INT
*m
,
MKL_INT
*p
,
MKL_INT
*n
,
double
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
double
*taua
,
double
*b
,
MKL_INT
*ib
,
MKL_INT
*jb
,
MKL_INT
*descb
,
double
*taub
,
double
*work
,
MKL_INT
*lwork
,
MKL_INT
*info
);
void
pcggrqf
(
MKL_INT
*m
,
MKL_INT
*p
,
MKL_INT
*n
,
MKL_Complex8
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
MKL_Complex8
*taua
,
MKL_Complex8
*b
,
MKL_INT
*ib
,
MKL_INT
*jb
,
MKL_INT
*descb
,
MKL_Complex8
*taub
,
MKL_Complex8
*work
,
MKL_INT
*lwork
,
MKL_INT
*info
);
void
pzggrqf
(
MKL_INT
*m
,
MKL_INT
*p
,
MKL_INT
*n
,
MKL_Complex16
*a
,
MKL_INT
*ia
,
MKL_INT
*ja
,
MKL_INT
*desca
,
MKL_Complex16
*taua
,
MKL_Complex16
*b
,
MKL_INT
*ib
,
MKL_INT
*jb
,
MKL_INT
*descb
,
MKL_Complex16
*taub
,
MKL_Complex16
*work
,
MKL_INT
*lwork
,
MKL_INT
*info
);
Include Files
- mkl_scalapack.h
Description
The
p?ggrqf
function
forms the generalized RQ
factorization of an m
-by-n
matrix sub(A
) = A
(ia
:ia
+m
-1, ja
:ja
+n
-1) and a p
-by-n
matrix sub(B
) = B
(ib
:ib
+p
-1, jb
:jb
+n
-1): sub(
A
) = R
*Q
, sub(B
) = Z
*T
*Q
, where
Q
is an n
-by-n
orthogonal/unitary matrix, Z
is a p
-by-p
orthogonal/unitary matrix, and R
and T
assume one of the forms:
or

where
R
11
or R
21
is upper triangular, and
or

where
T
11
is upper triangular.In particular, if sub(
B
) is square and nonsingular, the GRQ
factorization of sub(A
) and sub(B
) implicitly gives the RQ
factorization of sub (A
)*inv(sub(B
)):sub(
A
)*inv(sub(B
))= (R
*inv(T
))*Z'
where inv(sub(
B
)) denotes the inverse of the matrix sub(B
), and Z'
denotes the transpose (conjugate transpose) of matrix Z
.Input Parameters
- m
- (global) The number of rows in the distributed matrices sub (A)(.m≥0)
- p
- The number of rows in the distributed matrix sub(B)(.p≥0)
- n
- (global) The number of columns in the distributed matrices sub(A) and sub(B)(.n≥0)
- a
- (local)Pointer into the local memory to an array of size. Contains the local pieces of thelld_a*LOCc(ja+n-1)m-by-ndistributed matrix sub(A) to be factored.
- ia,ja
- (global) The row and column indices in the global matrixAindicating the first row and the first column of the submatrixA, respectively.
- desca
- (global and local) array of sizedlen_. The array descriptor for the distributed matrixA.
- b
- (local)Pointer into the local memory to an array of size.lld_b*LOCc(jb+n-1)Contains the local pieces of thep-by-nmatrix sub(B) to be factored.
- ib,jb
- (global) The row and column indices in the global matrixBindicating the first row and the first column of the submatrixB, respectively.
- descb
- (global and local) array of sizedlen_. The array descriptor for the distributed matrixB.
- work
- (local)Workspace array of size oflwork.
- lwork
- (local or global)Size ofwork, must be at least, wherelwork≥max(mb_a*(mpa0+nqa0+mb_a),max((mb_a*(mb_a-1))/2, (ppb0+nqb0)*mb_a) +mb_a*mb_a,nb_b*(ppb0+nqb0+nb_b)),iroffa=mod(ia-1,mb_A),icoffa=mod(ja-1,nb_a),iarow=indxg2p(ia,mb_a,MYROW,rsrc_a,NPROW),iacol= indxg2p(ja,nb_a,MYCOL,csrc_a,NPCOL),mpa0=numroc(m+iroffa,mb_a,MYROW,iarow,NPROW)nqa0=numroc(m+icoffa,nb_a,MYCOL,iacol,NPCOL),iroffb=mod(ib-1,mb_b),icoffb=mod(jb-1,nb_b),ibrow=indxg2p(ib,mb_b,MYROW,rsrc_b,NPROW),ibcol=indxg2p(jb,nb_b,MYCOL,csrc_b,NPCOL),ppb0=numroc(p+iroffb,mb_b,MYROW,ibrow,NPROW)nqb0=numroc(n+icoffb,nb_b,MYCOL,ibcol,NPCOL)mod(is the integer remainder ofx,y).x/yandnumroc,indxg2pare ScaLAPACK tool functions;MYROW,MYCOL,NPROWandNPCOLcan 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 by pxerbla.
Output Parameters
- a
- On exit, ifm≤n, the upper triangle ofA(ia:ia+m-1,ja+n-m:ja+n-1) contains them-by-mupper triangular matrixR; if, the elements on and above the (m≥nm-n)-th subdiagonal contain them-by-nupper trapezoidal matrixR; the remaining elements, with the arraytaua, represent the orthogonal/unitary matrixQas a product of min(n,m) elementary reflectors(see.Application Notesbelow)
- taua,taub
- (local)Arrays of sizeandLOCr(ia+m-1)fortauaforLOCc(jb+min(p,n)-1)taub.The arraytauacontains the scalar factors of the elementary reflectors which represent the orthogonal/unitary matrixQ.tauais tied to the distributed matrixA.(SeeApplication Notesbelow).The arraytaubcontains the scalar factors of the elementary reflectors which represent the orthogonal/unitary matrixZ.taubis tied to the distributed matrixB. (SeeApplication Notesbelow).
- work[0]
- On exitcontains the minimum value ofwork[0]lworkrequired for optimum performance.
- info
- (global)= 0: the execution is successful.< 0: if thei-th argument is an array and thej-th entry, indexedhad an illegal value, thenj- 1,info= -(i*100+j); if thei-th argument is a scalar and had an illegal value, theninfo=-i.
Application Notes
The matrix
Q
is represented as a product of elementary reflectors Q
= H
(ia
)*H
(ia
+1)*...*H
(ia
+k
-1),where
k
= min(
.m
,n
)Each
H
(i
) has the form H
(i
) = i
- taua
*v
*v'
where
taua
is a real/complex scalar, and v
is a real/complex vector with v
(n
-k
+i
+1:n
) = 0 and v
(n
-k
+i
) = 1; v(1:n
-k
+i
-1) is stored on exit in A
(ia
+m
-k
+i
-1, ja
:ja
+n
-k
+i
-2), and taua
in taua
[
. To form ia
+m
-k
+i
-2]Q
explicitly, use ScaLAPACK function
p?orgrq
/p?ungrq
. To use Q
to update another matrix, use ScaLAPACK function
p?ormrq
/p?unmrq
.The matrix
Z
is represented as a product of elementary reflectorsZ
= H
(jb
)*H
(jb
+1)*...*H
(jb
+k
-1), where k
= min(
.p
,n
)Each
H
(i
) has the form H
(i
) = i
- taub
*v
*v'
where
taub
is a real/complex scalar, and v
is a real/complex vector with v
(1:i
-1) = 0 and v
(i
)= 1; v
(i
+1:p
) is stored on exit in B
(ib
+i
:ib
+p
-1,jb
+i
-1), and taub
in taub
[
. To form jb
+i
-2]Z
explicitly, use ScaLAPACK function
p?orgqr
/p?ungqr
. To use Z
to update another matrix, use ScaLAPACK function
p?ormqr
/p?unmqr