Developer Reference

  • 0.9
  • 09/09/2020
  • Public Content
Contents

p?ggqrf

Computes the generalized QR factorization.

Syntax

void
psggqrf
(
MKL_INT
*n
,
MKL_INT
*m
,
MKL_INT
*p
,
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
pdggqrf
(
MKL_INT
*n
,
MKL_INT
*m
,
MKL_INT
*p
,
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
pcggqrf
(
MKL_INT
*n
,
MKL_INT
*m
,
MKL_INT
*p
,
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
pzggqrf
(
MKL_INT
*n
,
MKL_INT
*m
,
MKL_INT
*p
,
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?ggqrf
function
forms the generalized
Q
R
factorization of an
n
-by-
m
matrix
sub(
A
) =
A
(
ia
:
ia
+
n
-1,
ja
:
ja
+
m
-1)
and an
n
-by-
p
matrix
sub(
B
) =
B
(
ib
:
ib
+
n
-1,
jb
:
jb
+
p
-1):
as
sub(
A) =
Q
*
R
, sub(
B
) =
Q
*
T
*Z
,
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:
If
n
m
Equation
or if
n
<
m
Equation
where
R
11
is upper triangular, and
Equation
Equation
where
T
12
or
T
21
is an upper triangular matrix.
In particular, if sub(
B
) is square and nonsingular, the
GQR
factorization of sub(
A
) and sub(
B
) implicitly gives the
Q
R
factorization of inv (sub(
B
))* sub (
A
):
inv(sub(
B
))*sub(
A
) =
Z
H
*(inv(
T)
*
R
)
Input Parameters
n
(global) The number of rows in the distributed matrices sub (
A
) and sub(
B
)
(
n
0)
.
m
(global) The number of columns in the distributed matrix sub(
A
)
(
m
0)
.
p
The number of columns in the distributed matrix sub(
B
)
(
p
0)
.
a
(local)
Pointer into the local memory to an array of size
lld_a
*
LOCc
(
ja
+
m
-1)
. Contains the local pieces of the
n
-by-
m
matrix sub(
A
) to be factored.
ia
,
ja
(global) The row and column indices in the global matrix
A
indicating the first row and the first column of the submatrix
A
, respectively.
desca
(global and local) array of size
dlen_
. The array descriptor for the distributed matrix
A
.
b
(local)
Pointer into the local memory to an array of size
lld_b
*
LOCc
(
jb
+
p
-1)
. Contains the local pieces of the
n
-by-
p
matrix sub(
B
) to be factored.
ib
,
jb
(global) The row and column indices in the global matrix
B
indicating the first row and the first column of the submatrix
B
, respectively.
descb
(global and local) array of size
dlen_
. The array descriptor for the distributed matrix B.
work
(local)
Workspace array of size of
lwork
.
lwork
(local or global) Sze of
work
, must be at least
lwork
max
(
nb_a
*(
npa
0+
mqa
0+
nb_a
),
max
((
nb_a
*(
nb_a
-1))/2, (
pqb
0+
npb
0)*
nb_a
)+
nb_a
*
nb_a
,
mb_b
*(
npb
0+
pqb
0+
mb_b
))
,
where
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
)
,
npa0
=
numroc
(
n
+
iroffa
,
mb_a
,
MYROW
,
iarow
,
NPROW
)
,
mqa0
=
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
)
,
npb0
=
numroc
(
n
+
iroffa
,
mb_b
,
MYROW
,
Ibrow
,
NPROW
)
,
pqb0
=
numroc
(
m
+
icoffb
,
nb_b
,
MYCOL
,
ibcol
,
NPCOL
)
mod(
x
,
y
)
is the integer remainder of
x
/
y
.
and
numroc
,
indxg2p
are ScaLAPACK tool functions;
MYROW
,
MYCOL
,
NPROW
and
NPCOL
can be determined by calling the
function
blacs_gridinfo
.
If
lwork
= -1
, then
lwork
is global input and a workspace query is assumed; the
function
only 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, the elements on and above the diagonal of sub (
A
) contain the min(
n
,
m
)-by-
m
upper trapezoidal matrix
R
(
R
is upper triangular if
n
m
); the elements below the diagonal, with the array
taua
, represent the orthogonal/unitary matrix
Q
as a product of min(
n
,
m
) elementary reflectors. (See Application Notes below).
taua
,
taub
(local)
Arrays of size
LOCc
(
ja
+
min
(
n
,
m
)-1)
for
taua
and
LOCr
(
ib
+
n
-1)
for
taub
.
The array
taua
contains the scalar factors of the elementary reflectors which represent the orthogonal/unitary matrix
Q
.
taua
is tied to the distributed matrix
A
. (See Application Notes below).
The array
taub
contains the scalar factors of the elementary reflectors which represent the orthogonal/unitary matrix
Z
.
taub
is tied to the distributed matrix
B
.
(See Application Notes below).
work
[0]
On exit
work
[0]
contains the minimum value of
lwork
required for optimum performance.
info
(global)
= 0
: the execution is successful.
< 0
: if the
i
-th argument is an array and the
j-
th entry
, indexed
j
- 1,
had an illegal value, then
info
= -(
i
*100+
j
); if the
i-
th argument is a scalar and had an illegal value, then
info
=
-i
.
Application Notes
The matrix
Q
is represented as a product of elementary reflectors
Q
=
H
(
ja
)*
H
(
ja
+1)*...*
H
(
ja
+
k
-1),
where
k
= min(
n
,
m
)
.
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
(1:
i
-1) = 0 and
v
(
i
) = 1; v(
i
+1:
n
) is stored on exit in
A
(
ia
+
i
:
ia
+
n
-1,
ja
+
i
-1)
, and
taua
in
taua
[
ja
+
i
-2]
.To form
Q
explicitly, use ScaLAPACK
function
p?orgqr
/
p?ungqr
. To use
Q
to update another matrix, use ScaLAPACK
function
p?ormqr
/
p?unmqr
.
The matrix
Z
is represented as a product of elementary reflectors
Z
=
H
(
ib
)*
H
(
ib
+1)*...*
H
(
ib
+
k
-1), where
k
= min(
n
,
p
)
.
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
(
p
-
k
+
i
+1:
p
) = 0 and
v
(
p
-
k
+
i
) = 1;
v
(1:
p
-
k
+
i
-1) is stored on exit in
B
(
ib
+
n
-
k
+
i
-1,
jb
:
jb
+
p
-
k
+
i
-2), and
taub
in
taub
[
ib
+
n
-
k
+
i
-2]
. To form
Z
explicitly, use ScaLAPACK