1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088 REAL ZERO, ONE
1089 parameter( zero = 0.0, one = 1.0 )
1090
1091 REAL EPS, THRESH
1092 INTEGER NALF, NIDIM, NMAX, NOUT, NTRA, IORDER
1093 LOGICAL FATAL, REWI, TRACE
1094 CHARACTER*13 SNAME
1095
1096 REAL A( NMAX, NMAX ), AA( NMAX*NMAX ), ALF( NALF ),
1097 $ AS( NMAX*NMAX ), B( NMAX, NMAX ),
1098 $ BB( NMAX*NMAX ), BS( NMAX*NMAX ),
1099 $ C( NMAX, NMAX ), CT( NMAX ), G( NMAX )
1100 INTEGER IDIM( NIDIM )
1101
1102 REAL ALPHA, ALS, ERR, ERRMAX
1103 INTEGER I, IA, ICD, ICS, ICT, ICU, IM, IN, J, LAA, LBB,
1104 $ LDA, LDAS, LDB, LDBS, M, MS, N, NA, NARGS, NC,
1105 $ NS
1106 LOGICAL LEFT, NULL, RESET, SAME
1107 CHARACTER*1 DIAG, DIAGS, SIDE, SIDES, TRANAS, TRANSA, UPLO,
1108 $ UPLOS
1109 CHARACTER*2 ICHD, ICHS, ICHU
1110 CHARACTER*3 ICHT
1111
1112 LOGICAL ISAME( 13 )
1113
1114 LOGICAL LSE, LSERES
1116
1118
1119 INTRINSIC max
1120
1121 INTEGER INFOT, NOUTC
1122 LOGICAL OK
1123
1124 COMMON /infoc/infot, noutc, ok
1125
1126 DATA ichu/'UL'/, icht/'NTC'/, ichd/'UN'/, ichs/'LR'/
1127
1128
1129 nargs = 11
1130 nc = 0
1131 reset = .true.
1132 errmax = zero
1133
1134 DO 20 j = 1, nmax
1135 DO 10 i = 1, nmax
1136 c( i, j ) = zero
1137 10 CONTINUE
1138 20 CONTINUE
1139
1140 DO 140 im = 1, nidim
1141 m = idim( im )
1142
1143 DO 130 in = 1, nidim
1144 n = idim( in )
1145
1146 ldb = m
1147 IF( ldb.LT.nmax )
1148 $ ldb = ldb + 1
1149
1150 IF( ldb.GT.nmax )
1151 $ GO TO 130
1152 lbb = ldb*n
1153 null = m.LE.0.OR.n.LE.0
1154
1155 DO 120 ics = 1, 2
1156 side = ichs( ics: ics )
1157 left = side.EQ.'L'
1158 IF( left )THEN
1159 na = m
1160 ELSE
1161 na = n
1162 END IF
1163
1164 lda = na
1165 IF( lda.LT.nmax )
1166 $ lda = lda + 1
1167
1168 IF( lda.GT.nmax )
1169 $ GO TO 130
1170 laa = lda*na
1171
1172 DO 110 icu = 1, 2
1173 uplo = ichu( icu: icu )
1174
1175 DO 100 ict = 1, 3
1176 transa = icht( ict: ict )
1177
1178 DO 90 icd = 1, 2
1179 diag = ichd( icd: icd )
1180
1181 DO 80 ia = 1, nalf
1182 alpha = alf( ia )
1183
1184
1185
1186 CALL smake(
'TR', uplo, diag, na, na, a,
1187 $ nmax, aa, lda, reset, zero )
1188
1189
1190
1191 CALL smake(
'GE',
' ',
' ', m, n, b, nmax,
1192 $ bb, ldb, reset, zero )
1193
1194 nc = nc + 1
1195
1196
1197
1198
1199 sides = side
1200 uplos = uplo
1201 tranas = transa
1202 diags = diag
1203 ms = m
1204 ns = n
1205 als = alpha
1206 DO 30 i = 1, laa
1207 as( i ) = aa( i )
1208 30 CONTINUE
1209 ldas = lda
1210 DO 40 i = 1, lbb
1211 bs( i ) = bb( i )
1212 40 CONTINUE
1213 ldbs = ldb
1214
1215
1216
1217 IF( sname( 10: 11 ).EQ.'mm' )THEN
1218 IF( trace )
1219 $
CALL sprcn3( ntra, nc, sname, iorder,
1220 $ side, uplo, transa, diag, m, n, alpha,
1221 $ lda, ldb)
1222 IF( rewi )
1223 $ rewind ntra
1224 CALL cstrmm( iorder, side, uplo, transa,
1225 $ diag, m, n, alpha, aa, lda,
1226 $ bb, ldb )
1227 ELSE IF( sname( 10: 11 ).EQ.'sm' )THEN
1228 IF( trace )
1229 $
CALL sprcn3( ntra, nc, sname, iorder,
1230 $ side, uplo, transa, diag, m, n, alpha,
1231 $ lda, ldb)
1232 IF( rewi )
1233 $ rewind ntra
1234 CALL cstrsm( iorder, side, uplo, transa,
1235 $ diag, m, n, alpha, aa, lda,
1236 $ bb, ldb )
1237 END IF
1238
1239
1240
1241 IF( .NOT.ok )THEN
1242 WRITE( nout, fmt = 9994 )
1243 fatal = .true.
1244 GO TO 150
1245 END IF
1246
1247
1248
1249 isame( 1 ) = sides.EQ.side
1250 isame( 2 ) = uplos.EQ.uplo
1251 isame( 3 ) = tranas.EQ.transa
1252 isame( 4 ) = diags.EQ.diag
1253 isame( 5 ) = ms.EQ.m
1254 isame( 6 ) = ns.EQ.n
1255 isame( 7 ) = als.EQ.alpha
1256 isame( 8 ) =
lse( as, aa, laa )
1257 isame( 9 ) = ldas.EQ.lda
1258 IF( null )THEN
1259 isame( 10 ) =
lse( bs, bb, lbb )
1260 ELSE
1261 isame( 10 ) =
lseres(
'GE',
' ', m, n, bs,
1262 $ bb, ldb )
1263 END IF
1264 isame( 11 ) = ldbs.EQ.ldb
1265
1266
1267
1268
1269 same = .true.
1270 DO 50 i = 1, nargs
1271 same = same.AND.isame( i )
1272 IF( .NOT.isame( i ) )
1273 $ WRITE( nout, fmt = 9998 )i+1
1274 50 CONTINUE
1275 IF( .NOT.same )THEN
1276 fatal = .true.
1277 GO TO 150
1278 END IF
1279
1280 IF( .NOT.null )THEN
1281 IF( sname( 10: 11 ).EQ.'mm' )THEN
1282
1283
1284
1285 IF( left )THEN
1286 CALL smmch( transa,
'N', m, n, m,
1287 $ alpha, a, nmax, b, nmax,
1288 $ zero, c, nmax, ct, g,
1289 $ bb, ldb, eps, err,
1290 $ fatal, nout, .true. )
1291 ELSE
1292 CALL smmch(
'N', transa, m, n, n,
1293 $ alpha, b, nmax, a, nmax,
1294 $ zero, c, nmax, ct, g,
1295 $ bb, ldb, eps, err,
1296 $ fatal, nout, .true. )
1297 END IF
1298 ELSE IF( sname( 10: 11 ).EQ.'sm' )THEN
1299
1300
1301
1302
1303 DO 70 j = 1, n
1304 DO 60 i = 1, m
1305 c( i, j ) = bb( i + ( j - 1 )*
1306 $ ldb )
1307 bb( i + ( j - 1 )*ldb ) = alpha*
1308 $ b( i, j )
1309 60 CONTINUE
1310 70 CONTINUE
1311
1312 IF( left )THEN
1313 CALL smmch( transa,
'N', m, n, m,
1314 $ one, a, nmax, c, nmax,
1315 $ zero, b, nmax, ct, g,
1316 $ bb, ldb, eps, err,
1317 $ fatal, nout, .false. )
1318 ELSE
1319 CALL smmch(
'N', transa, m, n, n,
1320 $ one, c, nmax, a, nmax,
1321 $ zero, b, nmax, ct, g,
1322 $ bb, ldb, eps, err,
1323 $ fatal, nout, .false. )
1324 END IF
1325 END IF
1326 errmax = max( errmax, err )
1327
1328
1329 IF( fatal )
1330 $ GO TO 150
1331 END IF
1332
1333 80 CONTINUE
1334
1335 90 CONTINUE
1336
1337 100 CONTINUE
1338
1339 110 CONTINUE
1340
1341 120 CONTINUE
1342
1343 130 CONTINUE
1344
1345 140 CONTINUE
1346
1347
1348
1349 IF( errmax.LT.thresh )THEN
1350 IF ( iorder.EQ.0) WRITE( nout, fmt = 10000 )sname, nc
1351 IF ( iorder.EQ.1) WRITE( nout, fmt = 10001 )sname, nc
1352 ELSE
1353 IF ( iorder.EQ.0) WRITE( nout, fmt = 10002 )sname, nc, errmax
1354 IF ( iorder.EQ.1) WRITE( nout, fmt = 10003 )sname, nc, errmax
1355 END IF
1356 GO TO 160
1357
1358 150 CONTINUE
1359 WRITE( nout, fmt = 9996 )sname
1360 IF( trace )
1361 $
CALL sprcn3( ntra, nc, sname, iorder, side, uplo, transa, diag,
1362 $ m, n, alpha, lda, ldb)
1363
1364 160 CONTINUE
1365 RETURN
1366
136710003 FORMAT( ' ', a13,' COMPLETED THE ROW-MAJOR COMPUTATIONAL ',
1368 $ 'TESTS (', i6, ' CALLS)', /' ******* BUT WITH MAXIMUM TEST ',
1369 $ 'RATIO ', f8.2, ' - SUSPECT *******' )
137010002 FORMAT( ' ', a13,' COMPLETED THE COLUMN-MAJOR COMPUTATIONAL ',
1371 $ 'TESTS (', i6, ' CALLS)', /' ******* BUT WITH MAXIMUM TEST ',
1372 $ 'RATIO ', f8.2, ' - SUSPECT *******' )
137310001 FORMAT( ' ', a13,' PASSED THE ROW-MAJOR COMPUTATIONAL TESTS',
1374 $ ' (', i6, ' CALL', 'S)' )
137510000 FORMAT( ' ', a13,' PASSED THE COLUMN-MAJOR COMPUTATIONAL TESTS',
1376 $ ' (', i6, ' CALL', 'S)' )
1377 9998 FORMAT( ' ******* FATAL ERROR - PARAMETER NUMBER ', i2, ' WAS CH',
1378 $ 'ANGED INCORRECTLY *******' )
1379 9996 FORMAT( ' ******* ', a13,' FAILED ON CALL NUMBER:' )
1380 9995 FORMAT( 1x, i6, ': ', a13,'(', 4( '''', a1, ''',' ), 2( i3, ',' ),
1381 $ f4.1, ', A,', i3, ', B,', i3, ') .' )
1382 9994 FORMAT( ' ******* FATAL ERROR - ERROR-EXIT TAKEN ON VALID CALL *',
1383 $ '******' )
1384
1385
1386
subroutine sprcn3(nout, nc, sname, iorder, side, uplo, transa, diag, m, n, alpha, lda, ldb)
logical function lseres(type, uplo, m, n, aa, as, lda)
subroutine smake(type, uplo, diag, m, n, a, nmax, aa, lda, kl, ku, reset, transl)
logical function lse(ri, rj, lr)
subroutine smmch(transa, transb, m, n, kk, alpha, a, lda, b, ldb, beta, c, ldc, ct, g, cc, ldcc, eps, err, fatal, nout, mv)