LAPACK  3.9.1
LAPACK: Linear Algebra PACKage
ctpmlqt.f
Go to the documentation of this file.
1 *> \brief \b CTPMLQT
2 *
3 * Definition:
4 * ===========
5 *
6 * SUBROUTINE CTPMLQT( SIDE, TRANS, M, N, K, L, MB, V, LDV, T, LDT,
7 * A, LDA, B, LDB, WORK, INFO )
8 *
9 * .. Scalar Arguments ..
10 * CHARACTER SIDE, TRANS
11 * INTEGER INFO, K, LDV, LDA, LDB, M, N, L, MB, LDT
12 * ..
13 * .. Array Arguments ..
14 * COMPLEX V( LDV, * ), A( LDA, * ), B( LDB, * ),
15 * $ T( LDT, * ), WORK( * )
16 * ..
17 *
18 *
19 *> \par Purpose:
20 * =============
21 *>
22 *> \verbatim
23 *>
24 *> CTPMLQT applies a complex orthogonal matrix Q obtained from a
25 *> "triangular-pentagonal" complex block reflector H to a general
26 *> complex matrix C, which consists of two blocks A and B.
27 *> \endverbatim
28 *
29 * Arguments:
30 * ==========
31 *
32 *> \param[in] SIDE
33 *> \verbatim
34 *> SIDE is CHARACTER*1
35 *> = 'L': apply Q or Q**H from the Left;
36 *> = 'R': apply Q or Q**H from the Right.
37 *> \endverbatim
38 *>
39 *> \param[in] TRANS
40 *> \verbatim
41 *> TRANS is CHARACTER*1
42 *> = 'N': No transpose, apply Q;
43 *> = 'C': Transpose, apply Q**H.
44 *> \endverbatim
45 *>
46 *> \param[in] M
47 *> \verbatim
48 *> M is INTEGER
49 *> The number of rows of the matrix B. M >= 0.
50 *> \endverbatim
51 *>
52 *> \param[in] N
53 *> \verbatim
54 *> N is INTEGER
55 *> The number of columns of the matrix B. N >= 0.
56 *> \endverbatim
57 *>
58 *> \param[in] K
59 *> \verbatim
60 *> K is INTEGER
61 *> The number of elementary reflectors whose product defines
62 *> the matrix Q.
63 *> \endverbatim
64 *>
65 *> \param[in] L
66 *> \verbatim
67 *> L is INTEGER
68 *> The order of the trapezoidal part of V.
69 *> K >= L >= 0. See Further Details.
70 *> \endverbatim
71 *>
72 *> \param[in] MB
73 *> \verbatim
74 *> MB is INTEGER
75 *> The block size used for the storage of T. K >= MB >= 1.
76 *> This must be the same value of MB used to generate T
77 *> in DTPLQT.
78 *> \endverbatim
79 *>
80 *> \param[in] V
81 *> \verbatim
82 *> V is COMPLEX array, dimension (LDV,K)
83 *> The i-th row must contain the vector which defines the
84 *> elementary reflector H(i), for i = 1,2,...,k, as returned by
85 *> DTPLQT in B. See Further Details.
86 *> \endverbatim
87 *>
88 *> \param[in] LDV
89 *> \verbatim
90 *> LDV is INTEGER
91 *> The leading dimension of the array V.
92 *> If SIDE = 'L', LDV >= max(1,M);
93 *> if SIDE = 'R', LDV >= max(1,N).
94 *> \endverbatim
95 *>
96 *> \param[in] T
97 *> \verbatim
98 *> T is COMPLEX array, dimension (LDT,K)
99 *> The upper triangular factors of the block reflectors
100 *> as returned by DTPLQT, stored as a MB-by-K matrix.
101 *> \endverbatim
102 *>
103 *> \param[in] LDT
104 *> \verbatim
105 *> LDT is INTEGER
106 *> The leading dimension of the array T. LDT >= MB.
107 *> \endverbatim
108 *>
109 *> \param[in,out] A
110 *> \verbatim
111 *> A is COMPLEX array, dimension
112 *> (LDA,N) if SIDE = 'L' or
113 *> (LDA,K) if SIDE = 'R'
114 *> On entry, the K-by-N or M-by-K matrix A.
115 *> On exit, A is overwritten by the corresponding block of
116 *> Q*C or Q**H*C or C*Q or C*Q**H. See Further Details.
117 *> \endverbatim
118 *>
119 *> \param[in] LDA
120 *> \verbatim
121 *> LDA is INTEGER
122 *> The leading dimension of the array A.
123 *> If SIDE = 'L', LDC >= max(1,K);
124 *> If SIDE = 'R', LDC >= max(1,M).
125 *> \endverbatim
126 *>
127 *> \param[in,out] B
128 *> \verbatim
129 *> B is COMPLEX array, dimension (LDB,N)
130 *> On entry, the M-by-N matrix B.
131 *> On exit, B is overwritten by the corresponding block of
132 *> Q*C or Q**H*C or C*Q or C*Q**H. See Further Details.
133 *> \endverbatim
134 *>
135 *> \param[in] LDB
136 *> \verbatim
137 *> LDB is INTEGER
138 *> The leading dimension of the array B.
139 *> LDB >= max(1,M).
140 *> \endverbatim
141 *>
142 *> \param[out] WORK
143 *> \verbatim
144 *> WORK is COMPLEX array. The dimension of WORK is
145 *> N*MB if SIDE = 'L', or M*MB if SIDE = 'R'.
146 *> \endverbatim
147 *>
148 *> \param[out] INFO
149 *> \verbatim
150 *> INFO is INTEGER
151 *> = 0: successful exit
152 *> < 0: if INFO = -i, the i-th argument had an illegal value
153 *> \endverbatim
154 *
155 * Authors:
156 * ========
157 *
158 *> \author Univ. of Tennessee
159 *> \author Univ. of California Berkeley
160 *> \author Univ. of Colorado Denver
161 *> \author NAG Ltd.
162 *
163 *> \ingroup doubleOTHERcomputational
164 *
165 *> \par Further Details:
166 * =====================
167 *>
168 *> \verbatim
169 *>
170 *> The columns of the pentagonal matrix V contain the elementary reflectors
171 *> H(1), H(2), ..., H(K); V is composed of a rectangular block V1 and a
172 *> trapezoidal block V2:
173 *>
174 *> V = [V1] [V2].
175 *>
176 *>
177 *> The size of the trapezoidal block V2 is determined by the parameter L,
178 *> where 0 <= L <= K; V2 is lower trapezoidal, consisting of the first L
179 *> rows of a K-by-K upper triangular matrix. If L=K, V2 is lower triangular;
180 *> if L=0, there is no trapezoidal block, hence V = V1 is rectangular.
181 *>
182 *> If SIDE = 'L': C = [A] where A is K-by-N, B is M-by-N and V is K-by-M.
183 *> [B]
184 *>
185 *> If SIDE = 'R': C = [A B] where A is M-by-K, B is M-by-N and V is K-by-N.
186 *>
187 *> The real orthogonal matrix Q is formed from V and T.
188 *>
189 *> If TRANS='N' and SIDE='L', C is on exit replaced with Q * C.
190 *>
191 *> If TRANS='C' and SIDE='L', C is on exit replaced with Q**H * C.
192 *>
193 *> If TRANS='N' and SIDE='R', C is on exit replaced with C * Q.
194 *>
195 *> If TRANS='C' and SIDE='R', C is on exit replaced with C * Q**H.
196 *> \endverbatim
197 *>
198 * =====================================================================
199  SUBROUTINE ctpmlqt( SIDE, TRANS, M, N, K, L, MB, V, LDV, T, LDT,
200  $ A, LDA, B, LDB, WORK, INFO )
201 *
202 * -- LAPACK computational routine --
203 * -- LAPACK is a software package provided by Univ. of Tennessee, --
204 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
205 *
206 * .. Scalar Arguments ..
207  CHARACTER SIDE, TRANS
208  INTEGER INFO, K, LDV, LDA, LDB, M, N, L, MB, LDT
209 * ..
210 * .. Array Arguments ..
211  COMPLEX V( LDV, * ), A( LDA, * ), B( LDB, * ),
212  $ t( ldt, * ), work( * )
213 * ..
214 *
215 * =====================================================================
216 *
217 * ..
218 * .. Local Scalars ..
219  LOGICAL LEFT, RIGHT, TRAN, NOTRAN
220  INTEGER I, IB, NB, LB, KF, LDAQ
221 * ..
222 * .. External Functions ..
223  LOGICAL LSAME
224  EXTERNAL lsame
225 * ..
226 * .. External Subroutines ..
227  EXTERNAL xerbla, ctprfb
228 * ..
229 * .. Intrinsic Functions ..
230  INTRINSIC max, min
231 * ..
232 * .. Executable Statements ..
233 *
234 * .. Test the input arguments ..
235 *
236  info = 0
237  left = lsame( side, 'L' )
238  right = lsame( side, 'R' )
239  tran = lsame( trans, 'C' )
240  notran = lsame( trans, 'N' )
241 *
242  IF ( left ) THEN
243  ldaq = max( 1, k )
244  ELSE IF ( right ) THEN
245  ldaq = max( 1, m )
246  END IF
247  IF( .NOT.left .AND. .NOT.right ) THEN
248  info = -1
249  ELSE IF( .NOT.tran .AND. .NOT.notran ) THEN
250  info = -2
251  ELSE IF( m.LT.0 ) THEN
252  info = -3
253  ELSE IF( n.LT.0 ) THEN
254  info = -4
255  ELSE IF( k.LT.0 ) THEN
256  info = -5
257  ELSE IF( l.LT.0 .OR. l.GT.k ) THEN
258  info = -6
259  ELSE IF( mb.LT.1 .OR. (mb.GT.k .AND. k.GT.0) ) THEN
260  info = -7
261  ELSE IF( ldv.LT.k ) THEN
262  info = -9
263  ELSE IF( ldt.LT.mb ) THEN
264  info = -11
265  ELSE IF( lda.LT.ldaq ) THEN
266  info = -13
267  ELSE IF( ldb.LT.max( 1, m ) ) THEN
268  info = -15
269  END IF
270 *
271  IF( info.NE.0 ) THEN
272  CALL xerbla( 'CTPMLQT', -info )
273  RETURN
274  END IF
275 *
276 * .. Quick return if possible ..
277 *
278  IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 ) RETURN
279 *
280  IF( left .AND. notran ) THEN
281 *
282  DO i = 1, k, mb
283  ib = min( mb, k-i+1 )
284  nb = min( m-l+i+ib-1, m )
285  IF( i.GE.l ) THEN
286  lb = 0
287  ELSE
288  lb = 0
289  END IF
290  CALL ctprfb( 'L', 'C', 'F', 'R', nb, n, ib, lb,
291  $ v( i, 1 ), ldv, t( 1, i ), ldt,
292  $ a( i, 1 ), lda, b, ldb, work, ib )
293  END DO
294 *
295  ELSE IF( right .AND. tran ) THEN
296 *
297  DO i = 1, k, mb
298  ib = min( mb, k-i+1 )
299  nb = min( n-l+i+ib-1, n )
300  IF( i.GE.l ) THEN
301  lb = 0
302  ELSE
303  lb = nb-n+l-i+1
304  END IF
305  CALL ctprfb( 'R', 'N', 'F', 'R', m, nb, ib, lb,
306  $ v( i, 1 ), ldv, t( 1, i ), ldt,
307  $ a( 1, i ), lda, b, ldb, work, m )
308  END DO
309 *
310  ELSE IF( left .AND. tran ) THEN
311 *
312  kf = ((k-1)/mb)*mb+1
313  DO i = kf, 1, -mb
314  ib = min( mb, k-i+1 )
315  nb = min( m-l+i+ib-1, m )
316  IF( i.GE.l ) THEN
317  lb = 0
318  ELSE
319  lb = 0
320  END IF
321  CALL ctprfb( 'L', 'N', 'F', 'R', nb, n, ib, lb,
322  $ v( i, 1 ), ldv, t( 1, i ), ldt,
323  $ a( i, 1 ), lda, b, ldb, work, ib )
324  END DO
325 *
326  ELSE IF( right .AND. notran ) THEN
327 *
328  kf = ((k-1)/mb)*mb+1
329  DO i = kf, 1, -mb
330  ib = min( mb, k-i+1 )
331  nb = min( n-l+i+ib-1, n )
332  IF( i.GE.l ) THEN
333  lb = 0
334  ELSE
335  lb = nb-n+l-i+1
336  END IF
337  CALL ctprfb( 'R', 'C', 'F', 'R', m, nb, ib, lb,
338  $ v( i, 1 ), ldv, t( 1, i ), ldt,
339  $ a( 1, i ), lda, b, ldb, work, m )
340  END DO
341 *
342  END IF
343 *
344  RETURN
345 *
346 * End of CTPMLQT
347 *
348  END
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
subroutine ctprfb(SIDE, TRANS, DIRECT, STOREV, M, N, K, L, V, LDV, T, LDT, A, LDA, B, LDB, WORK, LDWORK)
CTPRFB applies a real or complex "triangular-pentagonal" blocked reflector to a real or complex matri...
Definition: ctprfb.f:251
subroutine ctpmlqt(SIDE, TRANS, M, N, K, L, MB, V, LDV, T, LDT, A, LDA, B, LDB, WORK, INFO)
CTPMLQT
Definition: ctpmlqt.f:201