00001 SUBROUTINE CCHKGT( DOTYPE, NN, NVAL, NNS, NSVAL, THRESH, TSTERR,
00002 $ A, AF, B, X, XACT, WORK, RWORK, IWORK, NOUT )
00003
00004
00005
00006
00007
00008
00009 LOGICAL TSTERR
00010 INTEGER NN, NNS, NOUT
00011 REAL THRESH
00012
00013
00014 LOGICAL DOTYPE( * )
00015 INTEGER IWORK( * ), NSVAL( * ), NVAL( * )
00016 REAL RWORK( * )
00017 COMPLEX A( * ), AF( * ), B( * ), WORK( * ), X( * ),
00018 $ XACT( * )
00019
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 REAL ONE, ZERO
00080 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
00081 INTEGER NTYPES
00082 PARAMETER ( NTYPES = 12 )
00083 INTEGER NTESTS
00084 PARAMETER ( NTESTS = 7 )
00085
00086
00087 LOGICAL TRFCON, ZEROT
00088 CHARACTER DIST, NORM, TRANS, TYPE
00089 CHARACTER*3 PATH
00090 INTEGER I, IMAT, IN, INFO, IRHS, ITRAN, IX, IZERO, J,
00091 $ K, KL, KOFF, KU, LDA, M, MODE, N, NERRS, NFAIL,
00092 $ NIMAT, NRHS, NRUN
00093 REAL AINVNM, ANORM, COND, RCOND, RCONDC, RCONDI,
00094 $ RCONDO
00095
00096
00097 CHARACTER TRANSS( 3 )
00098 INTEGER ISEED( 4 ), ISEEDY( 4 )
00099 REAL RESULT( NTESTS )
00100 COMPLEX Z( 3 )
00101
00102
00103 REAL CLANGT, SCASUM, SGET06
00104 EXTERNAL CLANGT, SCASUM, SGET06
00105
00106
00107 EXTERNAL ALAERH, ALAHD, ALASUM, CCOPY, CERRGE, CGET04,
00108 $ CGTCON, CGTRFS, CGTT01, CGTT02, CGTT05, CGTTRF,
00109 $ CGTTRS, CLACPY, CLAGTM, CLARNV, CLATB4, CLATMS,
00110 $ CSSCAL
00111
00112
00113 INTRINSIC MAX
00114
00115
00116 LOGICAL LERR, OK
00117 CHARACTER*32 SRNAMT
00118 INTEGER INFOT, NUNIT
00119
00120
00121 COMMON / INFOC / INFOT, NUNIT, OK, LERR
00122 COMMON / SRNAMC / SRNAMT
00123
00124
00125 DATA ISEEDY / 0, 0, 0, 1 / , TRANSS / 'N', 'T',
00126 $ 'C' /
00127
00128
00129
00130 PATH( 1: 1 ) = 'Complex precision'
00131 PATH( 2: 3 ) = 'GT'
00132 NRUN = 0
00133 NFAIL = 0
00134 NERRS = 0
00135 DO 10 I = 1, 4
00136 ISEED( I ) = ISEEDY( I )
00137 10 CONTINUE
00138
00139
00140
00141 IF( TSTERR )
00142 $ CALL CERRGE( PATH, NOUT )
00143 INFOT = 0
00144
00145 DO 110 IN = 1, NN
00146
00147
00148
00149 N = NVAL( IN )
00150 M = MAX( N-1, 0 )
00151 LDA = MAX( 1, N )
00152 NIMAT = NTYPES
00153 IF( N.LE.0 )
00154 $ NIMAT = 1
00155
00156 DO 100 IMAT = 1, NIMAT
00157
00158
00159
00160 IF( .NOT.DOTYPE( IMAT ) )
00161 $ GO TO 100
00162
00163
00164
00165 CALL CLATB4( PATH, IMAT, N, N, TYPE, KL, KU, ANORM, MODE,
00166 $ COND, DIST )
00167
00168 ZEROT = IMAT.GE.8 .AND. IMAT.LE.10
00169 IF( IMAT.LE.6 ) THEN
00170
00171
00172
00173 KOFF = MAX( 2-KU, 3-MAX( 1, N ) )
00174 SRNAMT = 'CLATMS'
00175 CALL CLATMS( N, N, DIST, ISEED, TYPE, RWORK, MODE, COND,
00176 $ ANORM, KL, KU, 'Z', AF( KOFF ), 3, WORK,
00177 $ INFO )
00178
00179
00180
00181 IF( INFO.NE.0 ) THEN
00182 CALL ALAERH( PATH, 'CLATMS', INFO, 0, ' ', N, N, KL,
00183 $ KU, -1, IMAT, NFAIL, NERRS, NOUT )
00184 GO TO 100
00185 END IF
00186 IZERO = 0
00187
00188 IF( N.GT.1 ) THEN
00189 CALL CCOPY( N-1, AF( 4 ), 3, A, 1 )
00190 CALL CCOPY( N-1, AF( 3 ), 3, A( N+M+1 ), 1 )
00191 END IF
00192 CALL CCOPY( N, AF( 2 ), 3, A( M+1 ), 1 )
00193 ELSE
00194
00195
00196
00197
00198 IF( .NOT.ZEROT .OR. .NOT.DOTYPE( 7 ) ) THEN
00199
00200
00201
00202
00203 CALL CLARNV( 2, ISEED, N+2*M, A )
00204 IF( ANORM.NE.ONE )
00205 $ CALL CSSCAL( N+2*M, ANORM, A, 1 )
00206 ELSE IF( IZERO.GT.0 ) THEN
00207
00208
00209
00210
00211 IF( IZERO.EQ.1 ) THEN
00212 A( N ) = Z( 2 )
00213 IF( N.GT.1 )
00214 $ A( 1 ) = Z( 3 )
00215 ELSE IF( IZERO.EQ.N ) THEN
00216 A( 3*N-2 ) = Z( 1 )
00217 A( 2*N-1 ) = Z( 2 )
00218 ELSE
00219 A( 2*N-2+IZERO ) = Z( 1 )
00220 A( N-1+IZERO ) = Z( 2 )
00221 A( IZERO ) = Z( 3 )
00222 END IF
00223 END IF
00224
00225
00226
00227 IF( .NOT.ZEROT ) THEN
00228 IZERO = 0
00229 ELSE IF( IMAT.EQ.8 ) THEN
00230 IZERO = 1
00231 Z( 2 ) = A( N )
00232 A( N ) = ZERO
00233 IF( N.GT.1 ) THEN
00234 Z( 3 ) = A( 1 )
00235 A( 1 ) = ZERO
00236 END IF
00237 ELSE IF( IMAT.EQ.9 ) THEN
00238 IZERO = N
00239 Z( 1 ) = A( 3*N-2 )
00240 Z( 2 ) = A( 2*N-1 )
00241 A( 3*N-2 ) = ZERO
00242 A( 2*N-1 ) = ZERO
00243 ELSE
00244 IZERO = ( N+1 ) / 2
00245 DO 20 I = IZERO, N - 1
00246 A( 2*N-2+I ) = ZERO
00247 A( N-1+I ) = ZERO
00248 A( I ) = ZERO
00249 20 CONTINUE
00250 A( 3*N-2 ) = ZERO
00251 A( 2*N-1 ) = ZERO
00252 END IF
00253 END IF
00254
00255
00256
00257
00258
00259 CALL CCOPY( N+2*M, A, 1, AF, 1 )
00260 SRNAMT = 'CGTTRF'
00261 CALL CGTTRF( N, AF, AF( M+1 ), AF( N+M+1 ), AF( N+2*M+1 ),
00262 $ IWORK, INFO )
00263
00264
00265
00266 IF( INFO.NE.IZERO )
00267 $ CALL ALAERH( PATH, 'CGTTRF', INFO, IZERO, ' ', N, N, 1,
00268 $ 1, -1, IMAT, NFAIL, NERRS, NOUT )
00269 TRFCON = INFO.NE.0
00270
00271 CALL CGTT01( N, A, A( M+1 ), A( N+M+1 ), AF, AF( M+1 ),
00272 $ AF( N+M+1 ), AF( N+2*M+1 ), IWORK, WORK, LDA,
00273 $ RWORK, RESULT( 1 ) )
00274
00275
00276
00277 IF( RESULT( 1 ).GE.THRESH ) THEN
00278 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00279 $ CALL ALAHD( NOUT, PATH )
00280 WRITE( NOUT, FMT = 9999 )N, IMAT, 1, RESULT( 1 )
00281 NFAIL = NFAIL + 1
00282 END IF
00283 NRUN = NRUN + 1
00284
00285 DO 50 ITRAN = 1, 2
00286 TRANS = TRANSS( ITRAN )
00287 IF( ITRAN.EQ.1 ) THEN
00288 NORM = 'O'
00289 ELSE
00290 NORM = 'I'
00291 END IF
00292 ANORM = CLANGT( NORM, N, A, A( M+1 ), A( N+M+1 ) )
00293
00294 IF( .NOT.TRFCON ) THEN
00295
00296
00297
00298
00299 AINVNM = ZERO
00300 DO 40 I = 1, N
00301 DO 30 J = 1, N
00302 X( J ) = ZERO
00303 30 CONTINUE
00304 X( I ) = ONE
00305 CALL CGTTRS( TRANS, N, 1, AF, AF( M+1 ),
00306 $ AF( N+M+1 ), AF( N+2*M+1 ), IWORK, X,
00307 $ LDA, INFO )
00308 AINVNM = MAX( AINVNM, SCASUM( N, X, 1 ) )
00309 40 CONTINUE
00310
00311
00312
00313 IF( ANORM.LE.ZERO .OR. AINVNM.LE.ZERO ) THEN
00314 RCONDC = ONE
00315 ELSE
00316 RCONDC = ( ONE / ANORM ) / AINVNM
00317 END IF
00318 IF( ITRAN.EQ.1 ) THEN
00319 RCONDO = RCONDC
00320 ELSE
00321 RCONDI = RCONDC
00322 END IF
00323 ELSE
00324 RCONDC = ZERO
00325 END IF
00326
00327
00328
00329
00330
00331 SRNAMT = 'CGTCON'
00332 CALL CGTCON( NORM, N, AF, AF( M+1 ), AF( N+M+1 ),
00333 $ AF( N+2*M+1 ), IWORK, ANORM, RCOND, WORK,
00334 $ INFO )
00335
00336
00337
00338 IF( INFO.NE.0 )
00339 $ CALL ALAERH( PATH, 'CGTCON', INFO, 0, NORM, N, N, -1,
00340 $ -1, -1, IMAT, NFAIL, NERRS, NOUT )
00341
00342 RESULT( 7 ) = SGET06( RCOND, RCONDC )
00343
00344
00345
00346 IF( RESULT( 7 ).GE.THRESH ) THEN
00347 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00348 $ CALL ALAHD( NOUT, PATH )
00349 WRITE( NOUT, FMT = 9997 )NORM, N, IMAT, 7,
00350 $ RESULT( 7 )
00351 NFAIL = NFAIL + 1
00352 END IF
00353 NRUN = NRUN + 1
00354 50 CONTINUE
00355
00356
00357
00358 IF( TRFCON )
00359 $ GO TO 100
00360
00361 DO 90 IRHS = 1, NNS
00362 NRHS = NSVAL( IRHS )
00363
00364
00365
00366 IX = 1
00367 DO 60 J = 1, NRHS
00368 CALL CLARNV( 2, ISEED, N, XACT( IX ) )
00369 IX = IX + LDA
00370 60 CONTINUE
00371
00372 DO 80 ITRAN = 1, 3
00373 TRANS = TRANSS( ITRAN )
00374 IF( ITRAN.EQ.1 ) THEN
00375 RCONDC = RCONDO
00376 ELSE
00377 RCONDC = RCONDI
00378 END IF
00379
00380
00381
00382 CALL CLAGTM( TRANS, N, NRHS, ONE, A,
00383 $ A( M+1 ), A( N+M+1 ), XACT, LDA,
00384 $ ZERO, B, LDA )
00385
00386
00387
00388
00389 CALL CLACPY( 'Full', N, NRHS, B, LDA, X, LDA )
00390 SRNAMT = 'CGTTRS'
00391 CALL CGTTRS( TRANS, N, NRHS, AF, AF( M+1 ),
00392 $ AF( N+M+1 ), AF( N+2*M+1 ), IWORK, X,
00393 $ LDA, INFO )
00394
00395
00396
00397 IF( INFO.NE.0 )
00398 $ CALL ALAERH( PATH, 'CGTTRS', INFO, 0, TRANS, N, N,
00399 $ -1, -1, NRHS, IMAT, NFAIL, NERRS,
00400 $ NOUT )
00401
00402 CALL CLACPY( 'Full', N, NRHS, B, LDA, WORK, LDA )
00403 CALL CGTT02( TRANS, N, NRHS, A, A( M+1 ), A( N+M+1 ),
00404 $ X, LDA, WORK, LDA, RWORK, RESULT( 2 ) )
00405
00406
00407
00408
00409 CALL CGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00410 $ RESULT( 3 ) )
00411
00412
00413
00414
00415 SRNAMT = 'CGTRFS'
00416 CALL CGTRFS( TRANS, N, NRHS, A, A( M+1 ), A( N+M+1 ),
00417 $ AF, AF( M+1 ), AF( N+M+1 ),
00418 $ AF( N+2*M+1 ), IWORK, B, LDA, X, LDA,
00419 $ RWORK, RWORK( NRHS+1 ), WORK,
00420 $ RWORK( 2*NRHS+1 ), INFO )
00421
00422
00423
00424 IF( INFO.NE.0 )
00425 $ CALL ALAERH( PATH, 'CGTRFS', INFO, 0, TRANS, N, N,
00426 $ -1, -1, NRHS, IMAT, NFAIL, NERRS,
00427 $ NOUT )
00428
00429 CALL CGET04( N, NRHS, X, LDA, XACT, LDA, RCONDC,
00430 $ RESULT( 4 ) )
00431 CALL CGTT05( TRANS, N, NRHS, A, A( M+1 ), A( N+M+1 ),
00432 $ B, LDA, X, LDA, XACT, LDA, RWORK,
00433 $ RWORK( NRHS+1 ), RESULT( 5 ) )
00434
00435
00436
00437
00438 DO 70 K = 2, 6
00439 IF( RESULT( K ).GE.THRESH ) THEN
00440 IF( NFAIL.EQ.0 .AND. NERRS.EQ.0 )
00441 $ CALL ALAHD( NOUT, PATH )
00442 WRITE( NOUT, FMT = 9998 )TRANS, N, NRHS, IMAT,
00443 $ K, RESULT( K )
00444 NFAIL = NFAIL + 1
00445 END IF
00446 70 CONTINUE
00447 NRUN = NRUN + 5
00448 80 CONTINUE
00449 90 CONTINUE
00450 100 CONTINUE
00451 110 CONTINUE
00452
00453
00454
00455 CALL ALASUM( PATH, NOUT, NFAIL, NRUN, NERRS )
00456
00457 9999 FORMAT( 12X, 'N =', I5, ',', 10X, ' type ', I2, ', test(', I2,
00458 $ ') = ', G12.5 )
00459 9998 FORMAT( ' TRANS=''', A1, ''', N =', I5, ', NRHS=', I3, ', type ',
00460 $ I2, ', test(', I2, ') = ', G12.5 )
00461 9997 FORMAT( ' NORM =''', A1, ''', N =', I5, ',', 10X, ' type ', I2,
00462 $ ', test(', I2, ') = ', G12.5 )
00463 RETURN
00464
00465
00466
00467 END