275 SUBROUTINE stfsm( TRANSR, SIDE, UPLO, TRANS, DIAG, M, N, ALPHA, A,
283 CHARACTER TRANSR, DIAG, SIDE, TRANS, UPLO
288 REAL A( 0: * ), B( 0: LDB-1, 0: * )
296 parameter( one = 1.0e+0, zero = 0.0e+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(
'STFSM ', -info )
347 IF( ( m.EQ.0 ) .OR. ( n.EQ.0 ) )
352 IF( alpha.EQ.zero )
THEN
369 IF( mod( m, 2 ).EQ.0 )
THEN
387 IF( normaltransr )
THEN
401 CALL strsm(
'L',
'L',
'N', diag, m1, n, alpha,
404 CALL strsm(
'L',
'L',
'N', diag, m1, n, alpha,
405 $ a( 0 ), m, b, ldb )
406 CALL sgemm(
'N',
'N', m2, n, m1, -one, a( m1 ),
407 $ m, b, ldb, alpha, b( m1, 0 ), ldb )
408 CALL strsm(
'L',
'U',
'T', diag, m2, n, one,
409 $ a( m ), m, b( m1, 0 ), ldb )
418 CALL strsm(
'L',
'L',
'T', diag, m1, n, alpha,
419 $ a( 0 ), m, b, ldb )
421 CALL strsm(
'L',
'U',
'N', diag, m2, n, alpha,
422 $ a( m ), m, b( m1, 0 ), ldb )
423 CALL sgemm(
'T',
'N', m1, n, m2, -one, a( m1 ),
424 $ m, b( m1, 0 ), ldb, alpha, b, ldb )
425 CALL strsm(
'L',
'L',
'T', diag, m1, n, one,
426 $ a( 0 ), m, b, ldb )
435 IF( .NOT.notrans )
THEN
440 CALL strsm(
'L',
'L',
'N', diag, m1, n, alpha,
441 $ a( m2 ), m, b, ldb )
442 CALL sgemm(
'T',
'N', m2, n, m1, -one, a( 0 ), m,
443 $ b, ldb, alpha, b( m1, 0 ), ldb )
444 CALL strsm(
'L',
'U',
'T', diag, m2, n, one,
445 $ a( m1 ), m, b( m1, 0 ), ldb )
452 CALL strsm(
'L',
'U',
'N', diag, m2, n, alpha,
453 $ a( m1 ), m, b( m1, 0 ), ldb )
454 CALL sgemm(
'N',
'N', m1, n, m2, -one, a( 0 ), m,
455 $ b( m1, 0 ), ldb, alpha, b, ldb )
456 CALL strsm(
'L',
'L',
'T', diag, m1, n, one,
457 $ a( m2 ), m, b, ldb )
477 CALL strsm(
'L',
'U',
'T', diag, m1, n, alpha,
478 $ a( 0 ), m1, b, ldb )
480 CALL strsm(
'L',
'U',
'T', diag, m1, n, alpha,
481 $ a( 0 ), m1, b, ldb )
482 CALL sgemm(
'T',
'N', m2, n, m1, -one,
483 $ a( m1*m1 ), m1, b, ldb, alpha,
485 CALL strsm(
'L',
'L',
'N', diag, m2, n, one,
486 $ a( 1 ), m1, b( m1, 0 ), ldb )
495 CALL strsm(
'L',
'U',
'N', diag, m1, n, alpha,
496 $ a( 0 ), m1, b, ldb )
498 CALL strsm(
'L',
'L',
'T', diag, m2, n, alpha,
499 $ a( 1 ), m1, b( m1, 0 ), ldb )
500 CALL sgemm(
'N',
'N', m1, n, m2, -one,
501 $ a( m1*m1 ), m1, b( m1, 0 ), ldb,
503 CALL strsm(
'L',
'U',
'N', diag, m1, n, one,
504 $ a( 0 ), m1, b, ldb )
513 IF( .NOT.notrans )
THEN
518 CALL strsm(
'L',
'U',
'T', diag, m1, n, alpha,
519 $ a( m2*m2 ), m2, b, ldb )
520 CALL sgemm(
'N',
'N', m2, n, m1, -one, a( 0 ), m2,
521 $ b, ldb, alpha, b( m1, 0 ), ldb )
522 CALL strsm(
'L',
'L',
'N', diag, m2, n, one,
523 $ a( m1*m2 ), m2, b( m1, 0 ), ldb )
530 CALL strsm(
'L',
'L',
'T', diag, m2, n, alpha,
531 $ a( m1*m2 ), m2, b( m1, 0 ), ldb )
532 CALL sgemm(
'T',
'N', m1, n, m2, -one, a( 0 ), m2,
533 $ b( m1, 0 ), ldb, alpha, b, ldb )
534 CALL strsm(
'L',
'U',
'N', diag, m1, n, one,
535 $ a( m2*m2 ), m2, b, ldb )
547 IF( normaltransr )
THEN
560 CALL strsm(
'L',
'L',
'N', diag, k, n, alpha,
561 $ a( 1 ), m+1, b, ldb )
562 CALL sgemm(
'N',
'N', k, n, k, -one, a( k+1 ),
563 $ m+1, b, ldb, alpha, b( k, 0 ), ldb )
564 CALL strsm(
'L',
'U',
'T', diag, k, n, one,
565 $ a( 0 ), m+1, b( k, 0 ), ldb )
572 CALL strsm(
'L',
'U',
'N', diag, k, n, alpha,
573 $ a( 0 ), m+1, b( k, 0 ), ldb )
574 CALL sgemm(
'T',
'N', k, n, k, -one, a( k+1 ),
575 $ m+1, b( k, 0 ), ldb, alpha, b, ldb )
576 CALL strsm(
'L',
'L',
'T', diag, k, n, one,
577 $ a( 1 ), m+1, b, ldb )
585 IF( .NOT.notrans )
THEN
590 CALL strsm(
'L',
'L',
'N', diag, k, n, alpha,
591 $ a( k+1 ), m+1, b, ldb )
592 CALL sgemm(
'T',
'N', k, n, k, -one, a( 0 ), m+1,
593 $ b, ldb, alpha, b( k, 0 ), ldb )
594 CALL strsm(
'L',
'U',
'T', diag, k, n, one,
595 $ a( k ), m+1, b( k, 0 ), ldb )
601 CALL strsm(
'L',
'U',
'N', diag, k, n, alpha,
602 $ a( k ), m+1, b( k, 0 ), ldb )
603 CALL sgemm(
'N',
'N', k, n, k, -one, a( 0 ), m+1,
604 $ b( k, 0 ), ldb, alpha, b, ldb )
605 CALL strsm(
'L',
'L',
'T', diag, k, n, one,
606 $ a( k+1 ), m+1, b, ldb )
625 CALL strsm(
'L',
'U',
'T', diag, k, n, alpha,
626 $ a( k ), k, b, ldb )
627 CALL sgemm(
'T',
'N', k, n, k, -one,
628 $ a( k*( k+1 ) ), k, b, ldb, alpha,
630 CALL strsm(
'L',
'L',
'N', diag, k, n, one,
631 $ a( 0 ), k, b( k, 0 ), ldb )
638 CALL strsm(
'L',
'L',
'T', diag, k, n, alpha,
639 $ a( 0 ), k, b( k, 0 ), ldb )
640 CALL sgemm(
'N',
'N', k, n, k, -one,
641 $ a( k*( k+1 ) ), k, b( k, 0 ), ldb,
643 CALL strsm(
'L',
'U',
'N', diag, k, n, one,
644 $ a( k ), k, b, ldb )
652 IF( .NOT.notrans )
THEN
657 CALL strsm(
'L',
'U',
'T', diag, k, n, alpha,
658 $ a( k*( k+1 ) ), k, b, ldb )
659 CALL sgemm(
'N',
'N', k, n, k, -one, a( 0 ), k, b,
660 $ ldb, alpha, b( k, 0 ), ldb )
661 CALL strsm(
'L',
'L',
'N', diag, k, n, one,
662 $ a( k*k ), k, b( k, 0 ), ldb )
669 CALL strsm(
'L',
'L',
'T', diag, k, n, alpha,
670 $ a( k*k ), k, b( k, 0 ), ldb )
671 CALL sgemm(
'T',
'N', k, n, k, -one, a( 0 ), k,
672 $ b( k, 0 ), ldb, alpha, b, ldb )
673 CALL strsm(
'L',
'U',
'N', diag, k, n, one,
674 $ a( k*( k+1 ) ), k, b, ldb )
692 IF( mod( n, 2 ).EQ.0 )
THEN
710 IF( normaltransr )
THEN
723 CALL strsm(
'R',
'U',
'T', diag, m, n2, alpha,
724 $ a( n ), n, b( 0, n1 ), ldb )
725 CALL sgemm(
'N',
'N', m, n1, n2, -one, b( 0, n1 ),
726 $ ldb, a( n1 ), n, alpha, b( 0, 0 ),
728 CALL strsm(
'R',
'L',
'N', diag, m, n1, one,
729 $ a( 0 ), n, b( 0, 0 ), ldb )
736 CALL strsm(
'R',
'L',
'T', diag, m, n1, alpha,
737 $ a( 0 ), n, b( 0, 0 ), ldb )
738 CALL sgemm(
'N',
'T', m, n2, n1, -one, b( 0, 0 ),
739 $ ldb, a( n1 ), n, alpha, b( 0, n1 ),
741 CALL strsm(
'R',
'U',
'N', diag, m, n2, one,
742 $ a( n ), n, b( 0, n1 ), ldb )
755 CALL strsm(
'R',
'L',
'T', diag, m, n1, alpha,
756 $ a( n2 ), n, b( 0, 0 ), ldb )
757 CALL sgemm(
'N',
'N', m, n2, n1, -one, b( 0, 0 ),
758 $ ldb, a( 0 ), n, alpha, b( 0, n1 ),
760 CALL strsm(
'R',
'U',
'N', diag, m, n2, one,
761 $ a( n1 ), n, b( 0, n1 ), ldb )
768 CALL strsm(
'R',
'U',
'T', diag, m, n2, alpha,
769 $ a( n1 ), n, b( 0, n1 ), ldb )
770 CALL sgemm(
'N',
'T', m, n1, n2, -one, b( 0, n1 ),
771 $ ldb, a( 0 ), n, alpha, b( 0, 0 ), ldb )
772 CALL strsm(
'R',
'L',
'N', diag, m, n1, one,
773 $ a( n2 ), n, b( 0, 0 ), ldb )
792 CALL strsm(
'R',
'L',
'N', diag, m, n2, alpha,
793 $ a( 1 ), n1, b( 0, n1 ), ldb )
794 CALL sgemm(
'N',
'T', m, n1, n2, -one, b( 0, n1 ),
795 $ ldb, a( n1*n1 ), n1, alpha, b( 0, 0 ),
797 CALL strsm(
'R',
'U',
'T', diag, m, n1, one,
798 $ a( 0 ), n1, b( 0, 0 ), ldb )
805 CALL strsm(
'R',
'U',
'N', diag, m, n1, alpha,
806 $ a( 0 ), n1, b( 0, 0 ), ldb )
807 CALL sgemm(
'N',
'N', m, n2, n1, -one, b( 0, 0 ),
808 $ ldb, a( n1*n1 ), n1, alpha, b( 0, n1 ),
810 CALL strsm(
'R',
'L',
'T', diag, m, n2, one,
811 $ a( 1 ), n1, b( 0, n1 ), ldb )
824 CALL strsm(
'R',
'U',
'N', diag, m, n1, alpha,
825 $ a( n2*n2 ), n2, b( 0, 0 ), ldb )
826 CALL sgemm(
'N',
'T', m, n2, n1, -one, b( 0, 0 ),
827 $ ldb, a( 0 ), n2, alpha, b( 0, n1 ),
829 CALL strsm(
'R',
'L',
'T', diag, m, n2, one,
830 $ a( n1*n2 ), n2, b( 0, n1 ), ldb )
837 CALL strsm(
'R',
'L',
'N', diag, m, n2, alpha,
838 $ a( n1*n2 ), n2, b( 0, n1 ), ldb )
839 CALL sgemm(
'N',
'N', m, n1, n2, -one, b( 0, n1 ),
840 $ ldb, a( 0 ), n2, alpha, b( 0, 0 ),
842 CALL strsm(
'R',
'U',
'T', diag, m, n1, one,
843 $ a( n2*n2 ), n2, b( 0, 0 ), ldb )
855 IF( normaltransr )
THEN
868 CALL strsm(
'R',
'U',
'T', diag, m, k, alpha,
869 $ a( 0 ), n+1, b( 0, k ), ldb )
870 CALL sgemm(
'N',
'N', m, k, k, -one, b( 0, k ),
871 $ ldb, a( k+1 ), n+1, alpha, b( 0, 0 ),
873 CALL strsm(
'R',
'L',
'N', diag, m, k, one,
874 $ a( 1 ), n+1, b( 0, 0 ), ldb )
881 CALL strsm(
'R',
'L',
'T', diag, m, k, alpha,
882 $ a( 1 ), n+1, b( 0, 0 ), ldb )
883 CALL sgemm(
'N',
'T', m, k, k, -one, b( 0, 0 ),
884 $ ldb, a( k+1 ), n+1, alpha, b( 0, k ),
886 CALL strsm(
'R',
'U',
'N', diag, m, k, one,
887 $ a( 0 ), n+1, b( 0, k ), ldb )
900 CALL strsm(
'R',
'L',
'T', diag, m, k, alpha,
901 $ a( k+1 ), n+1, b( 0, 0 ), ldb )
902 CALL sgemm(
'N',
'N', m, k, k, -one, b( 0, 0 ),
903 $ ldb, a( 0 ), n+1, alpha, b( 0, k ),
905 CALL strsm(
'R',
'U',
'N', diag, m, k, one,
906 $ a( k ), n+1, b( 0, k ), ldb )
913 CALL strsm(
'R',
'U',
'T', diag, m, k, alpha,
914 $ a( k ), n+1, b( 0, k ), ldb )
915 CALL sgemm(
'N',
'T', m, k, k, -one, b( 0, k ),
916 $ ldb, a( 0 ), n+1, alpha, b( 0, 0 ),
918 CALL strsm(
'R',
'L',
'N', diag, m, k, one,
919 $ a( k+1 ), n+1, b( 0, 0 ), ldb )
938 CALL strsm(
'R',
'L',
'N', diag, m, k, alpha,
939 $ a( 0 ), k, b( 0, k ), ldb )
940 CALL sgemm(
'N',
'T', m, k, k, -one, b( 0, k ),
941 $ ldb, a( ( k+1 )*k ), k, alpha,
943 CALL strsm(
'R',
'U',
'T', diag, m, k, one,
944 $ a( k ), k, b( 0, 0 ), ldb )
951 CALL strsm(
'R',
'U',
'N', diag, m, k, alpha,
952 $ a( k ), k, b( 0, 0 ), ldb )
953 CALL sgemm(
'N',
'N', m, k, k, -one, b( 0, 0 ),
954 $ ldb, a( ( k+1 )*k ), k, alpha,
956 CALL strsm(
'R',
'L',
'T', diag, m, k, one,
957 $ a( 0 ), k, b( 0, k ), ldb )
970 CALL strsm(
'R',
'U',
'N', diag, m, k, alpha,
971 $ a( ( k+1 )*k ), k, b( 0, 0 ), ldb )
972 CALL sgemm(
'N',
'T', m, k, k, -one, b( 0, 0 ),
973 $ ldb, a( 0 ), k, alpha, b( 0, k ), ldb )
974 CALL strsm(
'R',
'L',
'T', diag, m, k, one,
975 $ a( k*k ), k, b( 0, k ), ldb )
982 CALL strsm(
'R',
'L',
'N', diag, m, k, alpha,
983 $ a( k*k ), k, b( 0, k ), ldb )
984 CALL sgemm(
'N',
'N', m, k, k, -one, b( 0, k ),
985 $ ldb, a( 0 ), k, alpha, b( 0, 0 ), ldb )
986 CALL strsm(
'R',
'U',
'T', diag, m, k, one,
987 $ a( ( k+1 )*k ), k, b( 0, 0 ), ldb )
subroutine xerbla(srname, info)
subroutine sgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
SGEMM
subroutine stfsm(transr, side, uplo, trans, diag, m, n, alpha, a, b, ldb)
STFSM solves a matrix equation (one operand is a triangular matrix in RFP format).
subroutine strsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
STRSM