4 * SUBROUTINE SGEMLQT( SIDE, TRANS, M, N, K, MB, V, LDV, T, LDT,
7 * .. Scalar Arguments ..
8 * CHARACTER SIDE, TRANS
9 * INTEGER INFO, K, LDV, LDC, M, N, MB, LDT
11 * .. Array Arguments ..
12 * REAL V( LDV, * ), C( LDC, * ), T( LDT, * ), WORK( * )
21 *> DGEMQRT overwrites the general real M-by-N matrix C with
23 *> SIDE = 'L' SIDE = 'R'
24 *> TRANS = 'N': Q C C Q
25 *> TRANS = 'T': Q**T C C Q**T
27 *> where Q is a real orthogonal matrix defined as the product of K
28 *> elementary reflectors:
30 *> Q = H(1) H(2) . . . H(K) = I - V T V**T
32 *> generated using the compact WY representation as returned by DGELQT.
34 *> Q is of order M if SIDE = 'L' and of order N if SIDE = 'R'.
42 *> SIDE is CHARACTER*1
43 *> = 'L': apply Q or Q**T from the Left;
44 *> = 'R': apply Q or Q**T from the Right.
49 *> TRANS is CHARACTER*1
50 *> = 'N': No transpose, apply Q;
51 *> = 'C': Transpose, apply Q**T.
57 *> The number of rows of the matrix C. M >= 0.
63 *> The number of columns of the matrix C. N >= 0.
69 *> The number of elementary reflectors whose product defines
71 *> If SIDE = 'L', M >= K >= 0;
72 *> if SIDE = 'R', N >= K >= 0.
78 *> The block size used for the storage of T. K >= MB >= 1.
79 *> This must be the same value of MB used to generate T
85 *> V is REAL array, dimension (LDV,K)
86 *> The i-th row must contain the vector which defines the
87 *> elementary reflector H(i), for i = 1,2,...,k, as returned by
88 *> DGELQT in the first K rows of its array argument A.
94 *> The leading dimension of the array V.
95 *> If SIDE = 'L', LDA >= max(1,M);
96 *> if SIDE = 'R', LDA >= max(1,N).
101 *> T is REAL array, dimension (LDT,K)
102 *> The upper triangular factors of the block reflectors
103 *> as returned by DGELQT, stored as a MB-by-M matrix.
109 *> The leading dimension of the array T. LDT >= MB.
114 *> C is REAL array, dimension (LDC,N)
115 *> On entry, the M-by-N matrix C.
116 *> On exit, C is overwritten by Q C, Q**T C, C Q**T or C Q.
122 *> The leading dimension of the array C. LDC >= max(1,M).
127 *> WORK is REAL array. The dimension of
128 *> WORK is N*MB if SIDE = 'L', or M*MB if SIDE = 'R'.
134 *> = 0: successful exit
135 *> < 0: if INFO = -i, the i-th argument had an illegal value
141 *> \author Univ. of Tennessee
142 *> \author Univ. of California Berkeley
143 *> \author Univ. of Colorado Denver
146 *> \date November 2013
148 *> \ingroup doubleGEcomputational
150 * =====================================================================
151 SUBROUTINE SGEMLQT( SIDE, TRANS, M, N, K, MB, V, LDV, T, LDT,
152 $ C, LDC, WORK, INFO )
154 * -- LAPACK computational routine (version 3.5.0) --
155 * -- LAPACK is a software package provided by Univ. of Tennessee, --
156 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
159 * .. Scalar Arguments ..
160 CHARACTER SIDE, TRANS
161 INTEGER INFO, K, LDV, LDC, M, N, MB, LDT
163 * .. Array Arguments ..
164 REAL V( LDV, * ), C( LDC, * ), T( LDT, * ), WORK( * )
167 * =====================================================================
170 * .. Local Scalars ..
171 LOGICAL LEFT, RIGHT, TRAN, NOTRAN
172 INTEGER I, IB, LDWORK, KF, Q
174 * .. External Functions ..
178 * .. External Subroutines ..
179 EXTERNAL XERBLA, DLARFB
181 * .. Intrinsic Functions ..
184 * .. Executable Statements ..
186 * .. Test the input arguments ..
189 LEFT = LSAME( SIDE, 'L' )
190 RIGHT = LSAME( SIDE, 'R' )
191 TRAN = LSAME( TRANS, 'T' )
192 NOTRAN = LSAME( TRANS, 'N' )
196 ELSE IF ( RIGHT ) THEN
199 IF( .NOT.LEFT .AND. .NOT.RIGHT ) THEN
201 ELSE IF( .NOT.TRAN .AND. .NOT.NOTRAN ) THEN
203 ELSE IF( M.LT.0 ) THEN
205 ELSE IF( N.LT.0 ) THEN
207 ELSE IF( K.LT.0) THEN
209 ELSE IF( MB.LT.1 .OR. (MB.GT.K .AND. K.GT.0)) THEN
211 ELSE IF( LDV.LT.MAX( 1, K ) ) THEN
213 ELSE IF( LDT.LT.MB ) THEN
215 ELSE IF( LDC.LT.MAX( 1, M ) ) THEN
220 CALL XERBLA( 'SGEMLQT', -INFO )
224 * .. Quick return if possible ..
226 IF( M.EQ.0 .OR. N.EQ.0 .OR. K.EQ.0 ) RETURN
228 IF( LEFT .AND. NOTRAN ) THEN
231 IB = MIN( MB, K-I+1 )
232 CALL SLARFB( 'L', 'T', 'F', 'R', M-I+1, N, IB,
233 $ V( I, I ), LDV, T( 1, I ), LDT,
234 $ C( I, 1 ), LDC, WORK, LDWORK )
237 ELSE IF( RIGHT .AND. TRAN ) THEN
240 IB = MIN( MB, K-I+1 )
241 CALL SLARFB( 'R', 'N', 'F', 'R', M, N-I+1, IB,
242 $ V( I, I ), LDV, T( 1, I ), LDT,
243 $ C( 1, I ), LDC, WORK, LDWORK )
246 ELSE IF( LEFT .AND. TRAN ) THEN
250 IB = MIN( MB, K-I+1 )
251 CALL SLARFB( 'L', 'N', 'F', 'R', 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
260 IB = MIN( MB, K-I+1 )
261 CALL SLARFB( 'R', 'T', 'F', 'R', M, N-I+1, IB,
262 $ V( I, I ), LDV, T( 1, I ), LDT,
263 $ C( 1, I ), LDC, WORK, LDWORK )