Visible to Intel only — GUID: GUID-03CEF981-FB66-44F6-8AAD-A0DF4E87687B
Visible to Intel only — GUID: GUID-03CEF981-FB66-44F6-8AAD-A0DF4E87687B
?ggqrf
Computes the generalized QR factorization of two matrices.
Syntax
call sggqrf(n, m, p, a, lda, taua, b, ldb, taub, work, lwork, info)
call dggqrf(n, m, p, a, lda, taua, b, ldb, taub, work, lwork, info)
call cggqrf(n, m, p, a, lda, taua, b, ldb, taub, work, lwork, info)
call zggqrf(n, m, p, a, lda, taua, b, ldb, taub, work, lwork, info)
call ggqrf(a, b [,taua] [,taub] [,info])
Include Files
- mkl.fi, lapack.f90
Description
The routine forms the generalized QR factorization of an n-by-m matrix A and an n-by-p matrix B as A = Q*R, 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:
or
where R11 is upper triangular, and
where T12 or T21 is a p-by-p upper triangular matrix.
In particular, if B is square and nonsingular, the GQR factorization of A and B implicitly gives the QR factorization of B-1A as:
B-1*A = ZT*(T-1*R) (for real flavors) or B-1*A = ZH*(T-1*R) (for complex flavors).
Input Parameters
- n
-
INTEGER. The number of rows of the matrices A and B (n≥ 0).
- m
-
INTEGER. The number of columns in A (m≥ 0).
- p
-
INTEGER. The number of columns in B (p≥ 0).
- a, b, work
-
REAL for sggqrf
DOUBLE PRECISION for dggqrf
COMPLEX for cggqrf
DOUBLE COMPLEX for zggqrf.
Arrays: a(lda,*) contains the matrix A.
The second dimension of a must be at least max(1, m).
b(ldb,*) contains the matrix B.
The second dimension of b must be at least max(1, p).
work is a workspace array, its dimension max(1, lwork).
- lda
-
INTEGER. The leading dimension of a; at least max(1, n).
- ldb
-
INTEGER. The leading dimension of b; at least max(1, n).
- lwork
-
INTEGER. The size of the work array; must be at least max(1, n, m, p).
If lwork = -1, then a workspace query is assumed; the routine only calculates the optimal size of the work array, returns this value as the first entry of the work array, and no error message related to lwork is issued by xerbla.
See Application Notes for the suggested value of lwork.
Output Parameters
- a, b
-
Overwritten by the factorization data as follows:
on exit, the elements on and above the diagonal of the array 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 ;
if n≤p, the upper triangle of the subarray b(1:n, p-n+1:p ) contains the n-by-n upper triangular matrix T;
if n > p, the elements on and above the (n-p)th subdiagonal contain the n-by-p upper trapezoidal matrix T; the remaining elements, with the array taub, represent the orthogonal/unitary matrix Z as a product of elementary reflectors.
- taua, taub
-
REAL for sggqrf
DOUBLE PRECISION for dggqrf
COMPLEX for cggqrf
DOUBLE COMPLEX for zggqrf.
Arrays, size at least max (1, min(n, m)) for taua and at least max (1, min(n, p)) for taub. The array taua contains the scalar factors of the elementary reflectors which represent the orthogonal/unitary matrix Q.
The array taub contains the scalar factors of the elementary reflectors which represent the orthogonal/unitary matrix Z.
- work(1)
-
If info = 0, on exit work(1) contains the minimum value of lwork required for optimum performance. Use this lwork for subsequent runs.
- info
-
INTEGER.
If info = 0, the execution is successful.
If info = -i, the i-th parameter had an illegal value.
LAPACK 95 Interface Notes
Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or restorable arguments, see LAPACK 95 Interface Conventions.
Specific details for the routine ggqrf interface are the following:
- a
-
Holds the matrix A of size (n,m).
- b
-
Holds the matrix B of size (n,p).
- taua
-
Holds the vector of length min(n,m).
- taub
-
Holds the vector of length min(n,p).
Application Notes
The matrix Q is represented as a product of elementary reflectors
Q = H(1)H(2)...H(k), where k = min(n,m).
Each H(i) has the form
H(i) = I - τa*v*vT for real flavors, or
H(i) = I - τa*v*vH for complex flavors,
where τa is a real/complex scalar, and v is a real/complex vector with vj = 0 for 1 ≤j≤i - 1, vi = 1.
On exit, fori + 1 ≤j≤n, vj is stored in a(i+1:n, i) and τa is stored in taua(i)
The matrix Z is represented as a product of elementary reflectors
Z = H(1)H(2)...H(k), where k = min(n,p).
Each H(i) has the form
H(i) = I - τb*v*vT for real flavors, or
H(i) = I - τb*v*vH for complex flavors,
where τb is a real/complex scalar, and v is a real/complex vector with vp - k + 1 = 1, vj = 0 for p - k + 1 ≤j≤p - 1, .
On exit, for 1 ≤j≤p - k + i - 1, vj is stored in b(n-k+i, 1:p-k+i-1) and τb is stored in taub(i).
For better performance, try using lwork≥ max(n,m, p)*max(nb1,nb2,nb3), where nb1 is the optimal blocksize for the QR factorization of an n-by-m matrix, nb2 is the optimal blocksize for the RQ factorization of an n-by-p matrix, and nb3 is the optimal blocksize for a call of ormqr/unmqr.
If you are in doubt how much workspace to supply, use a generous value of lwork for the first run or set lwork = -1.
If you choose the first option and set any of admissible lwork sizes, which is no less than the minimal value described, the routine completes the task, though probably not so fast as with a recommended workspace, and provides the recommended workspace in the first element of the corresponding array work on exit. Use this value (work(1)) for subsequent runs.
If you set lwork = -1, the routine returns immediately and provides the recommended workspace in the first element of the corresponding array (work). This operation is called a workspace query.
Note that if you set lwork to less than the minimal required value and not -1, the routine returns immediately with an error exit and does not provide any information on the recommended workspace.