00001 SUBROUTINE SCHKGE( DOTYPE, NM, MVAL, NN, NVAL, NNB, NBVAL, NNS,
00002 $ NSVAL, THRESH, TSTERR, NMAX, A, AFAC, AINV, B,
00003 $ X, XACT, WORK, RWORK, IWORK, NOUT )
00004
00005
00006
00007
00008
00009
00010 LOGICAL TSTERR
00011 INTEGER NM, NMAX, NN, NNB, NNS, NOUT
00012 REAL THRESH
00013
00014
00015 LOGICAL DOTYPE( * )
00016 INTEGER IWORK( * ), MVAL( * ), NBVAL( * ), NSVAL( * ),
00017 $ NVAL( * )
00018 REAL A( * ), AFAC( * ), AINV( * ), B( * ),
00019 $ RWORK( * ), WORK( * ), X( * ), XACT( * )
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098 REAL ONE, ZERO
00099 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
00100 INTEGER NTYPES
00101 PARAMETER ( NTYPES = 11 )
00102 INTEGER NTESTS
00103 PARAMETER ( NTESTS = 8 )
00104 INTEGER NTRAN
00105 PARAMETER ( NTRAN = 3 )
00106
00107
00108 LOGICAL TRFCON, ZEROT
00109 CHARACTER DIST, NORM, TRANS, TYPE, XTYPE
00110 CHARACTER*3 PATH
00111 INTEGER I, IM, IMAT, IN, INB, INFO, IOFF, IRHS, ITRAN,
00112 $ IZERO, K, KL, KU, LDA, LWORK, M, MODE, N, NB,
00113 $ NERRS, NFAIL, NIMAT, NRHS, NRUN, NT
00114 REAL AINVNM, ANORM, ANORMI, ANORMO, CNDNUM, DUMMY,
00115 $ RCOND, RCONDC, RCONDI, RCONDO
00116
00117
00118 CHARACTER TRANSS( NTRAN )
00119 INTEGER ISEED( 4 ), ISEEDY( 4 )
00120 REAL RESULT( NTESTS )
00121
00122
00123 REAL SGET06, SLANGE
00124 EXTERNAL SGET06, SLANGE
00125
00126
00127 EXTERNAL ALAERH, ALAHD, ALASUM, SERRGE, SGECON, SGERFS,
00128 $ SGET01, SGET02, SGET03, SGET04, SGET07, SGETRF,
00129 $ SGETRI, SGETRS, SLACPY, SLARHS, SLASET, SLATB4,
00130 $ SLATMS, XLAENV
00131
00132
00133 INTRINSIC MAX, MIN
00134
00135
00136 LOGICAL LERR, OK
00137 CHARACTER*32 SRNAMT
00138 INTEGER INFOT, NUNIT
00139
00140
00141 COMMON / INFOC / INFOT, NUNIT, OK, LERR
00142 COMMON / SRNAMC / SRNAMT
00143
00144
00145 DATA ISEEDY / 1988, 1989, 1990, 1991 / ,
00146 $ TRANSS / 'N', 'T', 'C' /
00147
00148
00149
00150
00151
00152 PATH( 1: 1 ) = 'Single precision'
00153 PATH( 2: 3 ) = 'GE'
00154 NRUN = 0
00155 NFAIL = 0
00156 NERRS = 0
00157 DO 10 I = 1, 4
00158 ISEED( I ) = ISEEDY( I )
00159 10 CONTINUE
00160
00161
00162
00163 CALL XLAENV( 1, 1 )
00164 IF( TSTERR )
00165 $ CALL SERRGE( PATH, NOUT )
00166 INFOT = 0
00167 CALL XLAENV( 2, 2 )
00168
00169
00170
00171 DO 120 IM = 1, NM
00172 M = MVAL( IM )
00173 LDA = MAX( 1, M )
00174
00175
00176
00177 DO 110 IN = 1, NN
00178 N = NVAL( IN )
00179 XTYPE = 'N'
00180 NIMAT = NTYPES
00181 IF( M.LE.0 .OR. N.LE.0 )
00182 $ NIMAT = 1
00183
00184 DO 100 IMAT = 1, NIMAT
00185
00186
00187
00188 IF( .NOT.DOTYPE( IMAT ) )
00189 $ GO TO 100
00190
00191
00192
00193 ZEROT = IMAT.GE.5 .AND. IMAT.LE.7
00194 IF( ZEROT .AND. N.LT.IMAT-4 )
00195 $ GO TO 100
00196
00197
00198
00199
00200 CALL SLATB4( PATH, IMAT, M, N, TYPE, KL, KU, ANORM, MODE,
00201 $ CNDNUM, DIST )
00202
00203 SRNAMT = 'SLATMS'
00204 CALL SLATMS( M, N, DIST, ISEED, TYPE, RWORK, MODE,
00205 $ CNDNUM, ANORM, KL, KU, 'No packing', A, LDA,
00206 $ WORK, INFO )
00207
00208
00209
00210 IF( INFO.NE.0 ) THEN
00211 CALL ALAERH( PATH, 'SLATMS', INFO, 0, ' ', M, N, -1,
00212 $ -1, -1, IMAT, NFAIL, NERRS, NOUT )
00213 GO TO 100
00214 END IF
00215
00216
00217
00218
00219 IF( ZEROT ) THEN
00220 IF( IMAT.EQ.5 ) THEN
00221 IZERO = 1
00222 ELSE IF( IMAT.EQ.6 ) THEN
00223 IZERO = MIN( M, N )
00224 ELSE
00225 IZERO = MIN( M, N ) / 2 + 1
00226 END IF
00227 IOFF = ( IZERO-1 )*LDA
00228 IF( IMAT.LT.7 ) THEN
00229 DO 20 I = 1, M
00230 A( IOFF+I ) = ZERO
00231 20 CONTINUE
00232 ELSE
00233 CALL SLASET( 'Full', M, N-IZERO+1, ZERO, ZERO,
00234 $ A( IOFF+1 ), LDA )
00235 END IF
00236 ELSE
00237 IZERO = 0
00238 END IF
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248 DO 90 INB = 1, NNB
00249 NB = NBVAL( INB )
00250 CALL XLAENV( 1, NB )
00251
00252
00253
00254 CALL SLACPY( 'Full', M, N, A, LDA, AFAC, LDA )
00255 SRNAMT = 'SGETRF'
00256 CALL SGETRF( M, N, AFAC, LDA, IWORK, INFO )
00257
00258
00259
00260 IF( INFO.NE.IZERO )
00261 $ CALL ALAERH( PATH, 'SGETRF', INFO, IZERO, ' ', M,
00262 $ N, -1, -1, NB, IMAT, NFAIL, NERRS,
00263 $ NOUT )
00264 TRFCON = .FALSE.
00265
00266
00267
00268
00269 CALL SLACPY( 'Full', M, N, AFAC, LDA, AINV, LDA )
00270 CALL SGET01( M, N, A, LDA, AINV, LDA, IWORK, RWORK,
00271 $ RESULT( 1 ) )
00272 NT = 1
00273
00274
00275
00276
00277
00278 IF( M.EQ.N .AND. INFO.EQ.0 ) THEN
00279 CALL SLACPY( 'Full', N, N, AFAC, LDA, AINV, LDA )
00280 SRNAMT = 'SGETRI'
00281 NRHS = NSVAL( 1 )
00282 LWORK = NMAX*MAX( 3, NRHS )
00283 CALL SGETRI( N, AINV, LDA, IWORK, WORK, LWORK,
00284 $ INFO )
00285
00286
00287
00288 IF( INFO.NE.0 )
00289 $ CALL ALAERH( PATH, 'SGETRI', INFO, 0, ' ', N, N,
00290 $ -1, -1, NB, IMAT, NFAIL, NERRS,
00291 $ NOUT )
00292
00293
00294
00295
00296
00297 CALL SGET03( N, A, LDA, AINV, LDA, WORK, LDA,
00298 $ RWORK, RCONDO, RESULT( 2 ) )
00299 ANORMO = SLANGE( 'O', M, N, A, LDA, RWORK )
00300
00301
00302
00303 ANORMI = SLANGE( 'I', M, N, A, LDA, RWORK )
00304 AINVNM = SLANGE( 'I', N, N, AINV, LDA, RWORK )
00305 IF( ANORMI.LE.ZERO .OR. AINVNM.LE.ZERO ) THEN
00306 RCONDI = ONE
00307 ELSE
00308 RCONDI = ( ONE / ANORMI ) / AINVNM
00309 END IF
00310 NT = 2
00311 ELSE
00312
00313
00314
00315 TRFCON = .TRUE.
00316 ANORMO = SLANGE( 'O', M, N, A, LDA, RWORK )
00317 ANORMI = SLANGE( 'I', M, N, A, LDA, RWORK )
00318 RCONDO = ZERO
00319 RCONDI = ZERO
00320 END IF
00321
00322
00323
00324
00325 DO 30 K = 1, NT
00326 IF( RESULT( K ).GE.THRESH ) THEN
00327 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00328 $ CALL ALAHD( NOUT, PATH )
00329 WRITE( NOUT, FMT = 9999 )M, N, NB, IMAT, K,
00330 $ RESULT( K )
00331 NFAIL = NFAIL + 1
00332 END IF
00333 30 CONTINUE
00334 NRUN = NRUN + NT
00335
00336
00337
00338
00339
00340 IF( INB.GT.1 .OR. M.NE.N )
00341 $ GO TO 90
00342 IF( TRFCON )
00343 $ GO TO 70
00344
00345 DO 60 IRHS = 1, NNS
00346 NRHS = NSVAL( IRHS )
00347 XTYPE = 'N'
00348
00349 DO 50 ITRAN = 1, NTRAN
00350 TRANS = TRANSS( ITRAN )
00351 IF( ITRAN.EQ.1 ) THEN
00352 RCONDC = RCONDO
00353 ELSE
00354 RCONDC = RCONDI
00355 END IF
00356
00357
00358
00359
00360 SRNAMT = 'SLARHS'
00361 CALL SLARHS( PATH, XTYPE, ' ', TRANS, N, N, KL,
00362 $ KU, NRHS, A, LDA, XACT, LDA, B,
00363 $ LDA, ISEED, INFO )
00364 XTYPE = 'C'
00365
00366 CALL SLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
00367 SRNAMT = 'SGETRS'
00368 CALL SGETRS( TRANS, N, NRHS, AFAC, LDA, IWORK,
00369 $ X, LDA, INFO )
00370
00371
00372
00373 IF( INFO.NE.0 )
00374 $ CALL ALAERH( PATH, 'SGETRS', INFO, 0, TRANS,
00375 $ N, N, -1, -1, NRHS, IMAT, NFAIL,
00376 $ NERRS, NOUT )
00377
00378 CALL SLACPY( 'Full', N, NRHS, B, LDA, WORK,
00379 $ LDA )
00380 CALL SGET02( TRANS, N, N, NRHS, A, LDA, X, LDA,
00381 $ WORK, LDA, RWORK, RESULT( 3 ) )
00382
00383
00384
00385
00386 CALL SGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00387 $ RESULT( 4 ) )
00388
00389
00390
00391
00392
00393 SRNAMT = 'SGERFS'
00394 CALL SGERFS( TRANS, N, NRHS, A, LDA, AFAC, LDA,
00395 $ IWORK, B, LDA, X, LDA, RWORK,
00396 $ RWORK( NRHS+1 ), WORK,
00397 $ IWORK( N+1 ), INFO )
00398
00399
00400
00401 IF( INFO.NE.0 )
00402 $ CALL ALAERH( PATH, 'SGERFS', INFO, 0, TRANS,
00403 $ N, N, -1, -1, NRHS, IMAT, NFAIL,
00404 $ NERRS, NOUT )
00405
00406 CALL SGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00407 $ RESULT( 5 ) )
00408 CALL SGET07( TRANS, N, NRHS, A, LDA, B, LDA, X,
00409 $ LDA, XACT, LDA, RWORK, .TRUE.,
00410 $ RWORK( NRHS+1 ), RESULT( 6 ) )
00411
00412
00413
00414
00415 DO 40 K = 3, 7
00416 IF( RESULT( K ).GE.THRESH ) THEN
00417 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00418 $ CALL ALAHD( NOUT, PATH )
00419 WRITE( NOUT, FMT = 9998 )TRANS, N, NRHS,
00420 $ IMAT, K, RESULT( K )
00421 NFAIL = NFAIL + 1
00422 END IF
00423 40 CONTINUE
00424 NRUN = NRUN + 5
00425 50 CONTINUE
00426 60 CONTINUE
00427
00428
00429
00430
00431 70 CONTINUE
00432 DO 80 ITRAN = 1, 2
00433 IF( ITRAN.EQ.1 ) THEN
00434 ANORM = ANORMO
00435 RCONDC = RCONDO
00436 NORM = 'O'
00437 ELSE
00438 ANORM = ANORMI
00439 RCONDC = RCONDI
00440 NORM = 'I'
00441 END IF
00442 SRNAMT = 'SGECON'
00443 CALL SGECON( NORM, N, AFAC, LDA, ANORM, RCOND,
00444 $ WORK, IWORK( N+1 ), INFO )
00445
00446
00447
00448 IF( INFO.NE.0 )
00449 $ CALL ALAERH( PATH, 'SGECON', INFO, 0, NORM, N,
00450 $ N, -1, -1, -1, IMAT, NFAIL, NERRS,
00451 $ NOUT )
00452
00453
00454
00455 DUMMY = RCOND
00456
00457 RESULT( 8 ) = SGET06( RCOND, RCONDC )
00458
00459
00460
00461
00462 IF( RESULT( 8 ).GE.THRESH ) THEN
00463 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00464 $ CALL ALAHD( NOUT, PATH )
00465 WRITE( NOUT, FMT = 9997 )NORM, N, IMAT, 8,
00466 $ RESULT( 8 )
00467 NFAIL = NFAIL + 1
00468 END IF
00469 NRUN = NRUN + 1
00470 80 CONTINUE
00471 90 CONTINUE
00472 100 CONTINUE
00473 110 CONTINUE
00474 120 CONTINUE
00475
00476
00477
00478 CALL ALASUM( PATH, NOUT, NFAIL, NRUN, NERRS )
00479
00480 9999 FORMAT( ' M = ', I5, ', N =', I5, ', NB =', I4, ', type ', I2,
00481 $ ', test(', I2, ') =', G12.5 )
00482 9998 FORMAT( ' TRANS=''', A1, ''', N =', I5, ', NRHS=', I3, ', type ',
00483 $ I2, ', test(', I2, ') =', G12.5 )
00484 9997 FORMAT( ' NORM =''', A1, ''', N =', I5, ',', 10X, ' type ', I2,
00485 $ ', test(', I2, ') =', G12.5 )
00486 RETURN
00487
00488
00489
00490 END