1CGGQRF(1) LAPACK routine (version 3.2) CGGQRF(1)
2
3
4
6 CGGQRF - computes a generalized QR factorization of an N-by-M matrix A
7 and an N-by-P matrix B
8
10 SUBROUTINE CGGQRF( N, M, P, A, LDA, TAUA, B, LDB, TAUB, WORK, LWORK,
11 INFO )
12
13 INTEGER INFO, LDA, LDB, LWORK, M, N, P
14
15 COMPLEX A( LDA, * ), B( LDB, * ), TAUA( * ), TAUB( * ),
16 WORK( * )
17
19 CGGQRF computes a generalized QR factorization of an N-by-M matrix A
20 and an N-by-P matrix B:
21 A = Q*R, B = Q*T*Z,
22 where Q is an N-by-N unitary matrix, Z is a P-by-P unitary matrix, and
23 R and T assume one of the forms:
24 if N >= M, R = ( R11 ) M , or if N < M, R = ( R11 R12 ) N,
25 ( 0 ) N-M N M-N
26 M
27 where R11 is upper triangular, and
28 if N <= P, T = ( 0 T12 ) N, or if N > P, T = ( T11 ) N-P,
29 P-N N ( T21 ) P
30 P
31 where T12 or T21 is upper triangular.
32 In particular, if B is square and nonsingular, the GQR factorization of
33 A and B implicitly gives the QR factorization of inv(B)*A:
34 inv(B)*A = Z'*(inv(T)*R)
35 where inv(B) denotes the inverse of the matrix B, and Z' denotes the
36 conjugate transpose of matrix Z.
37
39 N (input) INTEGER
40 The number of rows of the matrices A and B. N >= 0.
41
42 M (input) INTEGER
43 The number of columns of the matrix A. M >= 0.
44
45 P (input) INTEGER
46 The number of columns of the matrix B. P >= 0.
47
48 A (input/output) COMPLEX array, dimension (LDA,M)
49 On entry, the N-by-M matrix A. On exit, the elements on and
50 above the diagonal of the array contain the min(N,M)-by-M upper
51 trapezoidal matrix R (R is upper triangular if N >= M); the
52 elements below the diagonal, with the array TAUA, represent the
53 unitary matrix Q as a product of min(N,M) elementary reflectors
54 (see Further Details).
55
56 LDA (input) INTEGER
57 The leading dimension of the array A. LDA >= max(1,N).
58
59 TAUA (output) COMPLEX array, dimension (min(N,M))
60 The scalar factors of the elementary reflectors which represent
61 the unitary matrix Q (see Further Details). B
62 (input/output) COMPLEX array, dimension (LDB,P) On entry, the
63 N-by-P matrix B. On exit, if N <= P, the upper triangle of the
64 subarray B(1:N,P-N+1:P) contains the N-by-N upper triangular
65 matrix T; if N > P, the elements on and above the (N-P)-th sub‐
66 diagonal contain the N-by-P upper trapezoidal matrix T; the
67 remaining elements, with the array TAUB, represent the unitary
68 matrix Z as a product of elementary reflectors (see Further
69 Details).
70
71 LDB (input) INTEGER
72 The leading dimension of the array B. LDB >= max(1,N).
73
74 TAUB (output) COMPLEX array, dimension (min(N,P))
75 The scalar factors of the elementary reflectors which represent
76 the unitary matrix Z (see Further Details). WORK
77 (workspace/output) COMPLEX array, dimension (MAX(1,LWORK)) On
78 exit, if INFO = 0, WORK(1) returns the optimal LWORK.
79
80 LWORK (input) INTEGER
81 The dimension of the array WORK. LWORK >= max(1,N,M,P). For
82 optimum performance LWORK >= max(N,M,P)*max(NB1,NB2,NB3), where
83 NB1 is the optimal blocksize for the QR factorization of an N-
84 by-M matrix, NB2 is the optimal blocksize for the RQ factoriza‐
85 tion of an N-by-P matrix, and NB3 is the optimal blocksize for
86 a call of CUNMQR. If LWORK = -1, then a workspace query is
87 assumed; the routine only calculates the optimal size of the
88 WORK array, returns this value as the first entry of the WORK
89 array, and no error message related to LWORK is issued by
90 XERBLA.
91
92 INFO (output) INTEGER
93 = 0: successful exit
94 < 0: if INFO = -i, the i-th argument had an illegal value.
95
97 The matrix Q is represented as a product of elementary reflectors
98 Q = H(1) H(2) . . . H(k), where k = min(n,m).
99 Each H(i) has the form
100 H(i) = I - taua * v * v'
101 where taua is a complex scalar, and v is a complex vector with v(1:i-1)
102 = 0 and v(i) = 1; v(i+1:n) is stored on exit in A(i+1:n,i), and taua in
103 TAUA(i).
104 To form Q explicitly, use LAPACK subroutine CUNGQR.
105 To use Q to update another matrix, use LAPACK subroutine CUNMQR. The
106 matrix Z is represented as a product of elementary reflectors
107 Z = H(1) H(2) . . . H(k), where k = min(n,p).
108 Each H(i) has the form
109 H(i) = I - taub * v * v'
110 where taub is a complex scalar, and v is a complex vector with v(p-
111 k+i+1:p) = 0 and v(p-k+i) = 1; v(1:p-k+i-1) is stored on exit in B(n-
112 k+i,1:p-k+i-1), and taub in TAUB(i).
113 To form Z explicitly, use LAPACK subroutine CUNGRQ.
114 To use Z to update another matrix, use LAPACK subroutine CUNMRQ.
115
116
117
118 LAPACK routine (version 3.2) November 2008 CGGQRF(1)