296 SUBROUTINE ztfsm( TRANSR, SIDE, UPLO, TRANS, DIAG, M, N, ALPHA, A,
304 CHARACTER TRANSR, DIAG, SIDE, TRANS, UPLO
309 COMPLEX*16 A( 0: * ), B( 0: LDB-1, 0: * )
315 COMPLEX*16 CONE, CZERO
316 parameter( cone = ( 1.0d+0, 0.0d+0 ),
317 $ czero = ( 0.0d+0, 0.0d+0 ) )
320 LOGICAL LOWER, LSIDE, MISODD, NISODD, NORMALTRANSR,
322 INTEGER M1, M2, N1, N2, K, INFO, I, J
339 normaltransr = lsame( transr,
'N' )
340 lside = lsame( side,
'L' )
341 lower = lsame( uplo,
'L' )
342 notrans = lsame( trans,
'N' )
343 IF( .NOT.normaltransr .AND. .NOT.lsame( transr,
'C' ) )
THEN
345 ELSE IF( .NOT.lside .AND. .NOT.lsame( side,
'R' ) )
THEN
347 ELSE IF( .NOT.lower .AND. .NOT.lsame( uplo,
'U' ) )
THEN
349 ELSE IF( .NOT.notrans .AND. .NOT.lsame( trans,
'C' ) )
THEN
351 ELSE IF( .NOT.lsame( diag,
'N' ) .AND. .NOT.lsame( diag,
'U' ) )
354 ELSE IF( m.LT.0 )
THEN
356 ELSE IF( n.LT.0 )
THEN
358 ELSE IF( ldb.LT.max( 1, m ) )
THEN
362 CALL xerbla(
'ZTFSM ', -info )
368 IF( ( m.EQ.0 ) .OR. ( n.EQ.0 ) )
373 IF( alpha.EQ.czero )
THEN
390 IF( mod( m, 2 ).EQ.0 )
THEN
408 IF( normaltransr )
THEN
422 CALL ztrsm(
'L',
'L',
'N', diag, m1, n, alpha,
425 CALL ztrsm(
'L',
'L',
'N', diag, m1, n, alpha,
426 $ a( 0 ), m, b, ldb )
427 CALL zgemm(
'N',
'N', m2, n, m1, -cone, a( m1 ),
428 $ m, b, ldb, alpha, b( m1, 0 ), ldb )
429 CALL ztrsm(
'L',
'U',
'C', diag, m2, n, cone,
430 $ a( m ), m, b( m1, 0 ), ldb )
439 CALL ztrsm(
'L',
'L',
'C', diag, m1, n, alpha,
440 $ a( 0 ), m, b, ldb )
442 CALL ztrsm(
'L',
'U',
'N', diag, m2, n, alpha,
443 $ a( m ), m, b( m1, 0 ), ldb )
444 CALL zgemm(
'C',
'N', m1, n, m2, -cone, a( m1 ),
445 $ m, b( m1, 0 ), ldb, alpha, b, ldb )
446 CALL ztrsm(
'L',
'L',
'C', diag, m1, n, cone,
447 $ a( 0 ), m, b, ldb )
456 IF( .NOT.notrans )
THEN
461 CALL ztrsm(
'L',
'L',
'N', diag, m1, n, alpha,
462 $ a( m2 ), m, b, ldb )
463 CALL zgemm(
'C',
'N', m2, n, m1, -cone, a( 0 ), m,
464 $ b, ldb, alpha, b( m1, 0 ), ldb )
465 CALL ztrsm(
'L',
'U',
'C', diag, m2, n, cone,
466 $ a( m1 ), m, b( m1, 0 ), ldb )
473 CALL ztrsm(
'L',
'U',
'N', diag, m2, n, alpha,
474 $ a( m1 ), m, b( m1, 0 ), ldb )
475 CALL zgemm(
'N',
'N', m1, n, m2, -cone, a( 0 ), m,
476 $ b( m1, 0 ), ldb, alpha, b, ldb )
477 CALL ztrsm(
'L',
'L',
'C', diag, m1, n, cone,
478 $ a( m2 ), m, b, ldb )
498 CALL ztrsm(
'L',
'U',
'C', diag, m1, n, alpha,
499 $ a( 0 ), m1, b, ldb )
501 CALL ztrsm(
'L',
'U',
'C', diag, m1, n, alpha,
502 $ a( 0 ), m1, b, ldb )
503 CALL zgemm(
'C',
'N', m2, n, m1, -cone,
504 $ a( m1*m1 ), m1, b, ldb, alpha,
506 CALL ztrsm(
'L',
'L',
'N', diag, m2, n, cone,
507 $ a( 1 ), m1, b( m1, 0 ), ldb )
516 CALL ztrsm(
'L',
'U',
'N', diag, m1, n, alpha,
517 $ a( 0 ), m1, b, ldb )
519 CALL ztrsm(
'L',
'L',
'C', diag, m2, n, alpha,
520 $ a( 1 ), m1, b( m1, 0 ), ldb )
521 CALL zgemm(
'N',
'N', m1, n, m2, -cone,
522 $ a( m1*m1 ), m1, b( m1, 0 ), ldb,
524 CALL ztrsm(
'L',
'U',
'N', diag, m1, n, cone,
525 $ a( 0 ), m1, b, ldb )
534 IF( .NOT.notrans )
THEN
539 CALL ztrsm(
'L',
'U',
'C', diag, m1, n, alpha,
540 $ a( m2*m2 ), m2, b, ldb )
541 CALL zgemm(
'N',
'N', m2, n, m1, -cone, a( 0 ), m2,
542 $ b, ldb, alpha, b( m1, 0 ), ldb )
543 CALL ztrsm(
'L',
'L',
'N', diag, m2, n, cone,
544 $ a( m1*m2 ), m2, b( m1, 0 ), ldb )
551 CALL ztrsm(
'L',
'L',
'C', diag, m2, n, alpha,
552 $ a( m1*m2 ), m2, b( m1, 0 ), ldb )
553 CALL zgemm(
'C',
'N', m1, n, m2, -cone, a( 0 ), m2,
554 $ b( m1, 0 ), ldb, alpha, b, ldb )
555 CALL ztrsm(
'L',
'U',
'N', diag, m1, n, cone,
556 $ a( m2*m2 ), m2, b, ldb )
568 IF( normaltransr )
THEN
581 CALL ztrsm(
'L',
'L',
'N', diag, k, n, alpha,
582 $ a( 1 ), m+1, b, ldb )
583 CALL zgemm(
'N',
'N', k, n, k, -cone, a( k+1 ),
584 $ m+1, b, ldb, alpha, b( k, 0 ), ldb )
585 CALL ztrsm(
'L',
'U',
'C', diag, k, n, cone,
586 $ a( 0 ), m+1, b( k, 0 ), ldb )
593 CALL ztrsm(
'L',
'U',
'N', diag, k, n, alpha,
594 $ a( 0 ), m+1, b( k, 0 ), ldb )
595 CALL zgemm(
'C',
'N', k, n, k, -cone, a( k+1 ),
596 $ m+1, b( k, 0 ), ldb, alpha, b, ldb )
597 CALL ztrsm(
'L',
'L',
'C', diag, k, n, cone,
598 $ a( 1 ), m+1, b, ldb )
606 IF( .NOT.notrans )
THEN
611 CALL ztrsm(
'L',
'L',
'N', diag, k, n, alpha,
612 $ a( k+1 ), m+1, b, ldb )
613 CALL zgemm(
'C',
'N', k, n, k, -cone, a( 0 ), m+1,
614 $ b, ldb, alpha, b( k, 0 ), ldb )
615 CALL ztrsm(
'L',
'U',
'C', diag, k, n, cone,
616 $ a( k ), m+1, b( k, 0 ), ldb )
622 CALL ztrsm(
'L',
'U',
'N', diag, k, n, alpha,
623 $ a( k ), m+1, b( k, 0 ), ldb )
624 CALL zgemm(
'N',
'N', k, n, k, -cone, a( 0 ), m+1,
625 $ b( k, 0 ), ldb, alpha, b, ldb )
626 CALL ztrsm(
'L',
'L',
'C', diag, k, n, cone,
627 $ a( k+1 ), m+1, b, ldb )
646 CALL ztrsm(
'L',
'U',
'C', diag, k, n, alpha,
647 $ a( k ), k, b, ldb )
648 CALL zgemm(
'C',
'N', k, n, k, -cone,
649 $ a( k*( k+1 ) ), k, b, ldb, alpha,
651 CALL ztrsm(
'L',
'L',
'N', diag, k, n, cone,
652 $ a( 0 ), k, b( k, 0 ), ldb )
659 CALL ztrsm(
'L',
'L',
'C', diag, k, n, alpha,
660 $ a( 0 ), k, b( k, 0 ), ldb )
661 CALL zgemm(
'N',
'N', k, n, k, -cone,
662 $ a( k*( k+1 ) ), k, b( k, 0 ), ldb,
664 CALL ztrsm(
'L',
'U',
'N', diag, k, n, cone,
665 $ a( k ), k, b, ldb )
673 IF( .NOT.notrans )
THEN
678 CALL ztrsm(
'L',
'U',
'C', diag, k, n, alpha,
679 $ a( k*( k+1 ) ), k, b, ldb )
680 CALL zgemm(
'N',
'N', k, n, k, -cone, a( 0 ), k, b,
681 $ ldb, alpha, b( k, 0 ), ldb )
682 CALL ztrsm(
'L',
'L',
'N', diag, k, n, cone,
683 $ a( k*k ), k, b( k, 0 ), ldb )
690 CALL ztrsm(
'L',
'L',
'C', diag, k, n, alpha,
691 $ a( k*k ), k, b( k, 0 ), ldb )
692 CALL zgemm(
'C',
'N', k, n, k, -cone, a( 0 ), k,
693 $ b( k, 0 ), ldb, alpha, b, ldb )
694 CALL ztrsm(
'L',
'U',
'N', diag, k, n, cone,
695 $ a( k*( k+1 ) ), k, b, ldb )
713 IF( mod( n, 2 ).EQ.0 )
THEN
731 IF( normaltransr )
THEN
744 CALL ztrsm(
'R',
'U',
'C', diag, m, n2, alpha,
745 $ a( n ), n, b( 0, n1 ), ldb )
746 CALL zgemm(
'N',
'N', m, n1, n2, -cone, b( 0, n1 ),
747 $ ldb, a( n1 ), n, alpha, b( 0, 0 ),
749 CALL ztrsm(
'R',
'L',
'N', diag, m, n1, cone,
750 $ a( 0 ), n, b( 0, 0 ), ldb )
757 CALL ztrsm(
'R',
'L',
'C', diag, m, n1, alpha,
758 $ a( 0 ), n, b( 0, 0 ), ldb )
759 CALL zgemm(
'N',
'C', m, n2, n1, -cone, b( 0, 0 ),
760 $ ldb, a( n1 ), n, alpha, b( 0, n1 ),
762 CALL ztrsm(
'R',
'U',
'N', diag, m, n2, cone,
763 $ a( n ), n, b( 0, n1 ), ldb )
776 CALL ztrsm(
'R',
'L',
'C', diag, m, n1, alpha,
777 $ a( n2 ), n, b( 0, 0 ), ldb )
778 CALL zgemm(
'N',
'N', m, n2, n1, -cone, b( 0, 0 ),
779 $ ldb, a( 0 ), n, alpha, b( 0, n1 ),
781 CALL ztrsm(
'R',
'U',
'N', diag, m, n2, cone,
782 $ a( n1 ), n, b( 0, n1 ), ldb )
789 CALL ztrsm(
'R',
'U',
'C', diag, m, n2, alpha,
790 $ a( n1 ), n, b( 0, n1 ), ldb )
791 CALL zgemm(
'N',
'C', m, n1, n2, -cone, b( 0, n1 ),
792 $ ldb, a( 0 ), n, alpha, b( 0, 0 ), ldb )
793 CALL ztrsm(
'R',
'L',
'N', diag, m, n1, cone,
794 $ a( n2 ), n, b( 0, 0 ), ldb )
813 CALL ztrsm(
'R',
'L',
'N', diag, m, n2, alpha,
814 $ a( 1 ), n1, b( 0, n1 ), ldb )
815 CALL zgemm(
'N',
'C', m, n1, n2, -cone, b( 0, n1 ),
816 $ ldb, a( n1*n1 ), n1, alpha, b( 0, 0 ),
818 CALL ztrsm(
'R',
'U',
'C', diag, m, n1, cone,
819 $ a( 0 ), n1, b( 0, 0 ), ldb )
826 CALL ztrsm(
'R',
'U',
'N', diag, m, n1, alpha,
827 $ a( 0 ), n1, b( 0, 0 ), ldb )
828 CALL zgemm(
'N',
'N', m, n2, n1, -cone, b( 0, 0 ),
829 $ ldb, a( n1*n1 ), n1, alpha, b( 0, n1 ),
831 CALL ztrsm(
'R',
'L',
'C', diag, m, n2, cone,
832 $ a( 1 ), n1, b( 0, n1 ), ldb )
845 CALL ztrsm(
'R',
'U',
'N', diag, m, n1, alpha,
846 $ a( n2*n2 ), n2, b( 0, 0 ), ldb )
847 CALL zgemm(
'N',
'C', m, n2, n1, -cone, b( 0, 0 ),
848 $ ldb, a( 0 ), n2, alpha, b( 0, n1 ),
850 CALL ztrsm(
'R',
'L',
'C', diag, m, n2, cone,
851 $ a( n1*n2 ), n2, b( 0, n1 ), ldb )
858 CALL ztrsm(
'R',
'L',
'N', diag, m, n2, alpha,
859 $ a( n1*n2 ), n2, b( 0, n1 ), ldb )
860 CALL zgemm(
'N',
'N', m, n1, n2, -cone, b( 0, n1 ),
861 $ ldb, a( 0 ), n2, alpha, b( 0, 0 ),
863 CALL ztrsm(
'R',
'U',
'C', diag, m, n1, cone,
864 $ a( n2*n2 ), n2, b( 0, 0 ), ldb )
876 IF( normaltransr )
THEN
889 CALL ztrsm(
'R',
'U',
'C', diag, m, k, alpha,
890 $ a( 0 ), n+1, b( 0, k ), ldb )
891 CALL zgemm(
'N',
'N', m, k, k, -cone, b( 0, k ),
892 $ ldb, a( k+1 ), n+1, alpha, b( 0, 0 ),
894 CALL ztrsm(
'R',
'L',
'N', diag, m, k, cone,
895 $ a( 1 ), n+1, b( 0, 0 ), ldb )
902 CALL ztrsm(
'R',
'L',
'C', diag, m, k, alpha,
903 $ a( 1 ), n+1, b( 0, 0 ), ldb )
904 CALL zgemm(
'N',
'C', m, k, k, -cone, b( 0, 0 ),
905 $ ldb, a( k+1 ), n+1, alpha, b( 0, k ),
907 CALL ztrsm(
'R',
'U',
'N', diag, m, k, cone,
908 $ a( 0 ), n+1, b( 0, k ), ldb )
921 CALL ztrsm(
'R',
'L',
'C', diag, m, k, alpha,
922 $ a( k+1 ), n+1, b( 0, 0 ), ldb )
923 CALL zgemm(
'N',
'N', m, k, k, -cone, b( 0, 0 ),
924 $ ldb, a( 0 ), n+1, alpha, b( 0, k ),
926 CALL ztrsm(
'R',
'U',
'N', diag, m, k, cone,
927 $ a( k ), n+1, b( 0, k ), ldb )
934 CALL ztrsm(
'R',
'U',
'C', diag, m, k, alpha,
935 $ a( k ), n+1, b( 0, k ), ldb )
936 CALL zgemm(
'N',
'C', m, k, k, -cone, b( 0, k ),
937 $ ldb, a( 0 ), n+1, alpha, b( 0, 0 ),
939 CALL ztrsm(
'R',
'L',
'N', diag, m, k, cone,
940 $ a( k+1 ), n+1, b( 0, 0 ), ldb )
959 CALL ztrsm(
'R',
'L',
'N', diag, m, k, alpha,
960 $ a( 0 ), k, b( 0, k ), ldb )
961 CALL zgemm(
'N',
'C', m, k, k, -cone, b( 0, k ),
962 $ ldb, a( ( k+1 )*k ), k, alpha,
964 CALL ztrsm(
'R',
'U',
'C', diag, m, k, cone,
965 $ a( k ), k, b( 0, 0 ), ldb )
972 CALL ztrsm(
'R',
'U',
'N', diag, m, k, alpha,
973 $ a( k ), k, b( 0, 0 ), ldb )
974 CALL zgemm(
'N',
'N', m, k, k, -cone, b( 0, 0 ),
975 $ ldb, a( ( k+1 )*k ), k, alpha,
977 CALL ztrsm(
'R',
'L',
'C', diag, m, k, cone,
978 $ a( 0 ), k, b( 0, k ), ldb )
991 CALL ztrsm(
'R',
'U',
'N', diag, m, k, alpha,
992 $ a( ( k+1 )*k ), k, b( 0, 0 ), ldb )
993 CALL zgemm(
'N',
'C', m, k, k, -cone, b( 0, 0 ),
994 $ ldb, a( 0 ), k, alpha, b( 0, k ), ldb )
995 CALL ztrsm(
'R',
'L',
'C', diag, m, k, cone,
996 $ a( k*k ), k, b( 0, k ), ldb )
1003 CALL ztrsm(
'R',
'L',
'N', diag, m, k, alpha,
1004 $ a( k*k ), k, b( 0, k ), ldb )
1005 CALL zgemm(
'N',
'N', m, k, k, -cone, b( 0, k ),
1006 $ ldb, a( 0 ), k, alpha, b( 0, 0 ), ldb )
1007 CALL ztrsm(
'R',
'U',
'C', diag, m, k, cone,
1008 $ a( ( k+1 )*k ), k, b( 0, 0 ), ldb )
subroutine xerbla(srname, info)
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine ztfsm(transr, side, uplo, trans, diag, m, n, alpha, a, b, ldb)
ZTFSM solves a matrix equation (one operand is a triangular matrix in RFP format).
subroutine ztrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
ZTRSM