LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ ztpmqrt()

subroutine ztpmqrt ( character side,
character trans,
integer m,
integer n,
integer k,
integer l,
integer nb,
complex*16, dimension( ldv, * ) v,
integer ldv,
complex*16, dimension( ldt, * ) t,
integer ldt,
complex*16, dimension( lda, * ) a,
integer lda,
complex*16, dimension( ldb, * ) b,
integer ldb,
complex*16, dimension( * ) work,
integer info )

ZTPMQRT

Download ZTPMQRT + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> ZTPMQRT applies a complex orthogonal matrix Q obtained from a
!>  complex block reflector H to a general
!> complex matrix C, which consists of two blocks A and B.
!> 
Parameters
[in]SIDE
!>          SIDE is CHARACTER*1
!>          = 'L': apply Q or Q**H from the Left;
!>          = 'R': apply Q or Q**H from the Right.
!> 
[in]TRANS
!>          TRANS is CHARACTER*1
!>          = 'N':  No transpose, apply Q;
!>          = 'C':  Conjugate transpose, apply Q**H.
!> 
[in]M
!>          M is INTEGER
!>          The number of rows of the matrix B. M >= 0.
!> 
[in]N
!>          N is INTEGER
!>          The number of columns of the matrix B. N >= 0.
!> 
[in]K
!>          K is INTEGER
!>          The number of elementary reflectors whose product defines
!>          the matrix Q.
!> 
[in]L
!>          L is INTEGER
!>          The order of the trapezoidal part of V.
!>          K >= L >= 0.  See Further Details.
!> 
[in]NB
!>          NB is INTEGER
!>          The block size used for the storage of T.  K >= NB >= 1.
!>          This must be the same value of NB used to generate T
!>          in CTPQRT.
!> 
[in]V
!>          V is COMPLEX*16 array, dimension (LDV,K)
!>          The i-th column must contain the vector which defines the
!>          elementary reflector H(i), for i = 1,2,...,k, as returned by
!>          CTPQRT in B.  See Further Details.
!> 
[in]LDV
!>          LDV is INTEGER
!>          The leading dimension of the array V.
!>          If SIDE = 'L', LDV >= max(1,M);
!>          if SIDE = 'R', LDV >= max(1,N).
!> 
[in]T
!>          T is COMPLEX*16 array, dimension (LDT,K)
!>          The upper triangular factors of the block reflectors
!>          as returned by CTPQRT, stored as a NB-by-K matrix.
!> 
[in]LDT
!>          LDT is INTEGER
!>          The leading dimension of the array T.  LDT >= NB.
!> 
[in,out]A
!>          A is COMPLEX*16 array, dimension
!>          (LDA,N) if SIDE = 'L' or
!>          (LDA,K) if SIDE = 'R'
!>          On entry, the K-by-N or M-by-K matrix A.
!>          On exit, A is overwritten by the corresponding block of
!>          Q*C or Q**H*C or C*Q or C*Q**H.  See Further Details.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.
!>          If SIDE = 'L', LDC >= max(1,K);
!>          If SIDE = 'R', LDC >= max(1,M).
!> 
[in,out]B
!>          B is COMPLEX*16 array, dimension (LDB,N)
!>          On entry, the M-by-N matrix B.
!>          On exit, B is overwritten by the corresponding block of
!>          Q*C or Q**H*C or C*Q or C*Q**H.  See Further Details.
!> 
[in]LDB
!>          LDB is INTEGER
!>          The leading dimension of the array B.
!>          LDB >= max(1,M).
!> 
[out]WORK
!>          WORK is COMPLEX*16 array. The dimension of WORK is
!>           N*NB if SIDE = 'L', or  M*NB if SIDE = 'R'.
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0:  successful exit
!>          < 0:  if INFO = -i, the i-th argument had an illegal value
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Further Details:
!>
!>  The columns of the pentagonal matrix V contain the elementary reflectors
!>  H(1), H(2), ..., H(K); V is composed of a rectangular block V1 and a
!>  trapezoidal block V2:
!>
!>        V = [V1]
!>            [V2].
!>
!>  The size of the trapezoidal block V2 is determined by the parameter L,
!>  where 0 <= L <= K; V2 is upper trapezoidal, consisting of the first L
!>  rows of a K-by-K upper triangular matrix.  If L=K, V2 is upper triangular;
!>  if L=0, there is no trapezoidal block, hence V = V1 is rectangular.
!>
!>  If SIDE = 'L':  C = [A]  where A is K-by-N,  B is M-by-N and V is M-by-K.
!>                      [B]
!>
!>  If SIDE = 'R':  C = [A B]  where A is M-by-K, B is M-by-N and V is N-by-K.
!>
!>  The complex orthogonal matrix Q is formed from V and T.
!>
!>  If TRANS='N' and SIDE='L', C is on exit replaced with Q * C.
!>
!>  If TRANS='C' and SIDE='L', C is on exit replaced with Q**H * C.
!>
!>  If TRANS='N' and SIDE='R', C is on exit replaced with C * Q.
!>
!>  If TRANS='C' and SIDE='R', C is on exit replaced with C * Q**H.
!> 

Definition at line 212 of file ztpmqrt.f.

215*
216* -- LAPACK computational routine --
217* -- LAPACK is a software package provided by Univ. of Tennessee, --
218* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
219*
220* .. Scalar Arguments ..
221 CHARACTER SIDE, TRANS
222 INTEGER INFO, K, LDV, LDA, LDB, M, N, L, NB, LDT
223* ..
224* .. Array Arguments ..
225 COMPLEX*16 V( LDV, * ), A( LDA, * ), B( LDB, * ), T( LDT, * ),
226 $ WORK( * )
227* ..
228*
229* =====================================================================
230*
231* ..
232* .. Local Scalars ..
233 LOGICAL LEFT, RIGHT, TRAN, NOTRAN
234 INTEGER I, IB, MB, LB, KF, LDAQ, LDVQ
235* ..
236* .. External Functions ..
237 LOGICAL LSAME
238 EXTERNAL lsame
239* ..
240* .. External Subroutines ..
241 EXTERNAL ztprfb, xerbla
242* ..
243* .. Intrinsic Functions ..
244 INTRINSIC max, min
245* ..
246* .. Executable Statements ..
247*
248* .. Test the input arguments ..
249*
250 info = 0
251 left = lsame( side, 'L' )
252 right = lsame( side, 'R' )
253 tran = lsame( trans, 'C' )
254 notran = lsame( trans, 'N' )
255*
256 IF ( left ) THEN
257 ldvq = max( 1, m )
258 ldaq = max( 1, k )
259 ELSE IF ( right ) THEN
260 ldvq = max( 1, n )
261 ldaq = max( 1, m )
262 END IF
263 IF( .NOT.left .AND. .NOT.right ) THEN
264 info = -1
265 ELSE IF( .NOT.tran .AND. .NOT.notran ) THEN
266 info = -2
267 ELSE IF( m.LT.0 ) THEN
268 info = -3
269 ELSE IF( n.LT.0 ) THEN
270 info = -4
271 ELSE IF( k.LT.0 ) THEN
272 info = -5
273 ELSE IF( l.LT.0 .OR. l.GT.k ) THEN
274 info = -6
275 ELSE IF( nb.LT.1 .OR. (nb.GT.k .AND. k.GT.0) ) THEN
276 info = -7
277 ELSE IF( ldv.LT.ldvq ) THEN
278 info = -9
279 ELSE IF( ldt.LT.nb ) THEN
280 info = -11
281 ELSE IF( lda.LT.ldaq ) THEN
282 info = -13
283 ELSE IF( ldb.LT.max( 1, m ) ) THEN
284 info = -15
285 END IF
286*
287 IF( info.NE.0 ) THEN
288 CALL xerbla( 'ZTPMQRT', -info )
289 RETURN
290 END IF
291*
292* .. Quick return if possible ..
293*
294 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 ) RETURN
295*
296 IF( left .AND. tran ) THEN
297*
298 DO i = 1, k, nb
299 ib = min( nb, k-i+1 )
300 mb = min( m-l+i+ib-1, m )
301 IF( i.GE.l ) THEN
302 lb = 0
303 ELSE
304 lb = mb-m+l-i+1
305 END IF
306 CALL ztprfb( 'L', 'C', 'F', 'C', mb, n, ib, lb,
307 $ v( 1, i ), ldv, t( 1, i ), ldt,
308 $ a( i, 1 ), lda, b, ldb, work, ib )
309 END DO
310*
311 ELSE IF( right .AND. notran ) THEN
312*
313 DO i = 1, k, nb
314 ib = min( nb, k-i+1 )
315 mb = min( n-l+i+ib-1, n )
316 IF( i.GE.l ) THEN
317 lb = 0
318 ELSE
319 lb = mb-n+l-i+1
320 END IF
321 CALL ztprfb( 'R', 'N', 'F', 'C', m, mb, ib, lb,
322 $ v( 1, i ), ldv, t( 1, i ), ldt,
323 $ a( 1, i ), lda, b, ldb, work, m )
324 END DO
325*
326 ELSE IF( left .AND. notran ) THEN
327*
328 kf = ((k-1)/nb)*nb+1
329 DO i = kf, 1, -nb
330 ib = min( nb, k-i+1 )
331 mb = min( m-l+i+ib-1, m )
332 IF( i.GE.l ) THEN
333 lb = 0
334 ELSE
335 lb = mb-m+l-i+1
336 END IF
337 CALL ztprfb( 'L', 'N', 'F', 'C', mb, n, ib, lb,
338 $ v( 1, i ), ldv, t( 1, i ), ldt,
339 $ a( i, 1 ), lda, b, ldb, work, ib )
340 END DO
341*
342 ELSE IF( right .AND. tran ) THEN
343*
344 kf = ((k-1)/nb)*nb+1
345 DO i = kf, 1, -nb
346 ib = min( nb, k-i+1 )
347 mb = min( n-l+i+ib-1, n )
348 IF( i.GE.l ) THEN
349 lb = 0
350 ELSE
351 lb = mb-n+l-i+1
352 END IF
353 CALL ztprfb( 'R', 'C', 'F', 'C', m, mb, ib, lb,
354 $ v( 1, i ), ldv, t( 1, i ), ldt,
355 $ a( 1, i ), lda, b, ldb, work, m )
356 END DO
357*
358 END IF
359*
360 RETURN
361*
362* End of ZTPMQRT
363*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine ztprfb(side, trans, direct, storev, m, n, k, l, v, ldv, t, ldt, a, lda, b, ldb, work, ldwork)
ZTPRFB applies a complex "triangular-pentagonal" block reflector to a complex matrix,...
Definition ztprfb.f:249
Here is the call graph for this function:
Here is the caller graph for this function: