249 SUBROUTINE ztprfb( SIDE, TRANS, DIRECT, STOREV, M, N, K, L,
250 $ V, LDV, T, LDT, A, LDA, B, LDB, WORK, LDWORK )
257 CHARACTER DIRECT, SIDE, STOREV, TRANS
258 INTEGER K, L, LDA, LDB, LDT, LDV, LDWORK, M, N
261 COMPLEX*16 A( LDA, * ), B( LDB, * ), T( LDT, * ),
262 $ v( ldv, * ), work( ldwork, * )
269 parameter( one = (1.0,0.0), zero = (0.0,0.0) )
272 INTEGER I, J, MP, NP, KP
273 LOGICAL LEFT, FORWARD, COLUMN, RIGHT, BACKWARD, ROW
289 IF( m.LE.0 .OR. n.LE.0 .OR. k.LE.0 .OR. l.LT.0 )
RETURN
291 IF( lsame( storev,
'C' ) )
THEN
294 ELSE IF ( lsame( storev,
'R' ) )
THEN
302 IF( lsame( side,
'L' ) )
THEN
305 ELSE IF( lsame( side,
'R' ) )
THEN
313 IF( lsame( direct,
'F' ) )
THEN
316 ELSE IF( lsame( direct,
'B' ) )
THEN
326 IF( column .AND. forward .AND. left )
THEN
348 work( i, j ) = b( m-l+i, j )
351 CALL ztrmm(
'L',
'U',
'C',
'N', l, n, one, v( mp, 1 ), ldv,
353 CALL zgemm(
'C',
'N', l, n, m-l, one, v, ldv, b, ldb,
354 $ one, work, ldwork )
355 CALL zgemm(
'C',
'N', k-l, n, m, one, v( 1, kp ), ldv,
356 $ b, ldb, zero, work( kp, 1 ), ldwork )
360 work( i, j ) = work( i, j ) + a( i, j )
364 CALL ztrmm(
'L',
'U', trans,
'N', k, n, one, t, ldt,
369 a( i, j ) = a( i, j ) - work( i, j )
373 CALL zgemm(
'N',
'N', m-l, n, k, -one, v, ldv, work, ldwork,
375 CALL zgemm(
'N',
'N', l, n, k-l, -one, v( mp, kp ), ldv,
376 $ work( kp, 1 ), ldwork, one, b( mp, 1 ), ldb )
377 CALL ztrmm(
'L',
'U',
'N',
'N', l, n, one, v( mp, 1 ), ldv,
381 b( m-l+i, j ) = b( m-l+i, j ) - work( i, j )
387 ELSE IF( column .AND. forward .AND. right )
THEN
408 work( i, j ) = b( i, n-l+j )
411 CALL ztrmm(
'R',
'U',
'N',
'N', m, l, one, v( np, 1 ), ldv,
413 CALL zgemm(
'N',
'N', m, l, n-l, one, b, ldb,
414 $ v, ldv, one, work, ldwork )
415 CALL zgemm(
'N',
'N', m, k-l, n, one, b, ldb,
416 $ v( 1, kp ), ldv, zero, work( 1, kp ), ldwork )
420 work( i, j ) = work( i, j ) + a( i, j )
424 CALL ztrmm(
'R',
'U', trans,
'N', m, k, one, t, ldt,
429 a( i, j ) = a( i, j ) - work( i, j )
433 CALL zgemm(
'N',
'C', m, n-l, k, -one, work, ldwork,
434 $ v, ldv, one, b, ldb )
435 CALL zgemm(
'N',
'C', m, l, k-l, -one, work( 1, kp ), ldwork,
436 $ v( np, kp ), ldv, one, b( 1, np ), ldb )
437 CALL ztrmm(
'R',
'U',
'C',
'N', m, l, one, v( np, 1 ), ldv,
441 b( i, n-l+j ) = b( i, n-l+j ) - work( i, j )
447 ELSE IF( column .AND. backward .AND. left )
THEN
469 work( k-l+i, j ) = b( i, j )
473 CALL ztrmm(
'L',
'L',
'C',
'N', l, n, one, v( 1, kp ), ldv,
474 $ work( kp, 1 ), ldwork )
475 CALL zgemm(
'C',
'N', l, n, m-l, one, v( mp, kp ), ldv,
476 $ b( mp, 1 ), ldb, one, work( kp, 1 ), ldwork )
477 CALL zgemm(
'C',
'N', k-l, n, m, one, v, ldv,
478 $ b, ldb, zero, work, ldwork )
482 work( i, j ) = work( i, j ) + a( i, j )
486 CALL ztrmm(
'L',
'L', trans,
'N', k, n, one, t, ldt,
491 a( i, j ) = a( i, j ) - work( i, j )
495 CALL zgemm(
'N',
'N', m-l, n, k, -one, v( mp, 1 ), ldv,
496 $ work, ldwork, one, b( mp, 1 ), ldb )
497 CALL zgemm(
'N',
'N', l, n, k-l, -one, v, ldv,
498 $ work, ldwork, one, b, ldb )
499 CALL ztrmm(
'L',
'L',
'N',
'N', l, n, one, v( 1, kp ), ldv,
500 $ work( kp, 1 ), ldwork )
503 b( i, j ) = b( i, j ) - work( k-l+i, j )
509 ELSE IF( column .AND. backward .AND. right )
THEN
530 work( i, k-l+j ) = b( i, j )
533 CALL ztrmm(
'R',
'L',
'N',
'N', m, l, one, v( 1, kp ), ldv,
534 $ work( 1, kp ), ldwork )
535 CALL zgemm(
'N',
'N', m, l, n-l, one, b( 1, np ), ldb,
536 $ v( np, kp ), ldv, one, work( 1, kp ), ldwork )
537 CALL zgemm(
'N',
'N', m, k-l, n, one, b, ldb,
538 $ v, ldv, zero, work, ldwork )
542 work( i, j ) = work( i, j ) + a( i, j )
546 CALL ztrmm(
'R',
'L', trans,
'N', m, k, one, t, ldt,
551 a( i, j ) = a( i, j ) - work( i, j )
555 CALL zgemm(
'N',
'C', m, n-l, k, -one, work, ldwork,
556 $ v( np, 1 ), ldv, one, b( 1, np ), ldb )
557 CALL zgemm(
'N',
'C', m, l, k-l, -one, work, ldwork,
558 $ v, ldv, one, b, ldb )
559 CALL ztrmm(
'R',
'L',
'C',
'N', m, l, one, v( 1, kp ), ldv,
560 $ work( 1, kp ), ldwork )
563 b( i, j ) = b( i, j ) - work( i, k-l+j )
569 ELSE IF( row .AND. forward .AND. left )
THEN
590 work( i, j ) = b( m-l+i, j )
593 CALL ztrmm(
'L',
'L',
'N',
'N', l, n, one, v( 1, mp ), ldv,
595 CALL zgemm(
'N',
'N', l, n, m-l, one, v, ldv,b, ldb,
596 $ one, work, ldwork )
597 CALL zgemm(
'N',
'N', k-l, n, m, one, v( kp, 1 ), ldv,
598 $ b, ldb, zero, work( kp, 1 ), ldwork )
602 work( i, j ) = work( i, j ) + a( i, j )
606 CALL ztrmm(
'L',
'U', trans,
'N', k, n, one, t, ldt,
611 a( i, j ) = a( i, j ) - work( i, j )
615 CALL zgemm(
'C',
'N', m-l, n, k, -one, v, ldv, work, ldwork,
617 CALL zgemm(
'C',
'N', l, n, k-l, -one, v( kp, mp ), ldv,
618 $ work( kp, 1 ), ldwork, one, b( mp, 1 ), ldb )
619 CALL ztrmm(
'L',
'L',
'C',
'N', l, n, one, v( 1, mp ), ldv,
623 b( m-l+i, j ) = b( m-l+i, j ) - work( i, j )
629 ELSE IF( row .AND. forward .AND. right )
THEN
649 work( i, j ) = b( i, n-l+j )
652 CALL ztrmm(
'R',
'L',
'C',
'N', m, l, one, v( 1, np ), ldv,
654 CALL zgemm(
'N',
'C', m, l, n-l, one, b, ldb, v, ldv,
655 $ one, work, ldwork )
656 CALL zgemm(
'N',
'C', m, k-l, n, one, b, ldb,
657 $ v( kp, 1 ), ldv, zero, work( 1, kp ), ldwork )
661 work( i, j ) = work( i, j ) + a( i, j )
665 CALL ztrmm(
'R',
'U', trans,
'N', m, k, one, t, ldt,
670 a( i, j ) = a( i, j ) - work( i, j )
674 CALL zgemm(
'N',
'N', m, n-l, k, -one, work, ldwork,
675 $ v, ldv, one, b, ldb )
676 CALL zgemm(
'N',
'N', m, l, k-l, -one, work( 1, kp ), ldwork,
677 $ v( kp, np ), ldv, one, b( 1, np ), ldb )
678 CALL ztrmm(
'R',
'L',
'N',
'N', m, l, one, v( 1, np ), ldv,
682 b( i, n-l+j ) = b( i, n-l+j ) - work( i, j )
688 ELSE IF( row .AND. backward .AND. left )
THEN
709 work( k-l+i, j ) = b( i, j )
712 CALL ztrmm(
'L',
'U',
'N',
'N', l, n, one, v( kp, 1 ), ldv,
713 $ work( kp, 1 ), ldwork )
714 CALL zgemm(
'N',
'N', l, n, m-l, one, v( kp, mp ), ldv,
715 $ b( mp, 1 ), ldb, one, work( kp, 1 ), ldwork )
716 CALL zgemm(
'N',
'N', k-l, n, m, one, v, ldv, b, ldb,
717 $ zero, work, ldwork )
721 work( i, j ) = work( i, j ) + a( i, j )
725 CALL ztrmm(
'L',
'L ', trans,
'N', k, n, one, t, ldt,
730 a( i, j ) = a( i, j ) - work( i, j )
734 CALL zgemm(
'C',
'N', m-l, n, k, -one, v( 1, mp ), ldv,
735 $ work, ldwork, one, b( mp, 1 ), ldb )
736 CALL zgemm(
'C',
'N', l, n, k-l, -one, v, ldv,
737 $ work, ldwork, one, b, ldb )
738 CALL ztrmm(
'L',
'U',
'C',
'N', l, n, one, v( kp, 1 ), ldv,
739 $ work( kp, 1 ), ldwork )
742 b( i, j ) = b( i, j ) - work( k-l+i, j )
748 ELSE IF( row .AND. backward .AND. right )
THEN
768 work( i, k-l+j ) = b( i, j )
771 CALL ztrmm(
'R',
'U',
'C',
'N', m, l, one, v( kp, 1 ), ldv,
772 $ work( 1, kp ), ldwork )
773 CALL zgemm(
'N',
'C', m, l, n-l, one, b( 1, np ), ldb,
774 $ v( kp, np ), ldv, one, work( 1, kp ), ldwork )
775 CALL zgemm(
'N',
'C', m, k-l, n, one, b, ldb, v, ldv,
776 $ zero, work, ldwork )
780 work( i, j ) = work( i, j ) + a( i, j )
784 CALL ztrmm(
'R',
'L', trans,
'N', m, k, one, t, ldt,
789 a( i, j ) = a( i, j ) - work( i, j )
793 CALL zgemm(
'N',
'N', m, n-l, k, -one, work, ldwork,
794 $ v( 1, np ), ldv, one, b( 1, np ), ldb )
795 CALL zgemm(
'N',
'N', m, l, k-l , -one, work, ldwork,
796 $ v, ldv, one, b, ldb )
797 CALL ztrmm(
'R',
'U',
'N',
'N', m, l, one, v( kp, 1 ), ldv,
798 $ work( 1, kp ), ldwork )
801 b( i, j ) = b( i, j ) - work( i, k-l+j )
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
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,...
subroutine ztrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
ZTRMM