692
693
694
695
696
697
698
699
700
701
702
703
704 COMPLEX*16 ZERO
705 parameter( zero = ( 0.0d0, 0.0d0 ) )
706 DOUBLE PRECISION RZERO
707 parameter( rzero = 0.0d0 )
708
709 DOUBLE PRECISION EPS, THRESH
710 INTEGER NALF, NBET, NIDIM, NMAX, NOUT, NTRA
711 LOGICAL FATAL, REWI, TRACE
712 CHARACTER*6 SNAME
713
714 COMPLEX*16 A( NMAX, NMAX ), AA( NMAX*NMAX ), ALF( NALF ),
715 $ AS( NMAX*NMAX ), B( NMAX, NMAX ),
716 $ BB( NMAX*NMAX ), BET( NBET ), BS( NMAX*NMAX ),
717 $ C( NMAX, NMAX ), CC( NMAX*NMAX ),
718 $ CS( NMAX*NMAX ), CT( NMAX )
719 DOUBLE PRECISION G( NMAX )
720 INTEGER IDIM( NIDIM )
721
722 COMPLEX*16 ALPHA, ALS, BETA, BLS
723 DOUBLE PRECISION ERR, ERRMAX
724 INTEGER I, IA, IB, ICS, ICU, IM, IN, LAA, LBB, LCC,
725 $ LDA, LDAS, LDB, LDBS, LDC, LDCS, M, MS, N, NA,
726 $ NARGS, NC, NS
727 LOGICAL CONJ, LEFT, NULL, RESET, SAME
728 CHARACTER*1 SIDE, SIDES, UPLO, UPLOS
729 CHARACTER*2 ICHS, ICHU
730
731 LOGICAL ISAME( 13 )
732
733 LOGICAL LZE, LZERES
735
737
738 INTRINSIC max
739
740 INTEGER INFOT, NOUTC
741 LOGICAL LERR, OK
742
743 COMMON /infoc/infot, noutc, ok, lerr
744
745 DATA ichs/'LR'/, ichu/'UL'/
746
747 conj = sname( 2: 3 ).EQ.'HE'
748
749 nargs = 12
750 nc = 0
751 reset = .true.
752 errmax = rzero
753
754 DO 100 im = 1, nidim
755 m = idim( im )
756
757 DO 90 in = 1, nidim
758 n = idim( in )
759
760 ldc = m
761 IF( ldc.LT.nmax )
762 $ ldc = ldc + 1
763
764 IF( ldc.GT.nmax )
765 $ GO TO 90
766 lcc = ldc*n
767 null = n.LE.0.OR.m.LE.0
768
769 ldb = m
770 IF( ldb.LT.nmax )
771 $ ldb = ldb + 1
772
773 IF( ldb.GT.nmax )
774 $ GO TO 90
775 lbb = ldb*n
776
777
778
779 CALL zmake(
'GE',
' ',
' ', m, n, b, nmax, bb, ldb, reset,
780 $ zero )
781
782 DO 80 ics = 1, 2
783 side = ichs( ics: ics )
784 left = side.EQ.'L'
785
786 IF( left )THEN
787 na = m
788 ELSE
789 na = n
790 END IF
791
792 lda = na
793 IF( lda.LT.nmax )
794 $ lda = lda + 1
795
796 IF( lda.GT.nmax )
797 $ GO TO 80
798 laa = lda*na
799
800 DO 70 icu = 1, 2
801 uplo = ichu( icu: icu )
802
803
804
805 CALL zmake( sname( 2: 3 ), uplo,
' ', na, na, a, nmax,
806 $ aa, lda, reset, zero )
807
808 DO 60 ia = 1, nalf
809 alpha = alf( ia )
810
811 DO 50 ib = 1, nbet
812 beta = bet( ib )
813
814
815
816 CALL zmake(
'GE',
' ',
' ', m, n, c, nmax, cc,
817 $ ldc, reset, zero )
818
819 nc = nc + 1
820
821
822
823
824 sides = side
825 uplos = uplo
826 ms = m
827 ns = n
828 als = alpha
829 DO 10 i = 1, laa
830 as( i ) = aa( i )
831 10 CONTINUE
832 ldas = lda
833 DO 20 i = 1, lbb
834 bs( i ) = bb( i )
835 20 CONTINUE
836 ldbs = ldb
837 bls = beta
838 DO 30 i = 1, lcc
839 cs( i ) = cc( i )
840 30 CONTINUE
841 ldcs = ldc
842
843
844
845 IF( trace )
846 $ WRITE( ntra, fmt = 9995 )nc, sname, side,
847 $ uplo, m, n, alpha, lda, ldb, beta, ldc
848 IF( rewi )
849 $ rewind ntra
850 IF( conj )THEN
851 CALL zhemm( side, uplo, m, n, alpha, aa, lda,
852 $ bb, ldb, beta, cc, ldc )
853 ELSE
854 CALL zsymm( side, uplo, m, n, alpha, aa, lda,
855 $ bb, ldb, beta, cc, ldc )
856 END IF
857
858
859
860 IF( .NOT.ok )THEN
861 WRITE( nout, fmt = 9994 )
862 fatal = .true.
863 GO TO 110
864 END IF
865
866
867
868 isame( 1 ) = sides.EQ.side
869 isame( 2 ) = uplos.EQ.uplo
870 isame( 3 ) = ms.EQ.m
871 isame( 4 ) = ns.EQ.n
872 isame( 5 ) = als.EQ.alpha
873 isame( 6 ) =
lze( as, aa, laa )
874 isame( 7 ) = ldas.EQ.lda
875 isame( 8 ) =
lze( bs, bb, lbb )
876 isame( 9 ) = ldbs.EQ.ldb
877 isame( 10 ) = bls.EQ.beta
878 IF( null )THEN
879 isame( 11 ) =
lze( cs, cc, lcc )
880 ELSE
881 isame( 11 ) =
lzeres(
'GE',
' ', m, n, cs,
882 $ cc, ldc )
883 END IF
884 isame( 12 ) = ldcs.EQ.ldc
885
886
887
888
889 same = .true.
890 DO 40 i = 1, nargs
891 same = same.AND.isame( i )
892 IF( .NOT.isame( i ) )
893 $ WRITE( nout, fmt = 9998 )i
894 40 CONTINUE
895 IF( .NOT.same )THEN
896 fatal = .true.
897 GO TO 110
898 END IF
899
900 IF( .NOT.null )THEN
901
902
903
904 IF( left )THEN
905 CALL zmmch(
'N',
'N', m, n, m, alpha, a,
906 $ nmax, b, nmax, beta, c, nmax,
907 $ ct, g, cc, ldc, eps, err,
908 $ fatal, nout, .true. )
909 ELSE
910 CALL zmmch(
'N',
'N', m, n, n, alpha, b,
911 $ nmax, a, nmax, beta, c, nmax,
912 $ ct, g, cc, ldc, eps, err,
913 $ fatal, nout, .true. )
914 END IF
915 errmax = max( errmax, err )
916
917
918 IF( fatal )
919 $ GO TO 110
920 END IF
921
922 50 CONTINUE
923
924 60 CONTINUE
925
926 70 CONTINUE
927
928 80 CONTINUE
929
930 90 CONTINUE
931
932 100 CONTINUE
933
934
935
936 IF( errmax.LT.thresh )THEN
937 WRITE( nout, fmt = 9999 )sname, nc
938 ELSE
939 WRITE( nout, fmt = 9997 )sname, nc, errmax
940 END IF
941 GO TO 120
942
943 110 CONTINUE
944 WRITE( nout, fmt = 9996 )sname
945 WRITE( nout, fmt = 9995 )nc, sname, side, uplo, m, n, alpha, lda,
946 $ ldb, beta, ldc
947
948 120 CONTINUE
949 RETURN
950
951 9999 FORMAT( ' ', a6, ' PASSED THE COMPUTATIONAL TESTS (', i6, ' CALL',
952 $ 'S)' )
953 9998 FORMAT( ' ******* FATAL ERROR - PARAMETER NUMBER ', i2, ' WAS CH',
954 $ 'ANGED INCORRECTLY *******' )
955 9997 FORMAT( ' ', a6, ' COMPLETED THE COMPUTATIONAL TESTS (', i6, ' C',
956 $ 'ALLS)', /' ******* BUT WITH MAXIMUM TEST RATIO', f8.2,
957 $ ' - SUSPECT *******' )
958 9996 FORMAT( ' ******* ', a6, ' FAILED ON CALL NUMBER:' )
959 9995 FORMAT( 1x, i6, ': ', a6, '(', 2( '''', a1, ''',' ), 2( i3, ',' ),
960 $ '(', f4.1, ',', f4.1, '), A,', i3, ', B,', i3, ',(', f4.1,
961 $ ',', f4.1, '), C,', i3, ') .' )
962 9994 FORMAT( ' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
963 $ '******' )
964
965
966
subroutine zhemm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
ZHEMM
subroutine zsymm(side, uplo, m, n, alpha, a, lda, b, ldb, beta, c, ldc)
ZSYMM
logical function lze(ri, rj, lr)
logical function lzeres(type, uplo, m, n, aa, as, lda)
subroutine zmake(type, uplo, diag, m, n, a, nmax, aa, lda, kl, ku, reset, transl)
subroutine zmmch(transa, transb, m, n, kk, alpha, a, lda, b, ldb, beta, c, ldc, ct, g, cc, ldcc, eps, err, fatal, nout, mv)