249 SUBROUTINE dtprfb( 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 DOUBLE PRECISION A( LDA, * ), B( LDB, * ), T( LDT, * ),
262 $ v( ldv, * ), work( ldwork, * )
268 DOUBLE PRECISION ONE, ZERO
269 parameter( one = 1.0, zero = 0.0 )
272 INTEGER I, J, MP, NP, KP
273 LOGICAL LEFT, FORWARD, COLUMN, RIGHT, BACKWARD, ROW
286 IF( m.LE.0 .OR. n.LE.0 .OR. k.LE.0 .OR. l.LT.0 )
RETURN
288 IF( lsame( storev,
'C' ) )
THEN
291 ELSE IF ( lsame( storev,
'R' ) )
THEN
299 IF( lsame( side,
'L' ) )
THEN
302 ELSE IF( lsame( side,
'R' ) )
THEN
310 IF( lsame( direct,
'F' ) )
THEN
313 ELSE IF( lsame( direct,
'B' ) )
THEN
323 IF( column .AND. forward .AND. left )
THEN
345 work( i, j ) = b( m-l+i, j )
348 CALL dtrmm(
'L',
'U',
'T',
'N', l, n, one, v( mp, 1 ), ldv,
350 CALL dgemm(
'T',
'N', l, n, m-l, one, v, ldv, b, ldb,
351 $ one, work, ldwork )
352 CALL dgemm(
'T',
'N', k-l, n, m, one, v( 1, kp ), ldv,
353 $ b, ldb, zero, work( kp, 1 ), ldwork )
357 work( i, j ) = work( i, j ) + a( i, j )
361 CALL dtrmm(
'L',
'U', trans,
'N', k, n, one, t, ldt,
366 a( i, j ) = a( i, j ) - work( i, j )
370 CALL dgemm(
'N',
'N', m-l, n, k, -one, v, ldv, work, ldwork,
372 CALL dgemm(
'N',
'N', l, n, k-l, -one, v( mp, kp ), ldv,
373 $ work( kp, 1 ), ldwork, one, b( mp, 1 ), ldb )
374 CALL dtrmm(
'L',
'U',
'N',
'N', l, n, one, v( mp, 1 ), ldv,
378 b( m-l+i, j ) = b( m-l+i, j ) - work( i, j )
384 ELSE IF( column .AND. forward .AND. right )
THEN
405 work( i, j ) = b( i, n-l+j )
408 CALL dtrmm(
'R',
'U',
'N',
'N', m, l, one, v( np, 1 ), ldv,
410 CALL dgemm(
'N',
'N', m, l, n-l, one, b, ldb,
411 $ v, ldv, one, work, ldwork )
412 CALL dgemm(
'N',
'N', m, k-l, n, one, b, ldb,
413 $ v( 1, kp ), ldv, zero, work( 1, kp ), ldwork )
417 work( i, j ) = work( i, j ) + a( i, j )
421 CALL dtrmm(
'R',
'U', trans,
'N', m, k, one, t, ldt,
426 a( i, j ) = a( i, j ) - work( i, j )
430 CALL dgemm(
'N',
'T', m, n-l, k, -one, work, ldwork,
431 $ v, ldv, one, b, ldb )
432 CALL dgemm(
'N',
'T', m, l, k-l, -one, work( 1, kp ), ldwork,
433 $ v( np, kp ), ldv, one, b( 1, np ), ldb )
434 CALL dtrmm(
'R',
'U',
'T',
'N', m, l, one, v( np, 1 ), ldv,
438 b( i, n-l+j ) = b( i, n-l+j ) - work( i, j )
444 ELSE IF( column .AND. backward .AND. left )
THEN
466 work( k-l+i, j ) = b( i, j )
470 CALL dtrmm(
'L',
'L',
'T',
'N', l, n, one, v( 1, kp ), ldv,
471 $ work( kp, 1 ), ldwork )
472 CALL dgemm(
'T',
'N', l, n, m-l, one, v( mp, kp ), ldv,
473 $ b( mp, 1 ), ldb, one, work( kp, 1 ), ldwork )
474 CALL dgemm(
'T',
'N', k-l, n, m, one, v, ldv,
475 $ b, ldb, zero, work, ldwork )
479 work( i, j ) = work( i, j ) + a( i, j )
483 CALL dtrmm(
'L',
'L', trans,
'N', k, n, one, t, ldt,
488 a( i, j ) = a( i, j ) - work( i, j )
492 CALL dgemm(
'N',
'N', m-l, n, k, -one, v( mp, 1 ), ldv,
493 $ work, ldwork, one, b( mp, 1 ), ldb )
494 CALL dgemm(
'N',
'N', l, n, k-l, -one, v, ldv,
495 $ work, ldwork, one, b, ldb )
496 CALL dtrmm(
'L',
'L',
'N',
'N', l, n, one, v( 1, kp ), ldv,
497 $ work( kp, 1 ), ldwork )
500 b( i, j ) = b( i, j ) - work( k-l+i, j )
506 ELSE IF( column .AND. backward .AND. right )
THEN
527 work( i, k-l+j ) = b( i, j )
530 CALL dtrmm(
'R',
'L',
'N',
'N', m, l, one, v( 1, kp ), ldv,
531 $ work( 1, kp ), ldwork )
532 CALL dgemm(
'N',
'N', m, l, n-l, one, b( 1, np ), ldb,
533 $ v( np, kp ), ldv, one, work( 1, kp ), ldwork )
534 CALL dgemm(
'N',
'N', m, k-l, n, one, b, ldb,
535 $ v, ldv, zero, work, ldwork )
539 work( i, j ) = work( i, j ) + a( i, j )
543 CALL dtrmm(
'R',
'L', trans,
'N', m, k, one, t, ldt,
548 a( i, j ) = a( i, j ) - work( i, j )
552 CALL dgemm(
'N',
'T', m, n-l, k, -one, work, ldwork,
553 $ v( np, 1 ), ldv, one, b( 1, np ), ldb )
554 CALL dgemm(
'N',
'T', m, l, k-l, -one, work, ldwork,
555 $ v, ldv, one, b, ldb )
556 CALL dtrmm(
'R',
'L',
'T',
'N', m, l, one, v( 1, kp ), ldv,
557 $ work( 1, kp ), ldwork )
560 b( i, j ) = b( i, j ) - work( i, k-l+j )
566 ELSE IF( row .AND. forward .AND. left )
THEN
587 work( i, j ) = b( m-l+i, j )
590 CALL dtrmm(
'L',
'L',
'N',
'N', l, n, one, v( 1, mp ), ldv,
592 CALL dgemm(
'N',
'N', l, n, m-l, one, v, ldv,b, ldb,
593 $ one, work, ldwork )
594 CALL dgemm(
'N',
'N', k-l, n, m, one, v( kp, 1 ), ldv,
595 $ b, ldb, zero, work( kp, 1 ), ldwork )
599 work( i, j ) = work( i, j ) + a( i, j )
603 CALL dtrmm(
'L',
'U', trans,
'N', k, n, one, t, ldt,
608 a( i, j ) = a( i, j ) - work( i, j )
612 CALL dgemm(
'T',
'N', m-l, n, k, -one, v, ldv, work, ldwork,
614 CALL dgemm(
'T',
'N', l, n, k-l, -one, v( kp, mp ), ldv,
615 $ work( kp, 1 ), ldwork, one, b( mp, 1 ), ldb )
616 CALL dtrmm(
'L',
'L',
'T',
'N', l, n, one, v( 1, mp ), ldv,
620 b( m-l+i, j ) = b( m-l+i, j ) - work( i, j )
626 ELSE IF( row .AND. forward .AND. right )
THEN
646 work( i, j ) = b( i, n-l+j )
649 CALL dtrmm(
'R',
'L',
'T',
'N', m, l, one, v( 1, np ), ldv,
651 CALL dgemm(
'N',
'T', m, l, n-l, one, b, ldb, v, ldv,
652 $ one, work, ldwork )
653 CALL dgemm(
'N',
'T', m, k-l, n, one, b, ldb,
654 $ v( kp, 1 ), ldv, zero, work( 1, kp ), ldwork )
658 work( i, j ) = work( i, j ) + a( i, j )
662 CALL dtrmm(
'R',
'U', trans,
'N', m, k, one, t, ldt,
667 a( i, j ) = a( i, j ) - work( i, j )
671 CALL dgemm(
'N',
'N', m, n-l, k, -one, work, ldwork,
672 $ v, ldv, one, b, ldb )
673 CALL dgemm(
'N',
'N', m, l, k-l, -one, work( 1, kp ), ldwork,
674 $ v( kp, np ), ldv, one, b( 1, np ), ldb )
675 CALL dtrmm(
'R',
'L',
'N',
'N', m, l, one, v( 1, np ), ldv,
679 b( i, n-l+j ) = b( i, n-l+j ) - work( i, j )
685 ELSE IF( row .AND. backward .AND. left )
THEN
706 work( k-l+i, j ) = b( i, j )
709 CALL dtrmm(
'L',
'U',
'N',
'N', l, n, one, v( kp, 1 ), ldv,
710 $ work( kp, 1 ), ldwork )
711 CALL dgemm(
'N',
'N', l, n, m-l, one, v( kp, mp ), ldv,
712 $ b( mp, 1 ), ldb, one, work( kp, 1 ), ldwork )
713 CALL dgemm(
'N',
'N', k-l, n, m, one, v, ldv, b, ldb,
714 $ zero, work, ldwork )
718 work( i, j ) = work( i, j ) + a( i, j )
722 CALL dtrmm(
'L',
'L ', trans,
'N', k, n, one, t, ldt,
727 a( i, j ) = a( i, j ) - work( i, j )
731 CALL dgemm(
'T',
'N', m-l, n, k, -one, v( 1, mp ), ldv,
732 $ work, ldwork, one, b( mp, 1 ), ldb )
733 CALL dgemm(
'T',
'N', l, n, k-l, -one, v, ldv,
734 $ work, ldwork, one, b, ldb )
735 CALL dtrmm(
'L',
'U',
'T',
'N', l, n, one, v( kp, 1 ), ldv,
736 $ work( kp, 1 ), ldwork )
739 b( i, j ) = b( i, j ) - work( k-l+i, j )
745 ELSE IF( row .AND. backward .AND. right )
THEN
765 work( i, k-l+j ) = b( i, j )
768 CALL dtrmm(
'R',
'U',
'T',
'N', m, l, one, v( kp, 1 ), ldv,
769 $ work( 1, kp ), ldwork )
770 CALL dgemm(
'N',
'T', m, l, n-l, one, b( 1, np ), ldb,
771 $ v( kp, np ), ldv, one, work( 1, kp ), ldwork )
772 CALL dgemm(
'N',
'T', m, k-l, n, one, b, ldb, v, ldv,
773 $ zero, work, ldwork )
777 work( i, j ) = work( i, j ) + a( i, j )
781 CALL dtrmm(
'R',
'L', trans,
'N', m, k, one, t, ldt,
786 a( i, j ) = a( i, j ) - work( i, j )
790 CALL dgemm(
'N',
'N', m, n-l, k, -one, work, ldwork,
791 $ v( 1, np ), ldv, one, b( 1, np ), ldb )
792 CALL dgemm(
'N',
'N', m, l, k-l , -one, work, ldwork,
793 $ v, ldv, one, b, ldb )
794 CALL dtrmm(
'R',
'U',
'N',
'N', m, l, one, v( kp, 1 ), ldv,
795 $ work( 1, kp ), ldwork )
798 b( i, j ) = b( i, j ) - work( i, k-l+j )
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
subroutine dtprfb(side, trans, direct, storev, m, n, k, l, v, ldv, t, ldt, a, lda, b, ldb, work, ldwork)
DTPRFB applies a real "triangular-pentagonal" block reflector to a real matrix, which is composed of ...
subroutine dtrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
DTRMM