775
776
777
778
779
780
781
782
783
784
785
786
787 COMPLEX ZERO
788 parameter( zero = ( 0.0, 0.0 ) )
789 REAL RZERO
790 parameter( rzero = 0.0 )
791
792 REAL EPS, THRESH
793 INTEGER NALF, NBET, NIDIM, NMAX, NOUT, NTRA, IORDER
794 LOGICAL FATAL, REWI, TRACE
795 CHARACTER*13 SNAME
796
797 COMPLEX A( NMAX, NMAX ), AA( NMAX*NMAX ), ALF( NALF ),
798 $ AS( NMAX*NMAX ), B( NMAX, NMAX ),
799 $ BB( NMAX*NMAX ), BET( NBET ), BS( NMAX*NMAX ),
800 $ C( NMAX, NMAX ), CC( NMAX*NMAX ),
801 $ CS( NMAX*NMAX ), CT( NMAX )
802 REAL G( NMAX )
803 INTEGER IDIM( NIDIM )
804
805 COMPLEX ALPHA, ALS, BETA, BLS
806 REAL ERR, ERRMAX
807 INTEGER I, IA, IB, ICS, ICU, IM, IN, LAA, LBB, LCC,
808 $ LDA, LDAS, LDB, LDBS, LDC, LDCS, M, MS, N, NA,
809 $ NARGS, NC, NS
810 LOGICAL CONJ, LEFT, NULL, RESET, SAME
811 CHARACTER*1 SIDE, SIDES, UPLO, UPLOS
812 CHARACTER*2 ICHS, ICHU
813
814 LOGICAL ISAME( 13 )
815
816 LOGICAL LCE, LCERES
818
820
821 INTRINSIC max
822
823 INTEGER INFOT, NOUTC
824 LOGICAL LERR, OK
825
826 COMMON /infoc/infot, noutc, ok, lerr
827
828 DATA ichs/'LR'/, ichu/'UL'/
829
830 conj = sname( 8: 9 ).EQ.'he'
831
832 nargs = 12
833 nc = 0
834 reset = .true.
835 errmax = rzero
836
837 DO 100 im = 1, nidim
838 m = idim( im )
839
840 DO 90 in = 1, nidim
841 n = idim( in )
842
843 ldc = m
844 IF( ldc.LT.nmax )
845 $ ldc = ldc + 1
846
847 IF( ldc.GT.nmax )
848 $ GO TO 90
849 lcc = ldc*n
850 null = n.LE.0.OR.m.LE.0
851
852 ldb = m
853 IF( ldb.LT.nmax )
854 $ ldb = ldb + 1
855
856 IF( ldb.GT.nmax )
857 $ GO TO 90
858 lbb = ldb*n
859
860
861
862 CALL cmake(
'ge',
' ',
' ', m, n, b, nmax, bb, ldb, reset,
863 $ zero )
864
865 DO 80 ics = 1, 2
866 side = ichs( ics: ics )
867 left = side.EQ.'L'
868
869 IF( left )THEN
870 na = m
871 ELSE
872 na = n
873 END IF
874
875 lda = na
876 IF( lda.LT.nmax )
877 $ lda = lda + 1
878
879 IF( lda.GT.nmax )
880 $ GO TO 80
881 laa = lda*na
882
883 DO 70 icu = 1, 2
884 uplo = ichu( icu: icu )
885
886
887
888 CALL cmake(sname( 8: 9 ), uplo,
' ', na, na, a, nmax,
889 $ aa, lda, reset, zero )
890
891 DO 60 ia = 1, nalf
892 alpha = alf( ia )
893
894 DO 50 ib = 1, nbet
895 beta = bet( ib )
896
897
898
899 CALL cmake(
'ge',
' ',
' ', m, n, c, nmax, cc,
900 $ ldc, reset, zero )
901
902 nc = nc + 1
903
904
905
906
907 sides = side
908 uplos = uplo
909 ms = m
910 ns = n
911 als = alpha
912 DO 10 i = 1, laa
913 as( i ) = aa( i )
914 10 CONTINUE
915 ldas = lda
916 DO 20 i = 1, lbb
917 bs( i ) = bb( i )
918 20 CONTINUE
919 ldbs = ldb
920 bls = beta
921 DO 30 i = 1, lcc
922 cs( i ) = cc( i )
923 30 CONTINUE
924 ldcs = ldc
925
926
927
928 IF( trace )
929 $
CALL cprcn2(ntra, nc, sname, iorder,
930 $ side, uplo, m, n, alpha, lda, ldb,
931 $ beta, ldc)
932 IF( rewi )
933 $ rewind ntra
934 IF( conj )THEN
935 CALL cchemm( iorder, side, uplo, m, n,
936 $ alpha, aa, lda, bb, ldb, beta,
937 $ cc, ldc )
938 ELSE
939 CALL ccsymm( iorder, side, uplo, m, n,
940 $ alpha, aa, lda, bb, ldb, beta,
941 $ cc, ldc )
942 END IF
943
944
945
946 IF( .NOT.ok )THEN
947 WRITE( nout, fmt = 9994 )
948 fatal = .true.
949 GO TO 110
950 END IF
951
952
953
954 isame( 1 ) = sides.EQ.side
955 isame( 2 ) = uplos.EQ.uplo
956 isame( 3 ) = ms.EQ.m
957 isame( 4 ) = ns.EQ.n
958 isame( 5 ) = als.EQ.alpha
959 isame( 6 ) =
lce( as, aa, laa )
960 isame( 7 ) = ldas.EQ.lda
961 isame( 8 ) =
lce( bs, bb, lbb )
962 isame( 9 ) = ldbs.EQ.ldb
963 isame( 10 ) = bls.EQ.beta
964 IF( null )THEN
965 isame( 11 ) =
lce( cs, cc, lcc )
966 ELSE
967 isame( 11 ) =
lceres(
'ge',
' ', m, n, cs,
968 $ cc, ldc )
969 END IF
970 isame( 12 ) = ldcs.EQ.ldc
971
972
973
974
975 same = .true.
976 DO 40 i = 1, nargs
977 same = same.AND.isame( i )
978 IF( .NOT.isame( i ) )
979 $ WRITE( nout, fmt = 9998 )i
980 40 CONTINUE
981 IF( .NOT.same )THEN
982 fatal = .true.
983 GO TO 110
984 END IF
985
986 IF( .NOT.null )THEN
987
988
989
990 IF( left )THEN
991 CALL cmmch(
'N',
'N', m, n, m, alpha, a,
992 $ nmax, b, nmax, beta, c, nmax,
993 $ ct, g, cc, ldc, eps, err,
994 $ fatal, nout, .true. )
995 ELSE
996 CALL cmmch(
'N',
'N', m, n, n, alpha, b,
997 $ nmax, a, nmax, beta, c, nmax,
998 $ ct, g, cc, ldc, eps, err,
999 $ fatal, nout, .true. )
1000 END IF
1001 errmax = max( errmax, err )
1002
1003
1004 IF( fatal )
1005 $ GO TO 110
1006 END IF
1007
1008 50 CONTINUE
1009
1010 60 CONTINUE
1011
1012 70 CONTINUE
1013
1014 80 CONTINUE
1015
1016 90 CONTINUE
1017
1018 100 CONTINUE
1019
1020
1021
1022 IF( errmax.LT.thresh )THEN
1023 IF ( iorder.EQ.0) WRITE( nout, fmt = 10000 )sname, nc
1024 IF ( iorder.EQ.1) WRITE( nout, fmt = 10001 )sname, nc
1025 ELSE
1026 IF ( iorder.EQ.0) WRITE( nout, fmt = 10002 )sname, nc, errmax
1027 IF ( iorder.EQ.1) WRITE( nout, fmt = 10003 )sname, nc, errmax
1028 END IF
1029 GO TO 120
1030
1031 110 CONTINUE
1032 WRITE( nout, fmt = 9996 )sname
1033 CALL cprcn2(nout, nc, sname, iorder, side, uplo, m, n, alpha, lda,
1034 $ ldb, beta, ldc)
1035
1036 120 CONTINUE
1037 RETURN
1038
103910003 FORMAT( ' ', a13,' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
1040 $ 'TESTS (', i6, ' CALLS)', /' ******* BUT WITH MAXIMUM TEST ',
1041 $ 'RATIO ', f8.2, ' - SUSPECT *******' )
104210002 FORMAT( ' ', a13,' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
1043 $ 'TESTS (', i6, ' CALLS)', /' ******* BUT WITH MAXIMUM TEST ',
1044 $ 'RATIO ', f8.2, ' - SUSPECT *******' )
104510001 FORMAT( ' ', a13,' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
1046 $ ' (', i6, ' CALL', 'S)' )
104710000 FORMAT( ' ', a13,' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
1048 $ ' (', i6, ' CALL', 'S)' )
1049 9998 FORMAT(' ******* FATAL ERROR - PARAMETER NUMBER ', i2, ' WAS CH',
1050 $ 'ANGED INCORRECTLY *******' )
1051 9996 FORMAT( ' ******* ', a13,' FAILED ON CALL NUMBER:' )
1052 9995 FORMAT(1x, i6, ': ', a13,'(', 2( '''', a1, ''',' ), 2( i3, ',' ),
1053 $ '(', f4.1, ',', f4.1, '), A,', i3, ', B,', i3, ',(', f4.1,
1054 $ ',', f4.1, '), C,', i3, ') .' )
1055 9994 FORMAT(' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
1056 $ '******' )
1057
1058
1059
subroutine cprcn2(nout, nc, sname, iorder, side, uplo, m, n, alpha, lda, ldb, beta, ldc)
subroutine cmake(type, uplo, diag, m, n, a, nmax, aa, lda, kl, ku, reset, transl)
logical function lceres(type, uplo, m, n, aa, as, lda)
logical function lce(ri, rj, lr)
subroutine cmmch(transa, transb, m, n, kk, alpha, a, lda, b, ldb, beta, c, ldc, ct, g, cc, ldcc, eps, err, fatal, nout, mv)