275 SUBROUTINE dtfsm( TRANSR, SIDE, UPLO, TRANS, DIAG, M, N, ALPHA, A,
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. .NOT.lsame( diag,
'U' ) )
333 ELSE IF( m.LT.0 )
THEN
335 ELSE IF( n.LT.0 )
THEN
337 ELSE IF( ldb.LT.max( 1, m ) )
THEN
341 CALL xerbla(
'DTFSM ', -info )
347 IF( ( m.EQ.0 ) .OR. ( n.EQ.0 ) )
352 IF( alpha.EQ.zero )
THEN
369 IF( mod( m, 2 ).EQ.0 )
THEN
388 IF( normaltransr )
THEN
402 CALL dtrsm(
'L',
'L',
'N', diag, m1, n, alpha,
405 CALL dtrsm(
'L',
'L',
'N', diag, m1, n, alpha,
406 $ a( 0 ), m, b, ldb )
407 CALL dgemm(
'N',
'N', m2, n, m1, -one, a( m1 ),
408 $ m, b, ldb, alpha, b( m1, 0 ), ldb )
409 CALL dtrsm(
'L',
'U',
'T', diag, m2, n, one,
410 $ a( m ), m, b( m1, 0 ), ldb )
419 CALL dtrsm(
'L',
'L',
'T', diag, m1, n, alpha,
420 $ a( 0 ), m, b, ldb )
422 CALL dtrsm(
'L',
'U',
'N', diag, m2, n, alpha,
423 $ a( m ), m, b( m1, 0 ), ldb )
424 CALL dgemm(
'T',
'N', m1, n, m2, -one, a( m1 ),
425 $ m, b( m1, 0 ), ldb, alpha, b, ldb )
426 CALL dtrsm(
'L',
'L',
'T', diag, m1, n, one,
427 $ a( 0 ), m, b, ldb )
436 IF( .NOT.notrans )
THEN
441 CALL dtrsm(
'L',
'L',
'N', diag, m1, n, alpha,
442 $ a( m2 ), m, b, ldb )
443 CALL dgemm(
'T',
'N', m2, n, m1, -one, a( 0 ), m,
444 $ b, ldb, alpha, b( m1, 0 ), ldb )
445 CALL dtrsm(
'L',
'U',
'T', diag, m2, n, one,
446 $ a( m1 ), m, b( m1, 0 ), ldb )
453 CALL dtrsm(
'L',
'U',
'N', diag, m2, n, alpha,
454 $ a( m1 ), m, b( m1, 0 ), ldb )
455 CALL dgemm(
'N',
'N', m1, n, m2, -one, a( 0 ), m,
456 $ b( m1, 0 ), ldb, alpha, b, ldb )
457 CALL dtrsm(
'L',
'L',
'T', diag, m1, n, one,
458 $ a( m2 ), m, b, ldb )
478 CALL dtrsm(
'L',
'U',
'T', diag, m1, n, alpha,
479 $ a( 0 ), m1, b, ldb )
481 CALL dtrsm(
'L',
'U',
'T', diag, m1, n, alpha,
482 $ a( 0 ), m1, b, ldb )
483 CALL dgemm(
'T',
'N', m2, n, m1, -one,
484 $ a( m1*m1 ), m1, b, ldb, alpha,
486 CALL dtrsm(
'L',
'L',
'N', diag, m2, n, one,
487 $ a( 1 ), m1, b( m1, 0 ), ldb )
496 CALL dtrsm(
'L',
'U',
'N', diag, m1, n, alpha,
497 $ a( 0 ), m1, b, ldb )
499 CALL dtrsm(
'L',
'L',
'T', diag, m2, n, alpha,
500 $ a( 1 ), m1, b( m1, 0 ), ldb )
501 CALL dgemm(
'N',
'N', m1, n, m2, -one,
502 $ a( m1*m1 ), m1, b( m1, 0 ), ldb,
504 CALL dtrsm(
'L',
'U',
'N', diag, m1, n, one,
505 $ a( 0 ), m1, b, ldb )
514 IF( .NOT.notrans )
THEN
519 CALL dtrsm(
'L',
'U',
'T', diag, m1, n, alpha,
520 $ a( m2*m2 ), m2, b, ldb )
521 CALL dgemm(
'N',
'N', m2, n, m1, -one, a( 0 ), m2,
522 $ b, ldb, alpha, b( m1, 0 ), ldb )
523 CALL dtrsm(
'L',
'L',
'N', diag, m2, n, one,
524 $ a( m1*m2 ), m2, b( m1, 0 ), ldb )
531 CALL dtrsm(
'L',
'L',
'T', diag, m2, n, alpha,
532 $ a( m1*m2 ), m2, b( m1, 0 ), ldb )
533 CALL dgemm(
'T',
'N', m1, n, m2, -one, a( 0 ), m2,
534 $ b( m1, 0 ), ldb, alpha, b, ldb )
535 CALL dtrsm(
'L',
'U',
'N', diag, m1, n, one,
536 $ a( m2*m2 ), m2, b, ldb )
548 IF( normaltransr )
THEN
561 CALL dtrsm(
'L',
'L',
'N', diag, k, n, alpha,
562 $ a( 1 ), m+1, b, ldb )
563 CALL dgemm(
'N',
'N', k, n, k, -one, a( k+1 ),
564 $ m+1, b, ldb, alpha, b( k, 0 ), ldb )
565 CALL dtrsm(
'L',
'U',
'T', diag, k, n, one,
566 $ a( 0 ), m+1, b( k, 0 ), ldb )
573 CALL dtrsm(
'L',
'U',
'N', diag, k, n, alpha,
574 $ a( 0 ), m+1, b( k, 0 ), ldb )
575 CALL dgemm(
'T',
'N', k, n, k, -one, a( k+1 ),
576 $ m+1, b( k, 0 ), ldb, alpha, b, ldb )
577 CALL dtrsm(
'L',
'L',
'T', diag, k, n, one,
578 $ a( 1 ), m+1, b, ldb )
586 IF( .NOT.notrans )
THEN
591 CALL dtrsm(
'L',
'L',
'N', diag, k, n, alpha,
592 $ a( k+1 ), m+1, b, ldb )
593 CALL dgemm(
'T',
'N', k, n, k, -one, a( 0 ), m+1,
594 $ b, ldb, alpha, b( k, 0 ), ldb )
595 CALL dtrsm(
'L',
'U',
'T', diag, k, n, one,
596 $ a( k ), m+1, b( k, 0 ), ldb )
602 CALL dtrsm(
'L',
'U',
'N', diag, k, n, alpha,
603 $ a( k ), m+1, b( k, 0 ), ldb )
604 CALL dgemm(
'N',
'N', k, n, k, -one, a( 0 ), m+1,
605 $ b( k, 0 ), ldb, alpha, b, ldb )
606 CALL dtrsm(
'L',
'L',
'T', diag, k, n, one,
607 $ a( k+1 ), m+1, b, ldb )
626 CALL dtrsm(
'L',
'U',
'T', diag, k, n, alpha,
627 $ a( k ), k, b, ldb )
628 CALL dgemm(
'T',
'N', k, n, k, -one,
629 $ a( k*( k+1 ) ), k, b, ldb, alpha,
631 CALL dtrsm(
'L',
'L',
'N', diag, k, n, one,
632 $ a( 0 ), k, b( k, 0 ), ldb )
639 CALL dtrsm(
'L',
'L',
'T', diag, k, n, alpha,
640 $ a( 0 ), k, b( k, 0 ), ldb )
641 CALL dgemm(
'N',
'N', k, n, k, -one,
642 $ a( k*( k+1 ) ), k, b( k, 0 ), ldb,
644 CALL dtrsm(
'L',
'U',
'N', diag, k, n, one,
645 $ a( k ), k, b, ldb )
653 IF( .NOT.notrans )
THEN
658 CALL dtrsm(
'L',
'U',
'T', diag, k, n, alpha,
659 $ a( k*( k+1 ) ), k, b, ldb )
660 CALL dgemm(
'N',
'N', k, n, k, -one, a( 0 ), k, b,
661 $ ldb, alpha, b( k, 0 ), ldb )
662 CALL dtrsm(
'L',
'L',
'N', diag, k, n, one,
663 $ a( k*k ), k, b( k, 0 ), ldb )
670 CALL dtrsm(
'L',
'L',
'T', diag, k, n, alpha,
671 $ a( k*k ), k, b( k, 0 ), ldb )
672 CALL dgemm(
'T',
'N', k, n, k, -one, a( 0 ), k,
673 $ b( k, 0 ), ldb, alpha, b, ldb )
674 CALL dtrsm(
'L',
'U',
'N', diag, k, n, one,
675 $ a( k*( k+1 ) ), k, b, ldb )
693 IF( mod( n, 2 ).EQ.0 )
THEN
711 IF( normaltransr )
THEN
724 CALL dtrsm(
'R',
'U',
'T', diag, m, n2, alpha,
725 $ a( n ), n, b( 0, n1 ), ldb )
726 CALL dgemm(
'N',
'N', m, n1, n2, -one, b( 0, n1 ),
727 $ ldb, a( n1 ), n, alpha, b( 0, 0 ),
729 CALL dtrsm(
'R',
'L',
'N', diag, m, n1, one,
730 $ a( 0 ), n, b( 0, 0 ), ldb )
737 CALL dtrsm(
'R',
'L',
'T', diag, m, n1, alpha,
738 $ a( 0 ), n, b( 0, 0 ), ldb )
739 CALL dgemm(
'N',
'T', m, n2, n1, -one, b( 0, 0 ),
740 $ ldb, a( n1 ), n, alpha, b( 0, n1 ),
742 CALL dtrsm(
'R',
'U',
'N', diag, m, n2, one,
743 $ a( n ), n, b( 0, n1 ), ldb )
756 CALL dtrsm(
'R',
'L',
'T', diag, m, n1, alpha,
757 $ a( n2 ), n, b( 0, 0 ), ldb )
758 CALL dgemm(
'N',
'N', m, n2, n1, -one, b( 0, 0 ),
759 $ ldb, a( 0 ), n, alpha, b( 0, n1 ),
761 CALL dtrsm(
'R',
'U',
'N', diag, m, n2, one,
762 $ a( n1 ), n, b( 0, n1 ), ldb )
769 CALL dtrsm(
'R',
'U',
'T', diag, m, n2, alpha,
770 $ a( n1 ), n, b( 0, n1 ), ldb )
771 CALL dgemm(
'N',
'T', m, n1, n2, -one, b( 0, n1 ),
772 $ ldb, a( 0 ), n, alpha, b( 0, 0 ), ldb )
773 CALL dtrsm(
'R',
'L',
'N', diag, m, n1, one,
774 $ a( n2 ), n, b( 0, 0 ), ldb )
793 CALL dtrsm(
'R',
'L',
'N', diag, m, n2, alpha,
794 $ a( 1 ), n1, b( 0, n1 ), ldb )
795 CALL dgemm(
'N',
'T', m, n1, n2, -one, b( 0, n1 ),
796 $ ldb, a( n1*n1 ), n1, alpha, b( 0, 0 ),
798 CALL dtrsm(
'R',
'U',
'T', diag, m, n1, one,
799 $ a( 0 ), n1, b( 0, 0 ), ldb )
806 CALL dtrsm(
'R',
'U',
'N', diag, m, n1, alpha,
807 $ a( 0 ), n1, b( 0, 0 ), ldb )
808 CALL dgemm(
'N',
'N', m, n2, n1, -one, b( 0, 0 ),
809 $ ldb, a( n1*n1 ), n1, alpha, b( 0, n1 ),
811 CALL dtrsm(
'R',
'L',
'T', diag, m, n2, one,
812 $ a( 1 ), n1, b( 0, n1 ), ldb )
825 CALL dtrsm(
'R',
'U',
'N', diag, m, n1, alpha,
826 $ a( n2*n2 ), n2, b( 0, 0 ), ldb )
827 CALL dgemm(
'N',
'T', m, n2, n1, -one, b( 0, 0 ),
828 $ ldb, a( 0 ), n2, alpha, b( 0, n1 ),
830 CALL dtrsm(
'R',
'L',
'T', diag, m, n2, one,
831 $ a( n1*n2 ), n2, b( 0, n1 ), ldb )
838 CALL dtrsm(
'R',
'L',
'N', diag, m, n2, alpha,
839 $ a( n1*n2 ), n2, b( 0, n1 ), ldb )
840 CALL dgemm(
'N',
'N', m, n1, n2, -one, b( 0, n1 ),
841 $ ldb, a( 0 ), n2, alpha, b( 0, 0 ),
843 CALL dtrsm(
'R',
'U',
'T', diag, m, n1, one,
844 $ a( n2*n2 ), n2, b( 0, 0 ), ldb )
856 IF( normaltransr )
THEN
869 CALL dtrsm(
'R',
'U',
'T', diag, m, k, alpha,
870 $ a( 0 ), n+1, b( 0, k ), ldb )
871 CALL dgemm(
'N',
'N', m, k, k, -one, b( 0, k ),
872 $ ldb, a( k+1 ), n+1, alpha, b( 0, 0 ),
874 CALL dtrsm(
'R',
'L',
'N', diag, m, k, one,
875 $ a( 1 ), n+1, b( 0, 0 ), ldb )
882 CALL dtrsm(
'R',
'L',
'T', diag, m, k, alpha,
883 $ a( 1 ), n+1, b( 0, 0 ), ldb )
884 CALL dgemm(
'N',
'T', m, k, k, -one, b( 0, 0 ),
885 $ ldb, a( k+1 ), n+1, alpha, b( 0, k ),
887 CALL dtrsm(
'R',
'U',
'N', diag, m, k, one,
888 $ a( 0 ), n+1, b( 0, k ), ldb )
901 CALL dtrsm(
'R',
'L',
'T', diag, m, k, alpha,
902 $ a( k+1 ), n+1, b( 0, 0 ), ldb )
903 CALL dgemm(
'N',
'N', m, k, k, -one, b( 0, 0 ),
904 $ ldb, a( 0 ), n+1, alpha, b( 0, k ),
906 CALL dtrsm(
'R',
'U',
'N', diag, m, k, one,
907 $ a( k ), n+1, b( 0, k ), ldb )
914 CALL dtrsm(
'R',
'U',
'T', diag, m, k, alpha,
915 $ a( k ), n+1, b( 0, k ), ldb )
916 CALL dgemm(
'N',
'T', m, k, k, -one, b( 0, k ),
917 $ ldb, a( 0 ), n+1, alpha, b( 0, 0 ),
919 CALL dtrsm(
'R',
'L',
'N', diag, m, k, one,
920 $ a( k+1 ), n+1, b( 0, 0 ), ldb )
939 CALL dtrsm(
'R',
'L',
'N', diag, m, k, alpha,
940 $ a( 0 ), k, b( 0, k ), ldb )
941 CALL dgemm(
'N',
'T', m, k, k, -one, b( 0, k ),
942 $ ldb, a( ( k+1 )*k ), k, alpha,
944 CALL dtrsm(
'R',
'U',
'T', diag, m, k, one,
945 $ a( k ), k, b( 0, 0 ), ldb )
952 CALL dtrsm(
'R',
'U',
'N', diag, m, k, alpha,
953 $ a( k ), k, b( 0, 0 ), ldb )
954 CALL dgemm(
'N',
'N', m, k, k, -one, b( 0, 0 ),
955 $ ldb, a( ( k+1 )*k ), k, alpha,
957 CALL dtrsm(
'R',
'L',
'T', diag, m, k, one,
958 $ a( 0 ), k, b( 0, k ), ldb )
971 CALL dtrsm(
'R',
'U',
'N', diag, m, k, alpha,
972 $ a( ( k+1 )*k ), k, b( 0, 0 ), ldb )
973 CALL dgemm(
'N',
'T', m, k, k, -one, b( 0, 0 ),
974 $ ldb, a( 0 ), k, alpha, b( 0, k ), ldb )
975 CALL dtrsm(
'R',
'L',
'T', diag, m, k, one,
976 $ a( k*k ), k, b( 0, k ), ldb )
983 CALL dtrsm(
'R',
'L',
'N', diag, m, k, alpha,
984 $ a( k*k ), k, b( 0, k ), ldb )
985 CALL dgemm(
'N',
'N', m, k, k, -one, b( 0, k ),
986 $ ldb, a( 0 ), k, alpha, b( 0, 0 ), ldb )
987 CALL dtrsm(
'R',
'U',
'T', diag, m, k, one,
988 $ a( ( k+1 )*k ), k, b( 0, 0 ), ldb )
subroutine xerbla(srname, info)
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
subroutine dtfsm(transr, side, uplo, trans, diag, m, n, alpha, a, b, ldb)
DTFSM solves a matrix equation (one operand is a triangular matrix in RFP format).
subroutine dtrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
DTRSM