LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine ztprfb ( character  SIDE,
character  TRANS,
character  DIRECT,
character  STOREV,
integer  M,
integer  N,
integer  K,
integer  L,
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( ldwork, * )  WORK,
integer  LDWORK 
)

ZTPRFB applies a real or complex "triangular-pentagonal" blocked reflector to a real or complex matrix, which is composed of two blocks.

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

Purpose:
 ZTPRFB applies a complex "triangular-pentagonal" block reflector H or its 
 conjugate transpose H**H to a complex matrix C, which is composed of two 
 blocks A and B, either from the left or right.
Parameters
[in]SIDE
          SIDE is CHARACTER*1
          = 'L': apply H or H**H from the Left
          = 'R': apply H or H**H from the Right
[in]TRANS
          TRANS is CHARACTER*1
          = 'N': apply H (No transpose)
          = 'C': apply H**H (Conjugate transpose)
[in]DIRECT
          DIRECT is CHARACTER*1
          Indicates how H is formed from a product of elementary
          reflectors
          = 'F': H = H(1) H(2) . . . H(k) (Forward)
          = 'B': H = H(k) . . . H(2) H(1) (Backward)
[in]STOREV
          STOREV is CHARACTER*1
          Indicates how the vectors which define the elementary
          reflectors are stored:
          = 'C': Columns
          = 'R': Rows
[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 order of the matrix T, i.e. the number of elementary
          reflectors whose product defines the block reflector.  
          K >= 0.
[in]L
          L is INTEGER
          The order of the trapezoidal part of V.  
          K >= L >= 0.  See Further Details.
[in]V
          V is COMPLEX*16 array, dimension
                                (LDV,K) if STOREV = 'C'
                                (LDV,M) if STOREV = 'R' and SIDE = 'L'
                                (LDV,N) if STOREV = 'R' and SIDE = 'R'
          The pentagonal matrix V, which contains the elementary reflectors
          H(1), H(2), ..., H(K).  See Further Details.
[in]LDV
          LDV is INTEGER
          The leading dimension of the array V.
          If STOREV = 'C' and SIDE = 'L', LDV >= max(1,M);
          if STOREV = 'C' and SIDE = 'R', LDV >= max(1,N);
          if STOREV = 'R', LDV >= K.
[in]T
          T is COMPLEX*16 array, dimension (LDT,K)
          The triangular K-by-K matrix T in the representation of the
          block reflector.  
[in]LDT
          LDT is INTEGER
          The leading dimension of the array T. 
          LDT >= K.
[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 
          H*C or H**H*C or C*H or C*H**H.  See Futher 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
          H*C or H**H*C or C*H or C*H**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, dimension
          (LDWORK,N) if SIDE = 'L',
          (LDWORK,K) if SIDE = 'R'.
[in]LDWORK
          LDWORK is INTEGER
          The leading dimension of the array WORK.
          If SIDE = 'L', LDWORK >= K; 
          if SIDE = 'R', LDWORK >= M.
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
September 2012
Further Details:
  The matrix C is a composite matrix formed from blocks A and B.
  The block B is of size M-by-N; if SIDE = 'R', A is of size M-by-K, 
  and if SIDE = 'L', A is of size K-by-N.

  If SIDE = 'R' and DIRECT = 'F', C = [A B].

  If SIDE = 'L' and DIRECT = 'F', C = [A] 
                                      [B].

  If SIDE = 'R' and DIRECT = 'B', C = [B A].

  If SIDE = 'L' and DIRECT = 'B', C = [B]
                                      [A]. 

  The pentagonal matrix V is composed of a rectangular block V1 and a 
  trapezoidal block V2.  The size of the trapezoidal block is determined by 
  the parameter L, where 0<=L<=K.  If L=K, the V2 block of V is triangular;
  if L=0, there is no trapezoidal block, thus V = V1 is rectangular.

  If DIRECT = 'F' and STOREV = 'C':  V = [V1]
                                         [V2]
     - V2 is upper trapezoidal (first L rows of K-by-K upper triangular)

  If DIRECT = 'F' and STOREV = 'R':  V = [V1 V2]

     - V2 is lower trapezoidal (first L columns of K-by-K lower triangular)

  If DIRECT = 'B' and STOREV = 'C':  V = [V2]
                                         [V1]
     - V2 is lower trapezoidal (last L rows of K-by-K lower triangular)

  If DIRECT = 'B' and STOREV = 'R':  V = [V2 V1]
    
     - V2 is upper trapezoidal (last L columns of K-by-K upper triangular)

  If STOREV = 'C' and SIDE = 'L', V is M-by-K with V2 L-by-K.

  If STOREV = 'C' and SIDE = 'R', V is N-by-K with V2 L-by-K.

  If STOREV = 'R' and SIDE = 'L', V is K-by-M with V2 K-by-L.

  If STOREV = 'R' and SIDE = 'R', V is K-by-N with V2 K-by-L.

Definition at line 253 of file ztprfb.f.

253 *
254 * -- LAPACK auxiliary routine (version 3.4.2) --
255 * -- LAPACK is a software package provided by Univ. of Tennessee, --
256 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
257 * September 2012
258 *
259 * .. Scalar Arguments ..
260  CHARACTER direct, side, storev, trans
261  INTEGER k, l, lda, ldb, ldt, ldv, ldwork, m, n
262 * ..
263 * .. Array Arguments ..
264  COMPLEX*16 a( lda, * ), b( ldb, * ), t( ldt, * ),
265  $ v( ldv, * ), work( ldwork, * )
266 * ..
267 *
268 * ==========================================================================
269 *
270 * .. Parameters ..
271  COMPLEX*16 one, zero
272  parameter( one = (1.0,0.0), zero = (0.0,0.0) )
273 * ..
274 * .. Local Scalars ..
275  INTEGER i, j, mp, np, kp
276  LOGICAL left, forward, column, right, backward, row
277 * ..
278 * .. External Functions ..
279  LOGICAL lsame
280  EXTERNAL lsame
281 * ..
282 * .. External Subroutines ..
283  EXTERNAL zgemm, ztrmm
284 * ..
285 * .. Intrinsic Functions ..
286  INTRINSIC conjg
287 * ..
288 * .. Executable Statements ..
289 *
290 * Quick return if possible
291 *
292  IF( m.LE.0 .OR. n.LE.0 .OR. k.LE.0 .OR. l.LT.0 ) RETURN
293 *
294  IF( lsame( storev, 'C' ) ) THEN
295  column = .true.
296  row = .false.
297  ELSE IF ( lsame( storev, 'R' ) ) THEN
298  column = .false.
299  row = .true.
300  ELSE
301  column = .false.
302  row = .false.
303  END IF
304 *
305  IF( lsame( side, 'L' ) ) THEN
306  left = .true.
307  right = .false.
308  ELSE IF( lsame( side, 'R' ) ) THEN
309  left = .false.
310  right = .true.
311  ELSE
312  left = .false.
313  right = .false.
314  END IF
315 *
316  IF( lsame( direct, 'F' ) ) THEN
317  forward = .true.
318  backward = .false.
319  ELSE IF( lsame( direct, 'B' ) ) THEN
320  forward = .false.
321  backward = .true.
322  ELSE
323  forward = .false.
324  backward = .false.
325  END IF
326 *
327 * ---------------------------------------------------------------------------
328 *
329  IF( column .AND. forward .AND. left ) THEN
330 *
331 * ---------------------------------------------------------------------------
332 *
333 * Let W = [ I ] (K-by-K)
334 * [ V ] (M-by-K)
335 *
336 * Form H C or H**H C where C = [ A ] (K-by-N)
337 * [ B ] (M-by-N)
338 *
339 * H = I - W T W**H or H**H = I - W T**H W**H
340 *
341 * A = A - T (A + V**H B) or A = A - T**H (A + V**H B)
342 * B = B - V T (A + V**H B) or B = B - V T**H (A + V**H B)
343 *
344 * ---------------------------------------------------------------------------
345 *
346  mp = min( m-l+1, m )
347  kp = min( l+1, k )
348 *
349  DO j = 1, n
350  DO i = 1, l
351  work( i, j ) = b( m-l+i, j )
352  END DO
353  END DO
354  CALL ztrmm( 'L', 'U', 'C', 'N', l, n, one, v( mp, 1 ), ldv,
355  $ work, ldwork )
356  CALL zgemm( 'C', 'N', l, n, m-l, one, v, ldv, b, ldb,
357  $ one, work, ldwork )
358  CALL zgemm( 'C', 'N', k-l, n, m, one, v( 1, kp ), ldv,
359  $ b, ldb, zero, work( kp, 1 ), ldwork )
360 *
361  DO j = 1, n
362  DO i = 1, k
363  work( i, j ) = work( i, j ) + a( i, j )
364  END DO
365  END DO
366 *
367  CALL ztrmm( 'L', 'U', trans, 'N', k, n, one, t, ldt,
368  $ work, ldwork )
369 *
370  DO j = 1, n
371  DO i = 1, k
372  a( i, j ) = a( i, j ) - work( i, j )
373  END DO
374  END DO
375 *
376  CALL zgemm( 'N', 'N', m-l, n, k, -one, v, ldv, work, ldwork,
377  $ one, b, ldb )
378  CALL zgemm( 'N', 'N', l, n, k-l, -one, v( mp, kp ), ldv,
379  $ work( kp, 1 ), ldwork, one, b( mp, 1 ), ldb )
380  CALL ztrmm( 'L', 'U', 'N', 'N', l, n, one, v( mp, 1 ), ldv,
381  $ work, ldwork )
382  DO j = 1, n
383  DO i = 1, l
384  b( m-l+i, j ) = b( m-l+i, j ) - work( i, j )
385  END DO
386  END DO
387 *
388 * ---------------------------------------------------------------------------
389 *
390  ELSE IF( column .AND. forward .AND. right ) THEN
391 *
392 * ---------------------------------------------------------------------------
393 *
394 * Let W = [ I ] (K-by-K)
395 * [ V ] (N-by-K)
396 *
397 * Form C H or C H**H where C = [ A B ] (A is M-by-K, B is M-by-N)
398 *
399 * H = I - W T W**H or H**H = I - W T**H W**H
400 *
401 * A = A - (A + B V) T or A = A - (A + B V) T**H
402 * B = B - (A + B V) T V**H or B = B - (A + B V) T**H V**H
403 *
404 * ---------------------------------------------------------------------------
405 *
406  np = min( n-l+1, n )
407  kp = min( l+1, k )
408 *
409  DO j = 1, l
410  DO i = 1, m
411  work( i, j ) = b( i, n-l+j )
412  END DO
413  END DO
414  CALL ztrmm( 'R', 'U', 'N', 'N', m, l, one, v( np, 1 ), ldv,
415  $ work, ldwork )
416  CALL zgemm( 'N', 'N', m, l, n-l, one, b, ldb,
417  $ v, ldv, one, work, ldwork )
418  CALL zgemm( 'N', 'N', m, k-l, n, one, b, ldb,
419  $ v( 1, kp ), ldv, zero, work( 1, kp ), ldwork )
420 *
421  DO j = 1, k
422  DO i = 1, m
423  work( i, j ) = work( i, j ) + a( i, j )
424  END DO
425  END DO
426 *
427  CALL ztrmm( 'R', 'U', trans, 'N', m, k, one, t, ldt,
428  $ work, ldwork )
429 *
430  DO j = 1, k
431  DO i = 1, m
432  a( i, j ) = a( i, j ) - work( i, j )
433  END DO
434  END DO
435 *
436  CALL zgemm( 'N', 'C', m, n-l, k, -one, work, ldwork,
437  $ v, ldv, one, b, ldb )
438  CALL zgemm( 'N', 'C', m, l, k-l, -one, work( 1, kp ), ldwork,
439  $ v( np, kp ), ldv, one, b( 1, np ), ldb )
440  CALL ztrmm( 'R', 'U', 'C', 'N', m, l, one, v( np, 1 ), ldv,
441  $ work, ldwork )
442  DO j = 1, l
443  DO i = 1, m
444  b( i, n-l+j ) = b( i, n-l+j ) - work( i, j )
445  END DO
446  END DO
447 *
448 * ---------------------------------------------------------------------------
449 *
450  ELSE IF( column .AND. backward .AND. left ) THEN
451 *
452 * ---------------------------------------------------------------------------
453 *
454 * Let W = [ V ] (M-by-K)
455 * [ I ] (K-by-K)
456 *
457 * Form H C or H**H C where C = [ B ] (M-by-N)
458 * [ A ] (K-by-N)
459 *
460 * H = I - W T W**H or H**H = I - W T**H W**H
461 *
462 * A = A - T (A + V**H B) or A = A - T**H (A + V**H B)
463 * B = B - V T (A + V**H B) or B = B - V T**H (A + V**H B)
464 *
465 * ---------------------------------------------------------------------------
466 *
467  mp = min( l+1, m )
468  kp = min( k-l+1, k )
469 *
470  DO j = 1, n
471  DO i = 1, l
472  work( k-l+i, j ) = b( i, j )
473  END DO
474  END DO
475 *
476  CALL ztrmm( 'L', 'L', 'C', 'N', l, n, one, v( 1, kp ), ldv,
477  $ work( kp, 1 ), ldwork )
478  CALL zgemm( 'C', 'N', l, n, m-l, one, v( mp, kp ), ldv,
479  $ b( mp, 1 ), ldb, one, work( kp, 1 ), ldwork )
480  CALL zgemm( 'C', 'N', k-l, n, m, one, v, ldv,
481  $ b, ldb, zero, work, ldwork )
482 *
483  DO j = 1, n
484  DO i = 1, k
485  work( i, j ) = work( i, j ) + a( i, j )
486  END DO
487  END DO
488 *
489  CALL ztrmm( 'L', 'L', trans, 'N', k, n, one, t, ldt,
490  $ work, ldwork )
491 *
492  DO j = 1, n
493  DO i = 1, k
494  a( i, j ) = a( i, j ) - work( i, j )
495  END DO
496  END DO
497 *
498  CALL zgemm( 'N', 'N', m-l, n, k, -one, v( mp, 1 ), ldv,
499  $ work, ldwork, one, b( mp, 1 ), ldb )
500  CALL zgemm( 'N', 'N', l, n, k-l, -one, v, ldv,
501  $ work, ldwork, one, b, ldb )
502  CALL ztrmm( 'L', 'L', 'N', 'N', l, n, one, v( 1, kp ), ldv,
503  $ work( kp, 1 ), ldwork )
504  DO j = 1, n
505  DO i = 1, l
506  b( i, j ) = b( i, j ) - work( k-l+i, j )
507  END DO
508  END DO
509 *
510 * ---------------------------------------------------------------------------
511 *
512  ELSE IF( column .AND. backward .AND. right ) THEN
513 *
514 * ---------------------------------------------------------------------------
515 *
516 * Let W = [ V ] (N-by-K)
517 * [ I ] (K-by-K)
518 *
519 * Form C H or C H**H where C = [ B A ] (B is M-by-N, A is M-by-K)
520 *
521 * H = I - W T W**H or H**H = I - W T**H W**H
522 *
523 * A = A - (A + B V) T or A = A - (A + B V) T**H
524 * B = B - (A + B V) T V**H or B = B - (A + B V) T**H V**H
525 *
526 * ---------------------------------------------------------------------------
527 *
528  np = min( l+1, n )
529  kp = min( k-l+1, k )
530 *
531  DO j = 1, l
532  DO i = 1, m
533  work( i, k-l+j ) = b( i, j )
534  END DO
535  END DO
536  CALL ztrmm( 'R', 'L', 'N', 'N', m, l, one, v( 1, kp ), ldv,
537  $ work( 1, kp ), ldwork )
538  CALL zgemm( 'N', 'N', m, l, n-l, one, b( 1, np ), ldb,
539  $ v( np, kp ), ldv, one, work( 1, kp ), ldwork )
540  CALL zgemm( 'N', 'N', m, k-l, n, one, b, ldb,
541  $ v, ldv, zero, work, ldwork )
542 *
543  DO j = 1, k
544  DO i = 1, m
545  work( i, j ) = work( i, j ) + a( i, j )
546  END DO
547  END DO
548 *
549  CALL ztrmm( 'R', 'L', trans, 'N', m, k, one, t, ldt,
550  $ work, ldwork )
551 *
552  DO j = 1, k
553  DO i = 1, m
554  a( i, j ) = a( i, j ) - work( i, j )
555  END DO
556  END DO
557 *
558  CALL zgemm( 'N', 'C', m, n-l, k, -one, work, ldwork,
559  $ v( np, 1 ), ldv, one, b( 1, np ), ldb )
560  CALL zgemm( 'N', 'C', m, l, k-l, -one, work, ldwork,
561  $ v, ldv, one, b, ldb )
562  CALL ztrmm( 'R', 'L', 'C', 'N', m, l, one, v( 1, kp ), ldv,
563  $ work( 1, kp ), ldwork )
564  DO j = 1, l
565  DO i = 1, m
566  b( i, j ) = b( i, j ) - work( i, k-l+j )
567  END DO
568  END DO
569 *
570 * ---------------------------------------------------------------------------
571 *
572  ELSE IF( row .AND. forward .AND. left ) THEN
573 *
574 * ---------------------------------------------------------------------------
575 *
576 * Let W = [ I V ] ( I is K-by-K, V is K-by-M )
577 *
578 * Form H C or H**H C where C = [ A ] (K-by-N)
579 * [ B ] (M-by-N)
580 *
581 * H = I - W**H T W or H**H = I - W**H T**H W
582 *
583 * A = A - T (A + V B) or A = A - T**H (A + V B)
584 * B = B - V**H T (A + V B) or B = B - V**H T**H (A + V B)
585 *
586 * ---------------------------------------------------------------------------
587 *
588  mp = min( m-l+1, m )
589  kp = min( l+1, k )
590 *
591  DO j = 1, n
592  DO i = 1, l
593  work( i, j ) = b( m-l+i, j )
594  END DO
595  END DO
596  CALL ztrmm( 'L', 'L', 'N', 'N', l, n, one, v( 1, mp ), ldv,
597  $ work, ldb )
598  CALL zgemm( 'N', 'N', l, n, m-l, one, v, ldv,b, ldb,
599  $ one, work, ldwork )
600  CALL zgemm( 'N', 'N', k-l, n, m, one, v( kp, 1 ), ldv,
601  $ b, ldb, zero, work( kp, 1 ), ldwork )
602 *
603  DO j = 1, n
604  DO i = 1, k
605  work( i, j ) = work( i, j ) + a( i, j )
606  END DO
607  END DO
608 *
609  CALL ztrmm( 'L', 'U', trans, 'N', k, n, one, t, ldt,
610  $ work, ldwork )
611 *
612  DO j = 1, n
613  DO i = 1, k
614  a( i, j ) = a( i, j ) - work( i, j )
615  END DO
616  END DO
617 *
618  CALL zgemm( 'C', 'N', m-l, n, k, -one, v, ldv, work, ldwork,
619  $ one, b, ldb )
620  CALL zgemm( 'C', 'N', l, n, k-l, -one, v( kp, mp ), ldv,
621  $ work( kp, 1 ), ldwork, one, b( mp, 1 ), ldb )
622  CALL ztrmm( 'L', 'L', 'C', 'N', l, n, one, v( 1, mp ), ldv,
623  $ work, ldwork )
624  DO j = 1, n
625  DO i = 1, l
626  b( m-l+i, j ) = b( m-l+i, j ) - work( i, j )
627  END DO
628  END DO
629 *
630 * ---------------------------------------------------------------------------
631 *
632  ELSE IF( row .AND. forward .AND. right ) THEN
633 *
634 * ---------------------------------------------------------------------------
635 *
636 * Let W = [ I V ] ( I is K-by-K, V is K-by-N )
637 *
638 * Form C H or C H**H where C = [ A B ] (A is M-by-K, B is M-by-N)
639 *
640 * H = I - W**H T W or H**H = I - W**H T**H W
641 *
642 * A = A - (A + B V**H) T or A = A - (A + B V**H) T**H
643 * B = B - (A + B V**H) T V or B = B - (A + B V**H) T**H V
644 *
645 * ---------------------------------------------------------------------------
646 *
647  np = min( n-l+1, n )
648  kp = min( l+1, k )
649 *
650  DO j = 1, l
651  DO i = 1, m
652  work( i, j ) = b( i, n-l+j )
653  END DO
654  END DO
655  CALL ztrmm( 'R', 'L', 'C', 'N', m, l, one, v( 1, np ), ldv,
656  $ work, ldwork )
657  CALL zgemm( 'N', 'C', m, l, n-l, one, b, ldb, v, ldv,
658  $ one, work, ldwork )
659  CALL zgemm( 'N', 'C', m, k-l, n, one, b, ldb,
660  $ v( kp, 1 ), ldv, zero, work( 1, kp ), ldwork )
661 *
662  DO j = 1, k
663  DO i = 1, m
664  work( i, j ) = work( i, j ) + a( i, j )
665  END DO
666  END DO
667 *
668  CALL ztrmm( 'R', 'U', trans, 'N', m, k, one, t, ldt,
669  $ work, ldwork )
670 *
671  DO j = 1, k
672  DO i = 1, m
673  a( i, j ) = a( i, j ) - work( i, j )
674  END DO
675  END DO
676 *
677  CALL zgemm( 'N', 'N', m, n-l, k, -one, work, ldwork,
678  $ v, ldv, one, b, ldb )
679  CALL zgemm( 'N', 'N', m, l, k-l, -one, work( 1, kp ), ldwork,
680  $ v( kp, np ), ldv, one, b( 1, np ), ldb )
681  CALL ztrmm( 'R', 'L', 'N', 'N', m, l, one, v( 1, np ), ldv,
682  $ work, ldwork )
683  DO j = 1, l
684  DO i = 1, m
685  b( i, n-l+j ) = b( i, n-l+j ) - work( i, j )
686  END DO
687  END DO
688 *
689 * ---------------------------------------------------------------------------
690 *
691  ELSE IF( row .AND. backward .AND. left ) THEN
692 *
693 * ---------------------------------------------------------------------------
694 *
695 * Let W = [ V I ] ( I is K-by-K, V is K-by-M )
696 *
697 * Form H C or H**H C where C = [ B ] (M-by-N)
698 * [ A ] (K-by-N)
699 *
700 * H = I - W**H T W or H**H = I - W**H T**H W
701 *
702 * A = A - T (A + V B) or A = A - T**H (A + V B)
703 * B = B - V**H T (A + V B) or B = B - V**H T**H (A + V B)
704 *
705 * ---------------------------------------------------------------------------
706 *
707  mp = min( l+1, m )
708  kp = min( k-l+1, k )
709 *
710  DO j = 1, n
711  DO i = 1, l
712  work( k-l+i, j ) = b( i, j )
713  END DO
714  END DO
715  CALL ztrmm( 'L', 'U', 'N', 'N', l, n, one, v( kp, 1 ), ldv,
716  $ work( kp, 1 ), ldwork )
717  CALL zgemm( 'N', 'N', l, n, m-l, one, v( kp, mp ), ldv,
718  $ b( mp, 1 ), ldb, one, work( kp, 1 ), ldwork )
719  CALL zgemm( 'N', 'N', k-l, n, m, one, v, ldv, b, ldb,
720  $ zero, work, ldwork )
721 *
722  DO j = 1, n
723  DO i = 1, k
724  work( i, j ) = work( i, j ) + a( i, j )
725  END DO
726  END DO
727 *
728  CALL ztrmm( 'L', 'L ', trans, 'N', k, n, one, t, ldt,
729  $ work, ldwork )
730 *
731  DO j = 1, n
732  DO i = 1, k
733  a( i, j ) = a( i, j ) - work( i, j )
734  END DO
735  END DO
736 *
737  CALL zgemm( 'C', 'N', m-l, n, k, -one, v( 1, mp ), ldv,
738  $ work, ldwork, one, b( mp, 1 ), ldb )
739  CALL zgemm( 'C', 'N', l, n, k-l, -one, v, ldv,
740  $ work, ldwork, one, b, ldb )
741  CALL ztrmm( 'L', 'U', 'C', 'N', l, n, one, v( kp, 1 ), ldv,
742  $ work( kp, 1 ), ldwork )
743  DO j = 1, n
744  DO i = 1, l
745  b( i, j ) = b( i, j ) - work( k-l+i, j )
746  END DO
747  END DO
748 *
749 * ---------------------------------------------------------------------------
750 *
751  ELSE IF( row .AND. backward .AND. right ) THEN
752 *
753 * ---------------------------------------------------------------------------
754 *
755 * Let W = [ V I ] ( I is K-by-K, V is K-by-N )
756 *
757 * Form C H or C H**H where C = [ B A ] (A is M-by-K, B is M-by-N)
758 *
759 * H = I - W**H T W or H**H = I - W**H T**H W
760 *
761 * A = A - (A + B V**H) T or A = A - (A + B V**H) T**H
762 * B = B - (A + B V**H) T V or B = B - (A + B V**H) T**H V
763 *
764 * ---------------------------------------------------------------------------
765 *
766  np = min( l+1, n )
767  kp = min( k-l+1, k )
768 *
769  DO j = 1, l
770  DO i = 1, m
771  work( i, k-l+j ) = b( i, j )
772  END DO
773  END DO
774  CALL ztrmm( 'R', 'U', 'C', 'N', m, l, one, v( kp, 1 ), ldv,
775  $ work( 1, kp ), ldwork )
776  CALL zgemm( 'N', 'C', m, l, n-l, one, b( 1, np ), ldb,
777  $ v( kp, np ), ldv, one, work( 1, kp ), ldwork )
778  CALL zgemm( 'N', 'C', m, k-l, n, one, b, ldb, v, ldv,
779  $ zero, work, ldwork )
780 *
781  DO j = 1, k
782  DO i = 1, m
783  work( i, j ) = work( i, j ) + a( i, j )
784  END DO
785  END DO
786 *
787  CALL ztrmm( 'R', 'L', trans, 'N', m, k, one, t, ldt,
788  $ work, ldwork )
789 *
790  DO j = 1, k
791  DO i = 1, m
792  a( i, j ) = a( i, j ) - work( i, j )
793  END DO
794  END DO
795 *
796  CALL zgemm( 'N', 'N', m, n-l, k, -one, work, ldwork,
797  $ v( 1, np ), ldv, one, b( 1, np ), ldb )
798  CALL zgemm( 'N', 'N', m, l, k-l , -one, work, ldwork,
799  $ v, ldv, one, b, ldb )
800  CALL ztrmm( 'R', 'U', 'N', 'N', m, l, one, v( kp, 1 ), ldv,
801  $ work( 1, kp ), ldwork )
802  DO j = 1, l
803  DO i = 1, m
804  b( i, j ) = b( i, j ) - work( i, k-l+j )
805  END DO
806  END DO
807 *
808  END IF
809 *
810  RETURN
811 *
812 * End of ZTPRFB
813 *
subroutine zgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZGEMM
Definition: zgemm.f:189
subroutine ztrmm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)
ZTRMM
Definition: ztrmm.f:179
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: