LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine ctpmqrt ( character  SIDE,
character  TRANS,
integer  M,
integer  N,
integer  K,
integer  L,
integer  NB,
complex, dimension( ldv, * )  V,
integer  LDV,
complex, dimension( ldt, * )  T,
integer  LDT,
complex, dimension( lda, * )  A,
integer  LDA,
complex, dimension( ldb, * )  B,
integer  LDB,
complex, dimension( * )  WORK,
integer  INFO 
)

CTPMQRT

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

Purpose:
 CTPMQRT applies a complex orthogonal matrix Q obtained from a 
 "triangular-pentagonal" 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':  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 array, dimension (LDA,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 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 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 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 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.
Date
November 2013
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 218 of file ctpmqrt.f.

218 *
219 * -- LAPACK computational routine (version 3.5.0) --
220 * -- LAPACK is a software package provided by Univ. of Tennessee, --
221 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
222 * November 2013
223 *
224 * .. Scalar Arguments ..
225  CHARACTER side, trans
226  INTEGER info, k, ldv, lda, ldb, m, n, l, nb, ldt
227 * ..
228 * .. Array Arguments ..
229  COMPLEX v( ldv, * ), a( lda, * ), b( ldb, * ), t( ldt, * ),
230  $ work( * )
231 * ..
232 *
233 * =====================================================================
234 *
235 * ..
236 * .. Local Scalars ..
237  LOGICAL left, right, tran, notran
238  INTEGER i, ib, mb, lb, kf, ldaq, ldvq
239 * ..
240 * .. External Functions ..
241  LOGICAL lsame
242  EXTERNAL lsame
243 * ..
244 * .. External Subroutines ..
245  EXTERNAL xerbla, clarfb
246 * ..
247 * .. Intrinsic Functions ..
248  INTRINSIC max, min
249 * ..
250 * .. Executable Statements ..
251 *
252 * .. Test the input arguments ..
253 *
254  info = 0
255  left = lsame( side, 'L' )
256  right = lsame( side, 'R' )
257  tran = lsame( trans, 'C' )
258  notran = lsame( trans, 'N' )
259 *
260  IF ( left ) THEN
261  ldvq = max( 1, m )
262  ldaq = max( 1, k )
263  ELSE IF ( right ) THEN
264  ldvq = max( 1, n )
265  ldaq = max( 1, m )
266  END IF
267  IF( .NOT.left .AND. .NOT.right ) THEN
268  info = -1
269  ELSE IF( .NOT.tran .AND. .NOT.notran ) THEN
270  info = -2
271  ELSE IF( m.LT.0 ) THEN
272  info = -3
273  ELSE IF( n.LT.0 ) THEN
274  info = -4
275  ELSE IF( k.LT.0 ) THEN
276  info = -5
277  ELSE IF( l.LT.0 .OR. l.GT.k ) THEN
278  info = -6
279  ELSE IF( nb.LT.1 .OR. (nb.GT.k .AND. k.GT.0) ) THEN
280  info = -7
281  ELSE IF( ldv.LT.ldvq ) THEN
282  info = -9
283  ELSE IF( ldt.LT.nb ) THEN
284  info = -11
285  ELSE IF( lda.LT.ldaq ) THEN
286  info = -13
287  ELSE IF( ldb.LT.max( 1, m ) ) THEN
288  info = -15
289  END IF
290 *
291  IF( info.NE.0 ) THEN
292  CALL xerbla( 'CTPMQRT', -info )
293  RETURN
294  END IF
295 *
296 * .. Quick return if possible ..
297 *
298  IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 ) RETURN
299 *
300  IF( left .AND. tran ) THEN
301 *
302  DO i = 1, k, nb
303  ib = min( nb, k-i+1 )
304  mb = min( m-l+i+ib-1, m )
305  IF( i.GE.l ) THEN
306  lb = 0
307  ELSE
308  lb = mb-m+l-i+1
309  END IF
310  CALL ctprfb( 'L', 'C', 'F', 'C', mb, n, ib, lb,
311  $ v( 1, i ), ldv, t( 1, i ), ldt,
312  $ a( i, 1 ), lda, b, ldb, work, ib )
313  END DO
314 *
315  ELSE IF( right .AND. notran ) THEN
316 *
317  DO i = 1, k, nb
318  ib = min( nb, k-i+1 )
319  mb = min( n-l+i+ib-1, n )
320  IF( i.GE.l ) THEN
321  lb = 0
322  ELSE
323  lb = mb-n+l-i+1
324  END IF
325  CALL ctprfb( '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 )
328  END DO
329 *
330  ELSE IF( left .AND. notran ) THEN
331 *
332  kf = ((k-1)/nb)*nb+1
333  DO i = kf, 1, -nb
334  ib = min( nb, k-i+1 )
335  mb = min( m-l+i+ib-1, m )
336  IF( i.GE.l ) THEN
337  lb = 0
338  ELSE
339  lb = mb-m+l-i+1
340  END IF
341  CALL ctprfb( '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 )
344  END DO
345 *
346  ELSE IF( right .AND. tran ) THEN
347 *
348  kf = ((k-1)/nb)*nb+1
349  DO i = kf, 1, -nb
350  ib = min( nb, k-i+1 )
351  mb = min( n-l+i+ib-1, n )
352  IF( i.GE.l ) THEN
353  lb = 0
354  ELSE
355  lb = mb-n+l-i+1
356  END IF
357  CALL ctprfb( 'R', 'C', 'F', 'C', m, mb, ib, lb,
358  $ v( 1, i ), ldv, t( 1, i ), ldt,
359  $ a( 1, i ), lda, b, ldb, work, m )
360  END DO
361 *
362  END IF
363 *
364  RETURN
365 *
366 * End of CTPMQRT
367 *
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:253
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine clarfb(SIDE, TRANS, DIRECT, STOREV, M, N, K, V, LDV, T, LDT, C, LDC, WORK, LDWORK)
CLARFB applies a block reflector or its conjugate-transpose to a general rectangular matrix...
Definition: clarfb.f:197
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: