3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZGEMQRT + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zgemqrt.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zgemqrt.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zgemqrt.f">
21 * SUBROUTINE ZGEMQRT( SIDE, TRANS, M, N, K, NB, V, LDV, T, LDT,
22 * C, LDC, WORK, INFO )
24 * .. Scalar Arguments ..
25 * CHARACTER SIDE, TRANS
26 * INTEGER INFO, K, LDV, LDC, M, N, NB, LDT
28 * .. Array Arguments ..
29 * COMPLEX*16 V( LDV, * ), C( LDC, * ), T( LDT, * ), WORK( * )
38 *> ZGEMQRT overwrites the general complex M-by-N matrix C with
40 *> SIDE = 'L' SIDE = 'R'
41 *> TRANS = 'N': Q C C Q
42 *> TRANS = 'C': Q**H C C Q**H
44 *> where Q is a complex orthogonal matrix defined as the product of K
45 *> elementary reflectors:
47 *> Q = H(1) H(2) . . . H(K) = I - V T V**H
49 *> generated using the compact WY representation as returned by ZGEQRT.
51 *> Q is of order M if SIDE = 'L' and of order N if SIDE = 'R'.
59 *> SIDE is CHARACTER*1
60 *> = 'L': apply Q or Q**H from the Left;
61 *> = 'R': apply Q or Q**H from the Right.
66 *> TRANS is CHARACTER*1
67 *> = 'N': No transpose, apply Q;
68 *> = 'C': Transpose, apply Q**H.
74 *> The number of rows of the matrix C. M >= 0.
80 *> The number of columns of the matrix C. N >= 0.
86 *> The number of elementary reflectors whose product defines
88 *> If SIDE = 'L', M >= K >= 0;
89 *> if SIDE = 'R', N >= K >= 0.
95 *> The block size used for the storage of T. K >= NB >= 1.
96 *> This must be the same value of NB used to generate T
102 *> V is COMPLEX*16 array, dimension (LDV,K)
103 *> The i-th column must contain the vector which defines the
104 *> elementary reflector H(i), for i = 1,2,...,k, as returned by
105 *> CGEQRT in the first K columns of its array argument A.
111 *> The leading dimension of the array V.
112 *> If SIDE = 'L', LDA >= max(1,M);
113 *> if SIDE = 'R', LDA >= max(1,N).
118 *> T is COMPLEX*16 array, dimension (LDT,K)
119 *> The upper triangular factors of the block reflectors
120 *> as returned by CGEQRT, stored as a NB-by-N matrix.
126 *> The leading dimension of the array T. LDT >= NB.
131 *> C is COMPLEX*16 array, dimension (LDC,N)
132 *> On entry, the M-by-N matrix C.
133 *> On exit, C is overwritten by Q C, Q**H C, C Q**H or C Q.
139 *> The leading dimension of the array C. LDC >= max(1,M).
144 *> WORK is COMPLEX*16 array. The dimension of WORK is
145 *> N*NB if SIDE = 'L', or M*NB if SIDE = 'R'.
151 *> = 0: successful exit
152 *> < 0: if INFO = -i, the i-th argument had an illegal value
158 *> \author Univ. of Tennessee
159 *> \author Univ. of California Berkeley
160 *> \author Univ. of Colorado Denver
163 *> \date November 2013
165 *> \ingroup complex16GEcomputational
167 * =====================================================================
168 SUBROUTINE ZGEMQRT( SIDE, TRANS, M, N, K, NB, V, LDV, T, LDT,
169 $ C, LDC, WORK, INFO )
171 * -- LAPACK computational routine (version 3.5.0) --
172 * -- LAPACK is a software package provided by Univ. of Tennessee, --
173 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
176 * .. Scalar Arguments ..
177 CHARACTER SIDE, TRANS
178 INTEGER INFO, K, LDV, LDC, M, N, NB, LDT
180 * .. Array Arguments ..
181 COMPLEX*16 V( LDV, * ), C( LDC, * ), T( LDT, * ), WORK( * )
184 * =====================================================================
187 * .. Local Scalars ..
188 LOGICAL LEFT, RIGHT, TRAN, NOTRAN
189 INTEGER I, IB, LDWORK, KF, Q
191 * .. External Functions ..
195 * .. External Subroutines ..
196 EXTERNAL XERBLA, ZLARFB
198 * .. Intrinsic Functions ..
201 * .. Executable Statements ..
203 * .. Test the input arguments ..
206 LEFT = LSAME( SIDE, 'L' )
207 RIGHT = LSAME( SIDE, 'R' )
208 TRAN = LSAME( TRANS, 'C' )
209 NOTRAN = LSAME( TRANS, 'N' )
214 ELSE IF ( RIGHT ) THEN
218 IF( .NOT.LEFT .AND. .NOT.RIGHT ) THEN
220 ELSE IF( .NOT.TRAN .AND. .NOT.NOTRAN ) THEN
222 ELSE IF( M.LT.0 ) THEN
224 ELSE IF( N.LT.0 ) THEN
226 ELSE IF( K.LT.0 .OR. K.GT.Q ) THEN
228 ELSE IF( NB.LT.1 .OR. (NB.GT.K .AND. K.GT.0)) THEN
230 ELSE IF( LDV.LT.MAX( 1, Q ) ) THEN
232 ELSE IF( LDT.LT.NB ) THEN
234 ELSE IF( LDC.LT.MAX( 1, M ) ) THEN
239 CALL XERBLA( 'ZGEMQRT', -INFO )
243 * .. Quick return if possible ..
245 IF( M.EQ.0 .OR. N.EQ.0 .OR. K.EQ.0 ) RETURN
247 IF( LEFT .AND. TRAN ) THEN
250 IB = MIN( NB, K-I+1 )
251 CALL ZLARFB( 'L', 'C', 'F', 'C', M-I+1, N, IB,
252 $ V( I, I ), LDV, T( 1, I ), LDT,
253 $ C( I, 1 ), LDC, WORK, LDWORK )
256 ELSE IF( RIGHT .AND. NOTRAN ) THEN
259 IB = MIN( NB, K-I+1 )
260 CALL ZLARFB( 'R', 'N', 'F', 'C', M, N-I+1, IB,
261 $ V( I, I ), LDV, T( 1, I ), LDT,
262 $ C( 1, I ), LDC, WORK, LDWORK )
265 ELSE IF( LEFT .AND. NOTRAN ) THEN
269 IB = MIN( NB, K-I+1 )
270 CALL ZLARFB( 'L', 'N', 'F', 'C', M-I+1, N, IB,
271 $ V( I, I ), LDV, T( 1, I ), LDT,
272 $ C( I, 1 ), LDC, WORK, LDWORK )
275 ELSE IF( RIGHT .AND. TRAN ) THEN
279 IB = MIN( NB, K-I+1 )
280 CALL ZLARFB( 'R', 'C', 'F', 'C', M, N-I+1, IB,
281 $ V( I, I ), LDV, T( 1, I ), LDT,
282 $ C( 1, I ), LDC, WORK, LDWORK )