3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DGEMQRT + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgemlqt.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dgemlqt.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgemlqt.f">
21 * SUBROUTINE DGEMLQT( SIDE, TRANS, M, N, K, MB, V, LDV, T, LDT,
22 * C, LDC, WORK, INFO )
24 * .. Scalar Arguments ..
25 * CHARACTER SIDE, TRANS
26 * INTEGER INFO, K, LDV, LDC, M, N, MB, LDT
28 * .. Array Arguments ..
29 * DOUBLE PRECISION V( LDV, * ), C( LDC, * ), T( LDT, * ), WORK( * )
38 *> DGEMQRT overwrites the general real M-by-N matrix C with
40 *> SIDE = 'L' SIDE = 'R'
41 *> TRANS = 'N': Q C C Q
42 *> TRANS = 'T': Q**T C C Q**T
44 *> where Q is a real orthogonal matrix defined as the product of K
45 *> elementary reflectors:
47 *> Q = H(1) H(2) . . . H(K) = I - V T V**T
49 *> generated using the compact WY representation as returned by DGELQT.
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**T from the Left;
61 *> = 'R': apply Q or Q**T from the Right.
66 *> TRANS is CHARACTER*1
67 *> = 'N': No transpose, apply Q;
68 *> = 'C': Transpose, apply Q**T.
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 >= MB >= 1.
96 *> This must be the same value of MB used to generate T
102 *> V is DOUBLE PRECISION array, dimension (LDV,K)
103 *> The i-th row must contain the vector which defines the
104 *> elementary reflector H(i), for i = 1,2,...,k, as returned by
105 *> DGELQT in the first K rows 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 DOUBLE PRECISION array, dimension (LDT,K)
119 *> The upper triangular factors of the block reflectors
120 *> as returned by DGELQT, stored as a MB-by-M matrix.
126 *> The leading dimension of the array T. LDT >= MB.
131 *> C is DOUBLE PRECISION array, dimension (LDC,N)
132 *> On entry, the M-by-N matrix C.
133 *> On exit, C is overwritten by Q C, Q**T C, C Q**T or C Q.
139 *> The leading dimension of the array C. LDC >= max(1,M).
144 *> WORK is DOUBLE PRECISION array. The dimension of
145 *> WORK is N*MB if SIDE = 'L', or M*MB 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 doubleGEcomputational
167 * =====================================================================
168 SUBROUTINE DGEMLQT( SIDE, TRANS, M, N, K, MB, 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, MB, LDT
180 * .. Array Arguments ..
181 DOUBLE PRECISION 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, DLARFB
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, 'T' )
209 NOTRAN = LSAME( TRANS, 'N' )
213 ELSE IF ( RIGHT ) THEN
216 IF( .NOT.LEFT .AND. .NOT.RIGHT ) THEN
218 ELSE IF( .NOT.TRAN .AND. .NOT.NOTRAN ) THEN
220 ELSE IF( M.LT.0 ) THEN
222 ELSE IF( N.LT.0 ) THEN
224 ELSE IF( K.LT.0) THEN
226 ELSE IF( MB.LT.1 .OR. (MB.GT.K .AND. K.GT.0)) THEN
228 ELSE IF( LDV.LT.MAX( 1, K ) ) THEN
230 ELSE IF( LDT.LT.MB ) THEN
232 ELSE IF( LDC.LT.MAX( 1, M ) ) THEN
237 CALL XERBLA( 'DGEMLQT', -INFO )
241 * .. Quick return if possible ..
243 IF( M.EQ.0 .OR. N.EQ.0 .OR. K.EQ.0 ) RETURN
245 IF( LEFT .AND. NOTRAN ) THEN
248 IB = MIN( MB, K-I+1 )
249 CALL DLARFB( 'L', 'T', 'F', 'R', M-I+1, N, IB,
250 $ V( I, I ), LDV, T( 1, I ), LDT,
251 $ C( I, 1 ), LDC, WORK, LDWORK )
254 ELSE IF( RIGHT .AND. TRAN ) THEN
257 IB = MIN( MB, K-I+1 )
258 CALL DLARFB( 'R', 'N', 'F', 'R', M, N-I+1, IB,
259 $ V( I, I ), LDV, T( 1, I ), LDT,
260 $ C( 1, I ), LDC, WORK, LDWORK )
263 ELSE IF( LEFT .AND. TRAN ) THEN
267 IB = MIN( MB, K-I+1 )
268 CALL DLARFB( 'L', 'N', 'F', 'R', M-I+1, N, IB,
269 $ V( I, I ), LDV, T( 1, I ), LDT,
270 $ C( I, 1 ), LDC, WORK, LDWORK )
273 ELSE IF( RIGHT .AND. NOTRAN ) THEN
277 IB = MIN( MB, K-I+1 )
278 CALL DLARFB( 'R', 'T', 'F', 'R', M, N-I+1, IB,
279 $ V( I, I ), LDV, T( 1, I ), LDT,
280 $ C( 1, I ), LDC, WORK, LDWORK )