3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download STPMQRT + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/stpmqrt.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/stpmqrt.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/stpmqrt.f">
21 * SUBROUTINE STPMQRT( SIDE, TRANS, M, N, K, L, NB, V, LDV, T, LDT,
22 * A, LDA, B, LDB, WORK, INFO )
24 * .. Scalar Arguments ..
25 * CHARACTER SIDE, TRANS
26 * INTEGER INFO, K, LDV, LDA, LDB, M, N, L, NB, LDT
28 * .. Array Arguments ..
29 * REAL V( LDV, * ), A( LDA, * ), B( LDB, * ), T( LDT, * ),
39 *> STPMQRT applies a real orthogonal matrix Q obtained from a
40 *> "triangular-pentagonal" real block reflector H to a general
41 *> real matrix C, which consists of two blocks A and B.
49 *> SIDE is CHARACTER*1
50 *> = 'L': apply Q or Q^T from the Left;
51 *> = 'R': apply Q or Q^T from the Right.
56 *> TRANS is CHARACTER*1
57 *> = 'N': No transpose, apply Q;
58 *> = 'T': Transpose, apply Q^T.
64 *> The number of rows of the matrix B. M >= 0.
70 *> The number of columns of the matrix B. N >= 0.
76 *> The number of elementary reflectors whose product defines
83 *> The order of the trapezoidal part of V.
84 *> K >= L >= 0. See Further Details.
90 *> The block size used for the storage of T. K >= NB >= 1.
91 *> This must be the same value of NB used to generate T
97 *> V is REAL array, dimension (LDA,K)
98 *> The i-th column must contain the vector which defines the
99 *> elementary reflector H(i), for i = 1,2,...,k, as returned by
100 *> CTPQRT in B. See Further Details.
106 *> The leading dimension of the array V.
107 *> If SIDE = 'L', LDV >= max(1,M);
108 *> if SIDE = 'R', LDV >= max(1,N).
113 *> T is REAL array, dimension (LDT,K)
114 *> The upper triangular factors of the block reflectors
115 *> as returned by CTPQRT, stored as a NB-by-K matrix.
121 *> The leading dimension of the array T. LDT >= NB.
126 *> A is REAL array, dimension
127 *> (LDA,N) if SIDE = 'L' or
128 *> (LDA,K) if SIDE = 'R'
129 *> On entry, the K-by-N or M-by-K matrix A.
130 *> On exit, A is overwritten by the corresponding block of
131 *> Q*C or Q^T*C or C*Q or C*Q^T. See Further Details.
137 *> The leading dimension of the array A.
138 *> If SIDE = 'L', LDC >= max(1,K);
139 *> If SIDE = 'R', LDC >= max(1,M).
144 *> B is REAL array, dimension (LDB,N)
145 *> On entry, the M-by-N matrix B.
146 *> On exit, B is overwritten by the corresponding block of
147 *> Q*C or Q^T*C or C*Q or C*Q^T. See Further Details.
153 *> The leading dimension of the array B.
159 *> WORK is REAL array. The dimension of WORK is
160 *> N*NB if SIDE = 'L', or M*NB if SIDE = 'R'.
166 *> = 0: successful exit
167 *> < 0: if INFO = -i, the i-th argument had an illegal value
173 *> \author Univ. of Tennessee
174 *> \author Univ. of California Berkeley
175 *> \author Univ. of Colorado Denver
178 *> \date November 2015
180 *> \ingroup realOTHERcomputational
182 *> \par Further Details:
183 * =====================
187 *> The columns of the pentagonal matrix V contain the elementary reflectors
188 *> H(1), H(2), ..., H(K); V is composed of a rectangular block V1 and a
189 *> trapezoidal block V2:
194 *> The size of the trapezoidal block V2 is determined by the parameter L,
195 *> where 0 <= L <= K; V2 is upper trapezoidal, consisting of the first L
196 *> rows of a K-by-K upper triangular matrix. If L=K, V2 is upper triangular;
197 *> if L=0, there is no trapezoidal block, hence V = V1 is rectangular.
199 *> If SIDE = 'L': C = [A] where A is K-by-N, B is M-by-N and V is M-by-K.
202 *> If SIDE = 'R': C = [A B] where A is M-by-K, B is M-by-N and V is N-by-K.
204 *> The real orthogonal matrix Q is formed from V and T.
206 *> If TRANS='N' and SIDE='L', C is on exit replaced with Q * C.
208 *> If TRANS='T' and SIDE='L', C is on exit replaced with Q^T * C.
210 *> If TRANS='N' and SIDE='R', C is on exit replaced with C * Q.
212 *> If TRANS='T' and SIDE='R', C is on exit replaced with C * Q^T.
215 * =====================================================================
216 SUBROUTINE STPMQRT( SIDE, TRANS, M, N, K, L, NB, V, LDV, T, LDT,
217 $ A, LDA, B, LDB, WORK, INFO )
219 * -- LAPACK computational routine (version 3.6.0) --
220 * -- LAPACK is a software package provided by Univ. of Tennessee, --
221 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
224 * .. Scalar Arguments ..
225 CHARACTER SIDE, TRANS
226 INTEGER INFO, K, LDV, LDA, LDB, M, N, L, NB, LDT
228 * .. Array Arguments ..
229 REAL V( LDV, * ), A( LDA, * ), B( LDB, * ), T( LDT, * ),
233 * =====================================================================
236 * .. Local Scalars ..
237 LOGICAL LEFT, RIGHT, TRAN, NOTRAN
238 INTEGER I, IB, MB, LB, KF, LDAQ, LDVQ
240 * .. External Functions ..
244 * .. External Subroutines ..
245 EXTERNAL XERBLA, SLARFB
247 * .. Intrinsic Functions ..
250 * .. Executable Statements ..
252 * .. Test the input arguments ..
255 LEFT = LSAME( SIDE, 'L' )
256 RIGHT = LSAME( SIDE, 'R' )
257 TRAN = LSAME( TRANS, 'T' )
258 NOTRAN = LSAME( TRANS, 'N' )
263 ELSE IF ( RIGHT ) THEN
267 IF( .NOT.LEFT .AND. .NOT.RIGHT ) THEN
269 ELSE IF( .NOT.TRAN .AND. .NOT.NOTRAN ) THEN
271 ELSE IF( M.LT.0 ) THEN
273 ELSE IF( N.LT.0 ) THEN
275 ELSE IF( K.LT.0 ) THEN
277 ELSE IF( L.LT.0 .OR. L.GT.K ) THEN
279 ELSE IF( NB.LT.1 .OR. (NB.GT.K .AND. K.GT.0) ) THEN
281 ELSE IF( LDV.LT.LDVQ ) THEN
283 ELSE IF( LDT.LT.NB ) THEN
285 ELSE IF( LDA.LT.LDAQ ) THEN
287 ELSE IF( LDB.LT.MAX( 1, M ) ) THEN
292 CALL XERBLA( 'STPMQRT', -INFO )
296 * .. Quick return if possible ..
298 IF( M.EQ.0 .OR. N.EQ.0 .OR. K.EQ.0 ) RETURN
300 IF( LEFT .AND. TRAN ) THEN
303 IB = MIN( NB, K-I+1 )
304 MB = MIN( M-L+I+IB-1, M )
310 CALL STPRFB( 'L', 'T', 'F', 'C', MB, N, IB, LB,
311 $ V( 1, I ), LDV, T( 1, I ), LDT,
312 $ A( I, 1 ), LDA, B, LDB, WORK, IB )
315 ELSE IF( RIGHT .AND. NOTRAN ) THEN
318 IB = MIN( NB, K-I+1 )
319 MB = MIN( N-L+I+IB-1, N )
325 CALL STPRFB( 'R', 'N', 'F', 'C', M, MB, IB, LB,
326 $ V( 1, I ), LDV, T( 1, I ), LDT,
327 $ A( 1, I ), LDA, B, LDB, WORK, M )
330 ELSE IF( LEFT .AND. NOTRAN ) THEN
334 IB = MIN( NB, K-I+1 )
335 MB = MIN( M-L+I+IB-1, M )
341 CALL STPRFB( 'L', 'N', 'F', 'C', MB, N, IB, LB,
342 $ V( 1, I ), LDV, T( 1, I ), LDT,
343 $ A( I, 1 ), LDA, B, LDB, WORK, IB )
346 ELSE IF( RIGHT .AND. TRAN ) THEN
350 IB = MIN( NB, K-I+1 )
351 MB = MIN( N-L+I+IB-1, N )
357 CALL STPRFB( 'R', 'T', 'F', 'C', M, MB, IB, LB,
358 $ V( 1, I ), LDV, T( 1, I ), LDT,
359 $ A( 1, I ), LDA, B, LDB, WORK, M )