274 SUBROUTINE dtfsm( TRANSR, SIDE, UPLO, TRANS, DIAG, M, N, ALPHA,
283 CHARACTER TRANSR, DIAG, SIDE, TRANS, UPLO
285 DOUBLE PRECISION ALPHA
288 DOUBLE PRECISION A( 0: * ), B( 0: LDB-1, 0: * )
295 DOUBLE PRECISION ONE, ZERO
296 PARAMETER ( ONE = 1.0d+0, zero = 0.0d+0 )
299 LOGICAL LOWER, LSIDE, MISODD, NISODD, NORMALTRANSR,
301 INTEGER M1, M2, N1, N2, K, INFO, I, J
318 normaltransr = lsame( transr,
'N' )
319 lside = lsame( side,
'L' )
320 lower = lsame( uplo,
'L' )
321 notrans = lsame( trans,
'N' )
322 IF( .NOT.normaltransr .AND. .NOT.lsame( transr,
'T' ) )
THEN
324 ELSE IF( .NOT.lside .AND. .NOT.lsame( side,
'R' ) )
THEN
326 ELSE IF( .NOT.lower .AND. .NOT.lsame( uplo,
'U' ) )
THEN
328 ELSE IF( .NOT.notrans .AND. .NOT.lsame( trans,
'T' ) )
THEN
330 ELSE IF( .NOT.lsame( diag,
'N' ) .AND.
331 $ .NOT.lsame( diag,
'U' ) )
334 ELSE IF( m.LT.0 )
THEN
336 ELSE IF( n.LT.0 )
THEN
338 ELSE IF( ldb.LT.max( 1, m ) )
THEN
342 CALL xerbla(
'DTFSM ', -info )
348 IF( ( m.EQ.0 ) .OR. ( n.EQ.0 ) )
353 IF( alpha.EQ.zero )
THEN
370 IF( mod( m, 2 ).EQ.0 )
THEN
389 IF( normaltransr )
THEN
403 CALL dtrsm(
'L',
'L',
'N', diag, m1, n,
407 CALL dtrsm(
'L',
'L',
'N', diag, m1, n,
409 $ a( 0 ), m, b, ldb )
410 CALL dgemm(
'N',
'N', m2, n, m1, -one,
412 $ m, b, ldb, alpha, b( m1, 0 ), ldb )
413 CALL dtrsm(
'L',
'U',
'T', diag, m2, n, one,
414 $ a( m ), m, b( m1, 0 ), ldb )
423 CALL dtrsm(
'L',
'L',
'T', diag, m1, n,
425 $ a( 0 ), m, b, ldb )
427 CALL dtrsm(
'L',
'U',
'N', diag, m2, n,
429 $ a( m ), m, b( m1, 0 ), ldb )
430 CALL dgemm(
'T',
'N', m1, n, m2, -one,
432 $ m, b( m1, 0 ), ldb, alpha, b, ldb )
433 CALL dtrsm(
'L',
'L',
'T', diag, m1, n, one,
434 $ a( 0 ), m, b, ldb )
443 IF( .NOT.notrans )
THEN
448 CALL dtrsm(
'L',
'L',
'N', diag, m1, n, alpha,
449 $ a( m2 ), m, b, ldb )
450 CALL dgemm(
'T',
'N', m2, n, m1, -one, a( 0 ),
452 $ b, ldb, alpha, b( m1, 0 ), ldb )
453 CALL dtrsm(
'L',
'U',
'T', diag, m2, n, one,
454 $ a( m1 ), m, b( m1, 0 ), ldb )
461 CALL dtrsm(
'L',
'U',
'N', diag, m2, n, alpha,
462 $ a( m1 ), m, b( m1, 0 ), ldb )
463 CALL dgemm(
'N',
'N', m1, n, m2, -one, a( 0 ),
465 $ b( m1, 0 ), ldb, alpha, b, ldb )
466 CALL dtrsm(
'L',
'L',
'T', diag, m1, n, one,
467 $ a( m2 ), m, b, ldb )
487 CALL dtrsm(
'L',
'U',
'T', diag, m1, n,
489 $ a( 0 ), m1, b, ldb )
491 CALL dtrsm(
'L',
'U',
'T', diag, m1, n,
493 $ a( 0 ), m1, b, ldb )
494 CALL dgemm(
'T',
'N', m2, n, m1, -one,
495 $ a( m1*m1 ), m1, b, ldb, alpha,
497 CALL dtrsm(
'L',
'L',
'N', diag, m2, n, one,
498 $ a( 1 ), m1, b( m1, 0 ), ldb )
507 CALL dtrsm(
'L',
'U',
'N', diag, m1, n,
509 $ a( 0 ), m1, b, ldb )
511 CALL dtrsm(
'L',
'L',
'T', diag, m2, n,
513 $ a( 1 ), m1, b( m1, 0 ), ldb )
514 CALL dgemm(
'N',
'N', m1, n, m2, -one,
515 $ a( m1*m1 ), m1, b( m1, 0 ), ldb,
517 CALL dtrsm(
'L',
'U',
'N', diag, m1, n, one,
518 $ a( 0 ), m1, b, ldb )
527 IF( .NOT.notrans )
THEN
532 CALL dtrsm(
'L',
'U',
'T', diag, m1, n, alpha,
533 $ a( m2*m2 ), m2, b, ldb )
534 CALL dgemm(
'N',
'N', m2, n, m1, -one, a( 0 ),
536 $ b, ldb, alpha, b( m1, 0 ), ldb )
537 CALL dtrsm(
'L',
'L',
'N', diag, m2, n, one,
538 $ a( m1*m2 ), m2, b( m1, 0 ), ldb )
545 CALL dtrsm(
'L',
'L',
'T', diag, m2, n, alpha,
546 $ a( m1*m2 ), m2, b( m1, 0 ), ldb )
547 CALL dgemm(
'T',
'N', m1, n, m2, -one, a( 0 ),
549 $ b( m1, 0 ), ldb, alpha, b, ldb )
550 CALL dtrsm(
'L',
'U',
'N', diag, m1, n, one,
551 $ a( m2*m2 ), m2, b, ldb )
563 IF( normaltransr )
THEN
576 CALL dtrsm(
'L',
'L',
'N', diag, k, n, alpha,
577 $ a( 1 ), m+1, b, ldb )
578 CALL dgemm(
'N',
'N', k, n, k, -one, a( k+1 ),
579 $ m+1, b, ldb, alpha, b( k, 0 ), ldb )
580 CALL dtrsm(
'L',
'U',
'T', diag, k, n, one,
581 $ a( 0 ), m+1, b( k, 0 ), ldb )
588 CALL dtrsm(
'L',
'U',
'N', diag, k, n, alpha,
589 $ a( 0 ), m+1, b( k, 0 ), ldb )
590 CALL dgemm(
'T',
'N', k, n, k, -one, a( k+1 ),
591 $ m+1, b( k, 0 ), ldb, alpha, b, ldb )
592 CALL dtrsm(
'L',
'L',
'T', diag, k, n, one,
593 $ a( 1 ), m+1, b, ldb )
601 IF( .NOT.notrans )
THEN
606 CALL dtrsm(
'L',
'L',
'N', diag, k, n, alpha,
607 $ a( k+1 ), m+1, b, ldb )
608 CALL dgemm(
'T',
'N', k, n, k, -one, a( 0 ),
610 $ b, ldb, alpha, b( k, 0 ), ldb )
611 CALL dtrsm(
'L',
'U',
'T', diag, k, n, one,
612 $ a( k ), m+1, b( k, 0 ), ldb )
618 CALL dtrsm(
'L',
'U',
'N', diag, k, n, alpha,
619 $ a( k ), m+1, b( k, 0 ), ldb )
620 CALL dgemm(
'N',
'N', k, n, k, -one, a( 0 ),
622 $ b( k, 0 ), ldb, alpha, b, ldb )
623 CALL dtrsm(
'L',
'L',
'T', diag, k, n, one,
624 $ a( k+1 ), m+1, b, ldb )
643 CALL dtrsm(
'L',
'U',
'T', diag, k, n, alpha,
644 $ a( k ), k, b, ldb )
645 CALL dgemm(
'T',
'N', k, n, k, -one,
646 $ a( k*( k+1 ) ), k, b, ldb, alpha,
648 CALL dtrsm(
'L',
'L',
'N', diag, k, n, one,
649 $ a( 0 ), k, b( k, 0 ), ldb )
656 CALL dtrsm(
'L',
'L',
'T', diag, k, n, alpha,
657 $ a( 0 ), k, b( k, 0 ), ldb )
658 CALL dgemm(
'N',
'N', k, n, k, -one,
659 $ a( k*( k+1 ) ), k, b( k, 0 ), ldb,
661 CALL dtrsm(
'L',
'U',
'N', diag, k, n, one,
662 $ a( k ), k, b, ldb )
670 IF( .NOT.notrans )
THEN
675 CALL dtrsm(
'L',
'U',
'T', diag, k, n, alpha,
676 $ a( k*( k+1 ) ), k, b, ldb )
677 CALL dgemm(
'N',
'N', k, n, k, -one, a( 0 ), k,
679 $ ldb, alpha, b( k, 0 ), ldb )
680 CALL dtrsm(
'L',
'L',
'N', diag, k, n, one,
681 $ a( k*k ), k, b( k, 0 ), ldb )
688 CALL dtrsm(
'L',
'L',
'T', diag, k, n, alpha,
689 $ a( k*k ), k, b( k, 0 ), ldb )
690 CALL dgemm(
'T',
'N', k, n, k, -one, a( 0 ), k,
691 $ b( k, 0 ), ldb, alpha, b, ldb )
692 CALL dtrsm(
'L',
'U',
'N', diag, k, n, one,
693 $ a( k*( k+1 ) ), k, b, ldb )
711 IF( mod( n, 2 ).EQ.0 )
THEN
729 IF( normaltransr )
THEN
742 CALL dtrsm(
'R',
'U',
'T', diag, m, n2, alpha,
743 $ a( n ), n, b( 0, n1 ), ldb )
744 CALL dgemm(
'N',
'N', m, n1, n2, -one, b( 0,
746 $ ldb, a( n1 ), n, alpha, b( 0, 0 ),
748 CALL dtrsm(
'R',
'L',
'N', diag, m, n1, one,
749 $ a( 0 ), n, b( 0, 0 ), ldb )
756 CALL dtrsm(
'R',
'L',
'T', diag, m, n1, alpha,
757 $ a( 0 ), n, b( 0, 0 ), ldb )
758 CALL dgemm(
'N',
'T', m, n2, n1, -one, b( 0,
760 $ ldb, a( n1 ), n, alpha, b( 0, n1 ),
762 CALL dtrsm(
'R',
'U',
'N', diag, m, n2, one,
763 $ a( n ), n, b( 0, n1 ), ldb )
776 CALL dtrsm(
'R',
'L',
'T', diag, m, n1, alpha,
777 $ a( n2 ), n, b( 0, 0 ), ldb )
778 CALL dgemm(
'N',
'N', m, n2, n1, -one, b( 0,
780 $ ldb, a( 0 ), n, alpha, b( 0, n1 ),
782 CALL dtrsm(
'R',
'U',
'N', diag, m, n2, one,
783 $ a( n1 ), n, b( 0, n1 ), ldb )
790 CALL dtrsm(
'R',
'U',
'T', diag, m, n2, alpha,
791 $ a( n1 ), n, b( 0, n1 ), ldb )
792 CALL dgemm(
'N',
'T', m, n1, n2, -one, b( 0,
794 $ ldb, a( 0 ), n, alpha, b( 0, 0 ), ldb )
795 CALL dtrsm(
'R',
'L',
'N', diag, m, n1, one,
796 $ a( n2 ), n, b( 0, 0 ), ldb )
815 CALL dtrsm(
'R',
'L',
'N', diag, m, n2, alpha,
816 $ a( 1 ), n1, b( 0, n1 ), ldb )
817 CALL dgemm(
'N',
'T', m, n1, n2, -one, b( 0,
819 $ ldb, a( n1*n1 ), n1, alpha, b( 0, 0 ),
821 CALL dtrsm(
'R',
'U',
'T', diag, m, n1, one,
822 $ a( 0 ), n1, b( 0, 0 ), ldb )
829 CALL dtrsm(
'R',
'U',
'N', diag, m, n1, alpha,
830 $ a( 0 ), n1, b( 0, 0 ), ldb )
831 CALL dgemm(
'N',
'N', m, n2, n1, -one, b( 0,
833 $ ldb, a( n1*n1 ), n1, alpha, b( 0, n1 ),
835 CALL dtrsm(
'R',
'L',
'T', diag, m, n2, one,
836 $ a( 1 ), n1, b( 0, n1 ), ldb )
849 CALL dtrsm(
'R',
'U',
'N', diag, m, n1, alpha,
850 $ a( n2*n2 ), n2, b( 0, 0 ), ldb )
851 CALL dgemm(
'N',
'T', m, n2, n1, -one, b( 0,
853 $ ldb, a( 0 ), n2, alpha, b( 0, n1 ),
855 CALL dtrsm(
'R',
'L',
'T', diag, m, n2, one,
856 $ a( n1*n2 ), n2, b( 0, n1 ), ldb )
863 CALL dtrsm(
'R',
'L',
'N', diag, m, n2, alpha,
864 $ a( n1*n2 ), n2, b( 0, n1 ), ldb )
865 CALL dgemm(
'N',
'N', m, n1, n2, -one, b( 0,
867 $ ldb, a( 0 ), n2, alpha, b( 0, 0 ),
869 CALL dtrsm(
'R',
'U',
'T', diag, m, n1, one,
870 $ a( n2*n2 ), n2, b( 0, 0 ), ldb )
882 IF( normaltransr )
THEN
895 CALL dtrsm(
'R',
'U',
'T', diag, m, k, alpha,
896 $ a( 0 ), n+1, b( 0, k ), ldb )
897 CALL dgemm(
'N',
'N', m, k, k, -one, b( 0, k ),
898 $ ldb, a( k+1 ), n+1, alpha, b( 0, 0 ),
900 CALL dtrsm(
'R',
'L',
'N', diag, m, k, one,
901 $ a( 1 ), n+1, b( 0, 0 ), ldb )
908 CALL dtrsm(
'R',
'L',
'T', diag, m, k, alpha,
909 $ a( 1 ), n+1, b( 0, 0 ), ldb )
910 CALL dgemm(
'N',
'T', m, k, k, -one, b( 0, 0 ),
911 $ ldb, a( k+1 ), n+1, alpha, b( 0, k ),
913 CALL dtrsm(
'R',
'U',
'N', diag, m, k, one,
914 $ a( 0 ), n+1, b( 0, k ), ldb )
927 CALL dtrsm(
'R',
'L',
'T', diag, m, k, alpha,
928 $ a( k+1 ), n+1, b( 0, 0 ), ldb )
929 CALL dgemm(
'N',
'N', m, k, k, -one, b( 0, 0 ),
930 $ ldb, a( 0 ), n+1, alpha, b( 0, k ),
932 CALL dtrsm(
'R',
'U',
'N', diag, m, k, one,
933 $ a( k ), n+1, b( 0, k ), ldb )
940 CALL dtrsm(
'R',
'U',
'T', diag, m, k, alpha,
941 $ a( k ), n+1, b( 0, k ), ldb )
942 CALL dgemm(
'N',
'T', m, k, k, -one, b( 0, k ),
943 $ ldb, a( 0 ), n+1, alpha, b( 0, 0 ),
945 CALL dtrsm(
'R',
'L',
'N', diag, m, k, one,
946 $ a( k+1 ), n+1, b( 0, 0 ), ldb )
965 CALL dtrsm(
'R',
'L',
'N', diag, m, k, alpha,
966 $ a( 0 ), k, b( 0, k ), ldb )
967 CALL dgemm(
'N',
'T', m, k, k, -one, b( 0, k ),
968 $ ldb, a( ( k+1 )*k ), k, alpha,
970 CALL dtrsm(
'R',
'U',
'T', diag, m, k, one,
971 $ a( k ), k, b( 0, 0 ), ldb )
978 CALL dtrsm(
'R',
'U',
'N', diag, m, k, alpha,
979 $ a( k ), k, b( 0, 0 ), ldb )
980 CALL dgemm(
'N',
'N', m, k, k, -one, b( 0, 0 ),
981 $ ldb, a( ( k+1 )*k ), k, alpha,
983 CALL dtrsm(
'R',
'L',
'T', diag, m, k, one,
984 $ a( 0 ), k, b( 0, k ), ldb )
997 CALL dtrsm(
'R',
'U',
'N', diag, m, k, alpha,
998 $ a( ( k+1 )*k ), k, b( 0, 0 ), ldb )
999 CALL dgemm(
'N',
'T', m, k, k, -one, b( 0, 0 ),
1000 $ ldb, a( 0 ), k, alpha, b( 0, k ), ldb )
1001 CALL dtrsm(
'R',
'L',
'T', diag, m, k, one,
1002 $ a( k*k ), k, b( 0, k ), ldb )
1009 CALL dtrsm(
'R',
'L',
'N', diag, m, k, alpha,
1010 $ a( k*k ), k, b( 0, k ), ldb )
1011 CALL dgemm(
'N',
'N', m, k, k, -one, b( 0, k ),
1012 $ ldb, a( 0 ), k, alpha, b( 0, 0 ), ldb )
1013 CALL dtrsm(
'R',
'U',
'T', diag, m, k, one,
1014 $ a( ( k+1 )*k ), k, b( 0, 0 ), ldb )