971
972
973
974
975
976
977
978
979
980
981
982
983 COMPLEX*16 ZERO, ONE
984 parameter( zero = ( 0.0d0, 0.0d0 ),
985 $ one = ( 1.0d0, 0.0d0 ) )
986 DOUBLE PRECISION RZERO
987 parameter( rzero = 0.0d0 )
988
989 DOUBLE PRECISION EPS, THRESH
990 INTEGER NALF, NIDIM, NMAX, NOUT, NTRA
991 LOGICAL FATAL, REWI, TRACE
992 CHARACTER*6 SNAME
993
994 COMPLEX*16 A( NMAX, NMAX ), AA( NMAX*NMAX ), ALF( NALF ),
995 $ AS( NMAX*NMAX ), B( NMAX, NMAX ),
996 $ BB( NMAX*NMAX ), BS( NMAX*NMAX ),
997 $ C( NMAX, NMAX ), CT( NMAX )
998 DOUBLE PRECISION G( NMAX )
999 INTEGER IDIM( NIDIM )
1000
1001 COMPLEX*16 ALPHA, ALS
1002 DOUBLE PRECISION ERR, ERRMAX
1003 INTEGER I, IA, ICD, ICS, ICT, ICU, IM, IN, J, LAA, LBB,
1004 $ LDA, LDAS, LDB, LDBS, M, MS, N, NA, NARGS, NC,
1005 $ NS
1006 LOGICAL LEFT, NULL, RESET, SAME
1007 CHARACTER*1 DIAG, DIAGS, SIDE, SIDES, TRANAS, TRANSA, UPLO,
1008 $ UPLOS
1009 CHARACTER*2 ICHD, ICHS, ICHU
1010 CHARACTER*3 ICHT
1011
1012 LOGICAL ISAME( 13 )
1013
1014 LOGICAL LZE, LZERES
1016
1018
1019 INTRINSIC max
1020
1021 INTEGER INFOT, NOUTC
1022 LOGICAL LERR, OK
1023
1024 COMMON /infoc/infot, noutc, ok, lerr
1025
1026 DATA ichu/'UL'/, icht/'NTC'/, ichd/'UN'/, ichs/'LR'/
1027
1028
1029 nargs = 11
1030 nc = 0
1031 reset = .true.
1032 errmax = rzero
1033
1034 DO 20 j = 1, nmax
1035 DO 10 i = 1, nmax
1036 c( i, j ) = zero
1037 10 CONTINUE
1038 20 CONTINUE
1039
1040 DO 140 im = 1, nidim
1041 m = idim( im )
1042
1043 DO 130 in = 1, nidim
1044 n = idim( in )
1045
1046 ldb = m
1047 IF( ldb.LT.nmax )
1048 $ ldb = ldb + 1
1049
1050 IF( ldb.GT.nmax )
1051 $ GO TO 130
1052 lbb = ldb*n
1053 null = m.LE.0.OR.n.LE.0
1054
1055 DO 120 ics = 1, 2
1056 side = ichs( ics: ics )
1057 left = side.EQ.'L'
1058 IF( left )THEN
1059 na = m
1060 ELSE
1061 na = n
1062 END IF
1063
1064 lda = na
1065 IF( lda.LT.nmax )
1066 $ lda = lda + 1
1067
1068 IF( lda.GT.nmax )
1069 $ GO TO 130
1070 laa = lda*na
1071
1072 DO 110 icu = 1, 2
1073 uplo = ichu( icu: icu )
1074
1075 DO 100 ict = 1, 3
1076 transa = icht( ict: ict )
1077
1078 DO 90 icd = 1, 2
1079 diag = ichd( icd: icd )
1080
1081 DO 80 ia = 1, nalf
1082 alpha = alf( ia )
1083
1084
1085
1086 CALL zmake(
'TR', uplo, diag, na, na, a,
1087 $ nmax, aa, lda, reset, zero )
1088
1089
1090
1091 CALL zmake(
'GE',
' ',
' ', m, n, b, nmax,
1092 $ bb, ldb, reset, zero )
1093
1094 nc = nc + 1
1095
1096
1097
1098
1099 sides = side
1100 uplos = uplo
1101 tranas = transa
1102 diags = diag
1103 ms = m
1104 ns = n
1105 als = alpha
1106 DO 30 i = 1, laa
1107 as( i ) = aa( i )
1108 30 CONTINUE
1109 ldas = lda
1110 DO 40 i = 1, lbb
1111 bs( i ) = bb( i )
1112 40 CONTINUE
1113 ldbs = ldb
1114
1115
1116
1117 IF( sname( 4: 5 ).EQ.'MM' )THEN
1118 IF( trace )
1119 $ WRITE( ntra, fmt = 9995 )nc, sname,
1120 $ side, uplo, transa, diag, m, n, alpha,
1121 $ lda, ldb
1122 IF( rewi )
1123 $ rewind ntra
1124 CALL ztrmm( side, uplo, transa, diag, m,
1125 $ n, alpha, aa, lda, bb, ldb )
1126 ELSE IF( sname( 4: 5 ).EQ.'SM' )THEN
1127 IF( trace )
1128 $ WRITE( ntra, fmt = 9995 )nc, sname,
1129 $ side, uplo, transa, diag, m, n, alpha,
1130 $ lda, ldb
1131 IF( rewi )
1132 $ rewind ntra
1133 CALL ztrsm( side, uplo, transa, diag, m,
1134 $ n, alpha, aa, lda, bb, ldb )
1135 END IF
1136
1137
1138
1139 IF( .NOT.ok )THEN
1140 WRITE( nout, fmt = 9994 )
1141 fatal = .true.
1142 GO TO 150
1143 END IF
1144
1145
1146
1147 isame( 1 ) = sides.EQ.side
1148 isame( 2 ) = uplos.EQ.uplo
1149 isame( 3 ) = tranas.EQ.transa
1150 isame( 4 ) = diags.EQ.diag
1151 isame( 5 ) = ms.EQ.m
1152 isame( 6 ) = ns.EQ.n
1153 isame( 7 ) = als.EQ.alpha
1154 isame( 8 ) =
lze( as, aa, laa )
1155 isame( 9 ) = ldas.EQ.lda
1156 IF( null )THEN
1157 isame( 10 ) =
lze( bs, bb, lbb )
1158 ELSE
1159 isame( 10 ) =
lzeres(
'GE',
' ', m, n, bs,
1160 $ bb, ldb )
1161 END IF
1162 isame( 11 ) = ldbs.EQ.ldb
1163
1164
1165
1166
1167 same = .true.
1168 DO 50 i = 1, nargs
1169 same = same.AND.isame( i )
1170 IF( .NOT.isame( i ) )
1171 $ WRITE( nout, fmt = 9998 )i
1172 50 CONTINUE
1173 IF( .NOT.same )THEN
1174 fatal = .true.
1175 GO TO 150
1176 END IF
1177
1178 IF( .NOT.null )THEN
1179 IF( sname( 4: 5 ).EQ.'MM' )THEN
1180
1181
1182
1183 IF( left )THEN
1184 CALL zmmch( transa,
'N', m, n, m,
1185 $ alpha, a, nmax, b, nmax,
1186 $ zero, c, nmax, ct, g,
1187 $ bb, ldb, eps, err,
1188 $ fatal, nout, .true. )
1189 ELSE
1190 CALL zmmch(
'N', transa, m, n, n,
1191 $ alpha, b, nmax, a, nmax,
1192 $ zero, c, nmax, ct, g,
1193 $ bb, ldb, eps, err,
1194 $ fatal, nout, .true. )
1195 END IF
1196 ELSE IF( sname( 4: 5 ).EQ.'SM' )THEN
1197
1198
1199
1200
1201 DO 70 j = 1, n
1202 DO 60 i = 1, m
1203 c( i, j ) = bb( i + ( j - 1 )*
1204 $ ldb )
1205 bb( i + ( j - 1 )*ldb ) = alpha*
1206 $ b( i, j )
1207 60 CONTINUE
1208 70 CONTINUE
1209
1210 IF( left )THEN
1211 CALL zmmch( transa,
'N', m, n, m,
1212 $ one, a, nmax, c, nmax,
1213 $ zero, b, nmax, ct, g,
1214 $ bb, ldb, eps, err,
1215 $ fatal, nout, .false. )
1216 ELSE
1217 CALL zmmch(
'N', transa, m, n, n,
1218 $ one, c, nmax, a, nmax,
1219 $ zero, b, nmax, ct, g,
1220 $ bb, ldb, eps, err,
1221 $ fatal, nout, .false. )
1222 END IF
1223 END IF
1224 errmax = max( errmax, err )
1225
1226
1227 IF( fatal )
1228 $ GO TO 150
1229 END IF
1230
1231 80 CONTINUE
1232
1233 90 CONTINUE
1234
1235 100 CONTINUE
1236
1237 110 CONTINUE
1238
1239 120 CONTINUE
1240
1241 130 CONTINUE
1242
1243 140 CONTINUE
1244
1245
1246
1247 IF( errmax.LT.thresh )THEN
1248 WRITE( nout, fmt = 9999 )sname, nc
1249 ELSE
1250 WRITE( nout, fmt = 9997 )sname, nc, errmax
1251 END IF
1252 GO TO 160
1253
1254 150 CONTINUE
1255 WRITE( nout, fmt = 9996 )sname
1256 WRITE( nout, fmt = 9995 )nc, sname, side, uplo, transa, diag, m,
1257 $ n, alpha, lda, ldb
1258
1259 160 CONTINUE
1260 RETURN
1261
1262 9999 FORMAT( ' ', a6, ' PASSED THE COMPUTATIONAL TESTS (', i6, ' CALL',
1263 $ 'S)' )
1264 9998 FORMAT( ' ******* FATAL ERROR - PARAMETER NUMBER ', i2, ' WAS CH',
1265 $ 'ANGED INCORRECTLY *******' )
1266 9997 FORMAT( ' ', a6, ' COMPLETED THE COMPUTATIONAL TESTS (', i6, ' C',
1267 $ 'ALLS)', /' ******* BUT WITH MAXIMUM TEST RATIO', f8.2,
1268 $ ' - SUSPECT *******' )
1269 9996 FORMAT( ' ******* ', a6, ' FAILED ON CALL NUMBER:' )
1270 9995 FORMAT( 1x, i6, ': ', a6, '(', 4( '''', a1, ''',' ), 2( i3, ',' ),
1271 $ '(', f4.1, ',', f4.1, '), A,', i3, ', B,', i3, ') ',
1272 $ ' .' )
1273 9994 FORMAT( ' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
1274 $ '******' )
1275
1276
1277
subroutine ztrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
ZTRMM
subroutine ztrsm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
ZTRSM
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)