296 SUBROUTINE ctfsm( TRANSR, SIDE, UPLO, TRANS, DIAG, M, N, ALPHA, A,
304 CHARACTER TRANSR, DIAG, SIDE, TRANS, UPLO
309 COMPLEX A( 0: * ), B( 0: LDB-1, 0: * )
316 parameter( cone = ( 1.0e+0, 0.0e+0 ),
317 $ czero = ( 0.0e+0, 0.0e+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(
'CTFSM ', -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 ctrsm(
'L',
'L',
'N', diag, m1, n, alpha,
425 CALL ctrsm(
'L',
'L',
'N', diag, m1, n, alpha,
426 $ a( 0 ), m, b, ldb )
427 CALL cgemm(
'N',
'N', m2, n, m1, -cone, a( m1 ),
428 $ m, b, ldb, alpha, b( m1, 0 ), ldb )
429 CALL ctrsm(
'L',
'U',
'C', diag, m2, n, cone,
430 $ a( m ), m, b( m1, 0 ), ldb )
439 CALL ctrsm(
'L',
'L',
'C', diag, m1, n, alpha,
440 $ a( 0 ), m, b, ldb )
442 CALL ctrsm(
'L',
'U',
'N', diag, m2, n, alpha,
443 $ a( m ), m, b( m1, 0 ), ldb )
444 CALL cgemm(
'C',
'N', m1, n, m2, -cone, a( m1 ),
445 $ m, b( m1, 0 ), ldb, alpha, b, ldb )
446 CALL ctrsm(
'L',
'L',
'C', diag, m1, n, cone,
447 $ a( 0 ), m, b, ldb )
456 IF( .NOT.notrans )
THEN
461 CALL ctrsm(
'L',
'L',
'N', diag, m1, n, alpha,
462 $ a( m2 ), m, b, ldb )
463 CALL cgemm(
'C',
'N', m2, n, m1, -cone, a( 0 ), m,
464 $ b, ldb, alpha, b( m1, 0 ), ldb )
465 CALL ctrsm(
'L',
'U',
'C', diag, m2, n, cone,
466 $ a( m1 ), m, b( m1, 0 ), ldb )
473 CALL ctrsm(
'L',
'U',
'N', diag, m2, n, alpha,
474 $ a( m1 ), m, b( m1, 0 ), ldb )
475 CALL cgemm(
'N',
'N', m1, n, m2, -cone, a( 0 ), m,
476 $ b( m1, 0 ), ldb, alpha, b, ldb )
477 CALL ctrsm(
'L',
'L',
'C', diag, m1, n, cone,
478 $ a( m2 ), m, b, ldb )
498 CALL ctrsm(
'L',
'U',
'C', diag, m1, n, alpha,
499 $ a( 0 ), m1, b, ldb )
501 CALL ctrsm(
'L',
'U',
'C', diag, m1, n, alpha,
502 $ a( 0 ), m1, b, ldb )
503 CALL cgemm(
'C',
'N', m2, n, m1, -cone,
504 $ a( m1*m1 ), m1, b, ldb, alpha,
506 CALL ctrsm(
'L',
'L',
'N', diag, m2, n, cone,
507 $ a( 1 ), m1, b( m1, 0 ), ldb )
516 CALL ctrsm(
'L',
'U',
'N', diag, m1, n, alpha,
517 $ a( 0 ), m1, b, ldb )
519 CALL ctrsm(
'L',
'L',
'C', diag, m2, n, alpha,
520 $ a( 1 ), m1, b( m1, 0 ), ldb )
521 CALL cgemm(
'N',
'N', m1, n, m2, -cone,
522 $ a( m1*m1 ), m1, b( m1, 0 ), ldb,
524 CALL ctrsm(
'L',
'U',
'N', diag, m1, n, cone,
525 $ a( 0 ), m1, b, ldb )
534 IF( .NOT.notrans )
THEN
539 CALL ctrsm(
'L',
'U',
'C', diag, m1, n, alpha,
540 $ a( m2*m2 ), m2, b, ldb )
541 CALL cgemm(
'N',
'N', m2, n, m1, -cone, a( 0 ), m2,
542 $ b, ldb, alpha, b( m1, 0 ), ldb )
543 CALL ctrsm(
'L',
'L',
'N', diag, m2, n, cone,
544 $ a( m1*m2 ), m2, b( m1, 0 ), ldb )
551 CALL ctrsm(
'L',
'L',
'C', diag, m2, n, alpha,
552 $ a( m1*m2 ), m2, b( m1, 0 ), ldb )
553 CALL cgemm(
'C',
'N', m1, n, m2, -cone, a( 0 ), m2,
554 $ b( m1, 0 ), ldb, alpha, b, ldb )
555 CALL ctrsm(
'L',
'U',
'N', diag, m1, n, cone,
556 $ a( m2*m2 ), m2, b, ldb )
568 IF( normaltransr )
THEN
581 CALL ctrsm(
'L',
'L',
'N', diag, k, n, alpha,
582 $ a( 1 ), m+1, b, ldb )
583 CALL cgemm(
'N',
'N', k, n, k, -cone, a( k+1 ),
584 $ m+1, b, ldb, alpha, b( k, 0 ), ldb )
585 CALL ctrsm(
'L',
'U',
'C', diag, k, n, cone,
586 $ a( 0 ), m+1, b( k, 0 ), ldb )
593 CALL ctrsm(
'L',
'U',
'N', diag, k, n, alpha,
594 $ a( 0 ), m+1, b( k, 0 ), ldb )
595 CALL cgemm(
'C',
'N', k, n, k, -cone, a( k+1 ),
596 $ m+1, b( k, 0 ), ldb, alpha, b, ldb )
597 CALL ctrsm(
'L',
'L',
'C', diag, k, n, cone,
598 $ a( 1 ), m+1, b, ldb )
606 IF( .NOT.notrans )
THEN
611 CALL ctrsm(
'L',
'L',
'N', diag, k, n, alpha,
612 $ a( k+1 ), m+1, b, ldb )
613 CALL cgemm(
'C',
'N', k, n, k, -cone, a( 0 ), m+1,
614 $ b, ldb, alpha, b( k, 0 ), ldb )
615 CALL ctrsm(
'L',
'U',
'C', diag, k, n, cone,
616 $ a( k ), m+1, b( k, 0 ), ldb )
622 CALL ctrsm(
'L',
'U',
'N', diag, k, n, alpha,
623 $ a( k ), m+1, b( k, 0 ), ldb )
624 CALL cgemm(
'N',
'N', k, n, k, -cone, a( 0 ), m+1,
625 $ b( k, 0 ), ldb, alpha, b, ldb )
626 CALL ctrsm(
'L',
'L',
'C', diag, k, n, cone,
627 $ a( k+1 ), m+1, b, ldb )
646 CALL ctrsm(
'L',
'U',
'C', diag, k, n, alpha,
647 $ a( k ), k, b, ldb )
648 CALL cgemm(
'C',
'N', k, n, k, -cone,
649 $ a( k*( k+1 ) ), k, b, ldb, alpha,
651 CALL ctrsm(
'L',
'L',
'N', diag, k, n, cone,
652 $ a( 0 ), k, b( k, 0 ), ldb )
659 CALL ctrsm(
'L',
'L',
'C', diag, k, n, alpha,
660 $ a( 0 ), k, b( k, 0 ), ldb )
661 CALL cgemm(
'N',
'N', k, n, k, -cone,
662 $ a( k*( k+1 ) ), k, b( k, 0 ), ldb,
664 CALL ctrsm(
'L',
'U',
'N', diag, k, n, cone,
665 $ a( k ), k, b, ldb )
673 IF( .NOT.notrans )
THEN
678 CALL ctrsm(
'L',
'U',
'C', diag, k, n, alpha,
679 $ a( k*( k+1 ) ), k, b, ldb )
680 CALL cgemm(
'N',
'N', k, n, k, -cone, a( 0 ), k, b,
681 $ ldb, alpha, b( k, 0 ), ldb )
682 CALL ctrsm(
'L',
'L',
'N', diag, k, n, cone,
683 $ a( k*k ), k, b( k, 0 ), ldb )
690 CALL ctrsm(
'L',
'L',
'C', diag, k, n, alpha,
691 $ a( k*k ), k, b( k, 0 ), ldb )
692 CALL cgemm(
'C',
'N', k, n, k, -cone, a( 0 ), k,
693 $ b( k, 0 ), ldb, alpha, b, ldb )
694 CALL ctrsm(
'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 ctrsm(
'R',
'U',
'C', diag, m, n2, alpha,
745 $ a( n ), n, b( 0, n1 ), ldb )
746 CALL cgemm(
'N',
'N', m, n1, n2, -cone, b( 0, n1 ),
747 $ ldb, a( n1 ), n, alpha, b( 0, 0 ),
749 CALL ctrsm(
'R',
'L',
'N', diag, m, n1, cone,
750 $ a( 0 ), n, b( 0, 0 ), ldb )
757 CALL ctrsm(
'R',
'L',
'C', diag, m, n1, alpha,
758 $ a( 0 ), n, b( 0, 0 ), ldb )
759 CALL cgemm(
'N',
'C', m, n2, n1, -cone, b( 0, 0 ),
760 $ ldb, a( n1 ), n, alpha, b( 0, n1 ),
762 CALL ctrsm(
'R',
'U',
'N', diag, m, n2, cone,
763 $ a( n ), n, b( 0, n1 ), ldb )
776 CALL ctrsm(
'R',
'L',
'C', diag, m, n1, alpha,
777 $ a( n2 ), n, b( 0, 0 ), ldb )
778 CALL cgemm(
'N',
'N', m, n2, n1, -cone, b( 0, 0 ),
779 $ ldb, a( 0 ), n, alpha, b( 0, n1 ),
781 CALL ctrsm(
'R',
'U',
'N', diag, m, n2, cone,
782 $ a( n1 ), n, b( 0, n1 ), ldb )
789 CALL ctrsm(
'R',
'U',
'C', diag, m, n2, alpha,
790 $ a( n1 ), n, b( 0, n1 ), ldb )
791 CALL cgemm(
'N',
'C', m, n1, n2, -cone, b( 0, n1 ),
792 $ ldb, a( 0 ), n, alpha, b( 0, 0 ), ldb )
793 CALL ctrsm(
'R',
'L',
'N', diag, m, n1, cone,
794 $ a( n2 ), n, b( 0, 0 ), ldb )
813 CALL ctrsm(
'R',
'L',
'N', diag, m, n2, alpha,
814 $ a( 1 ), n1, b( 0, n1 ), ldb )
815 CALL cgemm(
'N',
'C', m, n1, n2, -cone, b( 0, n1 ),
816 $ ldb, a( n1*n1 ), n1, alpha, b( 0, 0 ),
818 CALL ctrsm(
'R',
'U',
'C', diag, m, n1, cone,
819 $ a( 0 ), n1, b( 0, 0 ), ldb )
826 CALL ctrsm(
'R',
'U',
'N', diag, m, n1, alpha,
827 $ a( 0 ), n1, b( 0, 0 ), ldb )
828 CALL cgemm(
'N',
'N', m, n2, n1, -cone, b( 0, 0 ),
829 $ ldb, a( n1*n1 ), n1, alpha, b( 0, n1 ),
831 CALL ctrsm(
'R',
'L',
'C', diag, m, n2, cone,
832 $ a( 1 ), n1, b( 0, n1 ), ldb )
845 CALL ctrsm(
'R',
'U',
'N', diag, m, n1, alpha,
846 $ a( n2*n2 ), n2, b( 0, 0 ), ldb )
847 CALL cgemm(
'N',
'C', m, n2, n1, -cone, b( 0, 0 ),
848 $ ldb, a( 0 ), n2, alpha, b( 0, n1 ),
850 CALL ctrsm(
'R',
'L',
'C', diag, m, n2, cone,
851 $ a( n1*n2 ), n2, b( 0, n1 ), ldb )
858 CALL ctrsm(
'R',
'L',
'N', diag, m, n2, alpha,
859 $ a( n1*n2 ), n2, b( 0, n1 ), ldb )
860 CALL cgemm(
'N',
'N', m, n1, n2, -cone, b( 0, n1 ),
861 $ ldb, a( 0 ), n2, alpha, b( 0, 0 ),
863 CALL ctrsm(
'R',
'U',
'C', diag, m, n1, cone,
864 $ a( n2*n2 ), n2, b( 0, 0 ), ldb )
876 IF( normaltransr )
THEN
889 CALL ctrsm(
'R',
'U',
'C', diag, m, k, alpha,
890 $ a( 0 ), n+1, b( 0, k ), ldb )
891 CALL cgemm(
'N',
'N', m, k, k, -cone, b( 0, k ),
892 $ ldb, a( k+1 ), n+1, alpha, b( 0, 0 ),
894 CALL ctrsm(
'R',
'L',
'N', diag, m, k, cone,
895 $ a( 1 ), n+1, b( 0, 0 ), ldb )
902 CALL ctrsm(
'R',
'L',
'C', diag, m, k, alpha,
903 $ a( 1 ), n+1, b( 0, 0 ), ldb )
904 CALL cgemm(
'N',
'C', m, k, k, -cone, b( 0, 0 ),
905 $ ldb, a( k+1 ), n+1, alpha, b( 0, k ),
907 CALL ctrsm(
'R',
'U',
'N', diag, m, k, cone,
908 $ a( 0 ), n+1, b( 0, k ), ldb )
921 CALL ctrsm(
'R',
'L',
'C', diag, m, k, alpha,
922 $ a( k+1 ), n+1, b( 0, 0 ), ldb )
923 CALL cgemm(
'N',
'N', m, k, k, -cone, b( 0, 0 ),
924 $ ldb, a( 0 ), n+1, alpha, b( 0, k ),
926 CALL ctrsm(
'R',
'U',
'N', diag, m, k, cone,
927 $ a( k ), n+1, b( 0, k ), ldb )
934 CALL ctrsm(
'R',
'U',
'C', diag, m, k, alpha,
935 $ a( k ), n+1, b( 0, k ), ldb )
936 CALL cgemm(
'N',
'C', m, k, k, -cone, b( 0, k ),
937 $ ldb, a( 0 ), n+1, alpha, b( 0, 0 ),
939 CALL ctrsm(
'R',
'L',
'N', diag, m, k, cone,
940 $ a( k+1 ), n+1, b( 0, 0 ), ldb )
959 CALL ctrsm(
'R',
'L',
'N', diag, m, k, alpha,
960 $ a( 0 ), k, b( 0, k ), ldb )
961 CALL cgemm(
'N',
'C', m, k, k, -cone, b( 0, k ),
962 $ ldb, a( ( k+1 )*k ), k, alpha,
964 CALL ctrsm(
'R',
'U',
'C', diag, m, k, cone,
965 $ a( k ), k, b( 0, 0 ), ldb )
972 CALL ctrsm(
'R',
'U',
'N', diag, m, k, alpha,
973 $ a( k ), k, b( 0, 0 ), ldb )
974 CALL cgemm(
'N',
'N', m, k, k, -cone, b( 0, 0 ),
975 $ ldb, a( ( k+1 )*k ), k, alpha,
977 CALL ctrsm(
'R',
'L',
'C', diag, m, k, cone,
978 $ a( 0 ), k, b( 0, k ), ldb )
991 CALL ctrsm(
'R',
'U',
'N', diag, m, k, alpha,
992 $ a( ( k+1 )*k ), k, b( 0, 0 ), ldb )
993 CALL cgemm(
'N',
'C', m, k, k, -cone, b( 0, 0 ),
994 $ ldb, a( 0 ), k, alpha, b( 0, k ), ldb )
995 CALL ctrsm(
'R',
'L',
'C', diag, m, k, cone,
996 $ a( k*k ), k, b( 0, k ), ldb )
1003 CALL ctrsm(
'R',
'L',
'N', diag, m, k, alpha,
1004 $ a( k*k ), k, b( 0, k ), ldb )
1005 CALL cgemm(
'N',
'N', m, k, k, -cone, b( 0, k ),
1006 $ ldb, a( 0 ), k, alpha, b( 0, 0 ), ldb )
1007 CALL ctrsm(
'R',
'U',
'C', diag, m, k, cone,
1008 $ a( ( k+1 )*k ), k, b( 0, 0 ), ldb )
subroutine xerbla(srname, info)
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine ctfsm(transr, side, uplo, trans, diag, m, n, alpha, a, b, ldb)
CTFSM solves a matrix equation (one operand is a triangular matrix in RFP format).
subroutine ctrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRSM