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