00001 SUBROUTINE CCHKGG( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
00002 $ TSTDIF, THRSHN, NOUNIT, A, LDA, B, H, T, S1,
00003 $ S2, P1, P2, U, LDU, V, Q, Z, ALPHA1, BETA1,
00004 $ ALPHA3, BETA3, EVECTL, EVECTR, WORK, LWORK,
00005 $ RWORK, LLWORK, RESULT, INFO )
00006
00007
00008
00009
00010
00011
00012 LOGICAL TSTDIF
00013 INTEGER INFO, LDA, LDU, LWORK, NOUNIT, NSIZES, NTYPES
00014 REAL THRESH, THRSHN
00015
00016
00017 LOGICAL DOTYPE( * ), LLWORK( * )
00018 INTEGER ISEED( 4 ), NN( * )
00019 REAL RESULT( 15 ), RWORK( * )
00020 COMPLEX A( LDA, * ), ALPHA1( * ), ALPHA3( * ),
00021 $ B( LDA, * ), BETA1( * ), BETA3( * ),
00022 $ EVECTL( LDU, * ), EVECTR( LDU, * ),
00023 $ H( LDA, * ), P1( LDA, * ), P2( LDA, * ),
00024 $ Q( LDU, * ), S1( LDA, * ), S2( LDA, * ),
00025 $ T( LDA, * ), U( LDU, * ), V( LDU, * ),
00026 $ WORK( * ), Z( LDU, * )
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
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
00146
00147
00148
00149
00150
00151
00152
00153
00154
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
00346
00347
00348
00349
00350
00351
00352
00353
00354
00355
00356
00357
00358
00359
00360
00361
00362
00363
00364
00365
00366
00367
00368
00369
00370
00371
00372
00373 REAL ZERO, ONE
00374 PARAMETER ( ZERO = 0.0E+0, ONE = 1.0E+0 )
00375 COMPLEX CZERO, CONE
00376 PARAMETER ( CZERO = ( 0.0E+0, 0.0E+0 ),
00377 $ CONE = ( 1.0E+0, 0.0E+0 ) )
00378 INTEGER MAXTYP
00379 PARAMETER ( MAXTYP = 26 )
00380
00381
00382 LOGICAL BADNN
00383 INTEGER I1, IADD, IINFO, IN, J, JC, JR, JSIZE, JTYPE,
00384 $ LWKOPT, MTYPES, N, N1, NERRS, NMATS, NMAX,
00385 $ NTEST, NTESTT
00386 REAL ANORM, BNORM, SAFMAX, SAFMIN, TEMP1, TEMP2,
00387 $ ULP, ULPINV
00388 COMPLEX CTEMP
00389
00390
00391 LOGICAL LASIGN( MAXTYP ), LBSIGN( MAXTYP )
00392 INTEGER IOLDSD( 4 ), KADD( 6 ), KAMAGN( MAXTYP ),
00393 $ KATYPE( MAXTYP ), KAZERO( MAXTYP ),
00394 $ KBMAGN( MAXTYP ), KBTYPE( MAXTYP ),
00395 $ KBZERO( MAXTYP ), KCLASS( MAXTYP ),
00396 $ KTRIAN( MAXTYP ), KZ1( 6 ), KZ2( 6 )
00397 REAL DUMMA( 4 ), RMAGN( 0: 3 )
00398 COMPLEX CDUMMA( 4 )
00399
00400
00401 REAL CLANGE, SLAMCH
00402 COMPLEX CLARND
00403 EXTERNAL CLANGE, SLAMCH, CLARND
00404
00405
00406 EXTERNAL CGEQR2, CGET51, CGET52, CGGHRD, CHGEQZ, CLACPY,
00407 $ CLARFG, CLASET, CLATM4, CTGEVC, CUNM2R, SLABAD,
00408 $ SLASUM, XERBLA
00409
00410
00411 INTRINSIC ABS, CONJG, MAX, MIN, REAL, SIGN
00412
00413
00414 DATA KCLASS / 15*1, 10*2, 1*3 /
00415 DATA KZ1 / 0, 1, 2, 1, 3, 3 /
00416 DATA KZ2 / 0, 0, 1, 2, 1, 1 /
00417 DATA KADD / 0, 0, 0, 0, 3, 2 /
00418 DATA KATYPE / 0, 1, 0, 1, 2, 3, 4, 1, 4, 4, 1, 1, 4,
00419 $ 4, 4, 2, 4, 5, 8, 7, 9, 4*4, 0 /
00420 DATA KBTYPE / 0, 0, 1, 1, 2, -3, 1, 4, 1, 1, 4, 4,
00421 $ 1, 1, -4, 2, -4, 8*8, 0 /
00422 DATA KAZERO / 6*1, 2, 1, 2*2, 2*1, 2*2, 3, 1, 3,
00423 $ 4*5, 4*3, 1 /
00424 DATA KBZERO / 6*1, 1, 2, 2*1, 2*2, 2*1, 4, 1, 4,
00425 $ 4*6, 4*4, 1 /
00426 DATA KAMAGN / 8*1, 2, 3, 2, 3, 2, 3, 7*1, 2, 3, 3,
00427 $ 2, 1 /
00428 DATA KBMAGN / 8*1, 3, 2, 3, 2, 2, 3, 7*1, 3, 2, 3,
00429 $ 2, 1 /
00430 DATA KTRIAN / 16*0, 10*1 /
00431 DATA LASIGN / 6*.FALSE., .TRUE., .FALSE., 2*.TRUE.,
00432 $ 2*.FALSE., 3*.TRUE., .FALSE., .TRUE.,
00433 $ 3*.FALSE., 5*.TRUE., .FALSE. /
00434 DATA LBSIGN / 7*.FALSE., .TRUE., 2*.FALSE.,
00435 $ 2*.TRUE., 2*.FALSE., .TRUE., .FALSE., .TRUE.,
00436 $ 9*.FALSE. /
00437
00438
00439
00440
00441
00442 INFO = 0
00443
00444 BADNN = .FALSE.
00445 NMAX = 1
00446 DO 10 J = 1, NSIZES
00447 NMAX = MAX( NMAX, NN( J ) )
00448 IF( NN( J ).LT.0 )
00449 $ BADNN = .TRUE.
00450 10 CONTINUE
00451
00452 LWKOPT = MAX( 2*NMAX*NMAX, 4*NMAX, 1 )
00453
00454
00455
00456 IF( NSIZES.LT.0 ) THEN
00457 INFO = -1
00458 ELSE IF( BADNN ) THEN
00459 INFO = -2
00460 ELSE IF( NTYPES.LT.0 ) THEN
00461 INFO = -3
00462 ELSE IF( THRESH.LT.ZERO ) THEN
00463 INFO = -6
00464 ELSE IF( LDA.LE.1 .OR. LDA.LT.NMAX ) THEN
00465 INFO = -10
00466 ELSE IF( LDU.LE.1 .OR. LDU.LT.NMAX ) THEN
00467 INFO = -19
00468 ELSE IF( LWKOPT.GT.LWORK ) THEN
00469 INFO = -30
00470 END IF
00471
00472 IF( INFO.NE.0 ) THEN
00473 CALL XERBLA( 'CCHKGG', -INFO )
00474 RETURN
00475 END IF
00476
00477
00478
00479 IF( NSIZES.EQ.0 .OR. NTYPES.EQ.0 )
00480 $ RETURN
00481
00482 SAFMIN = SLAMCH( 'Safe minimum' )
00483 ULP = SLAMCH( 'Epsilon' )*SLAMCH( 'Base' )
00484 SAFMIN = SAFMIN / ULP
00485 SAFMAX = ONE / SAFMIN
00486 CALL SLABAD( SAFMIN, SAFMAX )
00487 ULPINV = ONE / ULP
00488
00489
00490
00491 RMAGN( 0 ) = ZERO
00492 RMAGN( 1 ) = ONE
00493
00494
00495
00496 NTESTT = 0
00497 NERRS = 0
00498 NMATS = 0
00499
00500 DO 240 JSIZE = 1, NSIZES
00501 N = NN( JSIZE )
00502 N1 = MAX( 1, N )
00503 RMAGN( 2 ) = SAFMAX*ULP / REAL( N1 )
00504 RMAGN( 3 ) = SAFMIN*ULPINV*N1
00505
00506 IF( NSIZES.NE.1 ) THEN
00507 MTYPES = MIN( MAXTYP, NTYPES )
00508 ELSE
00509 MTYPES = MIN( MAXTYP+1, NTYPES )
00510 END IF
00511
00512 DO 230 JTYPE = 1, MTYPES
00513 IF( .NOT.DOTYPE( JTYPE ) )
00514 $ GO TO 230
00515 NMATS = NMATS + 1
00516 NTEST = 0
00517
00518
00519
00520 DO 20 J = 1, 4
00521 IOLDSD( J ) = ISEED( J )
00522 20 CONTINUE
00523
00524
00525
00526 DO 30 J = 1, 15
00527 RESULT( J ) = ZERO
00528 30 CONTINUE
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547
00548
00549
00550
00551 IF( MTYPES.GT.MAXTYP )
00552 $ GO TO 110
00553 IINFO = 0
00554 IF( KCLASS( JTYPE ).LT.3 ) THEN
00555
00556
00557
00558 IF( ABS( KATYPE( JTYPE ) ).EQ.3 ) THEN
00559 IN = 2*( ( N-1 ) / 2 ) + 1
00560 IF( IN.NE.N )
00561 $ CALL CLASET( 'Full', N, N, CZERO, CZERO, A, LDA )
00562 ELSE
00563 IN = N
00564 END IF
00565 CALL CLATM4( KATYPE( JTYPE ), IN, KZ1( KAZERO( JTYPE ) ),
00566 $ KZ2( KAZERO( JTYPE ) ), LASIGN( JTYPE ),
00567 $ RMAGN( KAMAGN( JTYPE ) ), ULP,
00568 $ RMAGN( KTRIAN( JTYPE )*KAMAGN( JTYPE ) ), 4,
00569 $ ISEED, A, LDA )
00570 IADD = KADD( KAZERO( JTYPE ) )
00571 IF( IADD.GT.0 .AND. IADD.LE.N )
00572 $ A( IADD, IADD ) = RMAGN( KAMAGN( JTYPE ) )
00573
00574
00575
00576 IF( ABS( KBTYPE( JTYPE ) ).EQ.3 ) THEN
00577 IN = 2*( ( N-1 ) / 2 ) + 1
00578 IF( IN.NE.N )
00579 $ CALL CLASET( 'Full', N, N, CZERO, CZERO, B, LDA )
00580 ELSE
00581 IN = N
00582 END IF
00583 CALL CLATM4( KBTYPE( JTYPE ), IN, KZ1( KBZERO( JTYPE ) ),
00584 $ KZ2( KBZERO( JTYPE ) ), LBSIGN( JTYPE ),
00585 $ RMAGN( KBMAGN( JTYPE ) ), ONE,
00586 $ RMAGN( KTRIAN( JTYPE )*KBMAGN( JTYPE ) ), 4,
00587 $ ISEED, B, LDA )
00588 IADD = KADD( KBZERO( JTYPE ) )
00589 IF( IADD.NE.0 )
00590 $ B( IADD, IADD ) = RMAGN( KBMAGN( JTYPE ) )
00591
00592 IF( KCLASS( JTYPE ).EQ.2 .AND. N.GT.0 ) THEN
00593
00594
00595
00596
00597
00598
00599
00600 DO 50 JC = 1, N - 1
00601 DO 40 JR = JC, N
00602 U( JR, JC ) = CLARND( 3, ISEED )
00603 V( JR, JC ) = CLARND( 3, ISEED )
00604 40 CONTINUE
00605 CALL CLARFG( N+1-JC, U( JC, JC ), U( JC+1, JC ), 1,
00606 $ WORK( JC ) )
00607 WORK( 2*N+JC ) = SIGN( ONE, REAL( U( JC, JC ) ) )
00608 U( JC, JC ) = CONE
00609 CALL CLARFG( N+1-JC, V( JC, JC ), V( JC+1, JC ), 1,
00610 $ WORK( N+JC ) )
00611 WORK( 3*N+JC ) = SIGN( ONE, REAL( V( JC, JC ) ) )
00612 V( JC, JC ) = CONE
00613 50 CONTINUE
00614 CTEMP = CLARND( 3, ISEED )
00615 U( N, N ) = CONE
00616 WORK( N ) = CZERO
00617 WORK( 3*N ) = CTEMP / ABS( CTEMP )
00618 CTEMP = CLARND( 3, ISEED )
00619 V( N, N ) = CONE
00620 WORK( 2*N ) = CZERO
00621 WORK( 4*N ) = CTEMP / ABS( CTEMP )
00622
00623
00624
00625 DO 70 JC = 1, N
00626 DO 60 JR = 1, N
00627 A( JR, JC ) = WORK( 2*N+JR )*
00628 $ CONJG( WORK( 3*N+JC ) )*
00629 $ A( JR, JC )
00630 B( JR, JC ) = WORK( 2*N+JR )*
00631 $ CONJG( WORK( 3*N+JC ) )*
00632 $ B( JR, JC )
00633 60 CONTINUE
00634 70 CONTINUE
00635 CALL CUNM2R( 'L', 'N', N, N, N-1, U, LDU, WORK, A,
00636 $ LDA, WORK( 2*N+1 ), IINFO )
00637 IF( IINFO.NE.0 )
00638 $ GO TO 100
00639 CALL CUNM2R( 'R', 'C', N, N, N-1, V, LDU, WORK( N+1 ),
00640 $ A, LDA, WORK( 2*N+1 ), IINFO )
00641 IF( IINFO.NE.0 )
00642 $ GO TO 100
00643 CALL CUNM2R( 'L', 'N', N, N, N-1, U, LDU, WORK, B,
00644 $ LDA, WORK( 2*N+1 ), IINFO )
00645 IF( IINFO.NE.0 )
00646 $ GO TO 100
00647 CALL CUNM2R( 'R', 'C', N, N, N-1, V, LDU, WORK( N+1 ),
00648 $ B, LDA, WORK( 2*N+1 ), IINFO )
00649 IF( IINFO.NE.0 )
00650 $ GO TO 100
00651 END IF
00652 ELSE
00653
00654
00655
00656 DO 90 JC = 1, N
00657 DO 80 JR = 1, N
00658 A( JR, JC ) = RMAGN( KAMAGN( JTYPE ) )*
00659 $ CLARND( 4, ISEED )
00660 B( JR, JC ) = RMAGN( KBMAGN( JTYPE ) )*
00661 $ CLARND( 4, ISEED )
00662 80 CONTINUE
00663 90 CONTINUE
00664 END IF
00665
00666 ANORM = CLANGE( '1', N, N, A, LDA, RWORK )
00667 BNORM = CLANGE( '1', N, N, B, LDA, RWORK )
00668
00669 100 CONTINUE
00670
00671 IF( IINFO.NE.0 ) THEN
00672 WRITE( NOUNIT, FMT = 9999 )'Generator', IINFO, N, JTYPE,
00673 $ IOLDSD
00674 INFO = ABS( IINFO )
00675 RETURN
00676 END IF
00677
00678 110 CONTINUE
00679
00680
00681
00682 CALL CLACPY( ' ', N, N, A, LDA, H, LDA )
00683 CALL CLACPY( ' ', N, N, B, LDA, T, LDA )
00684 NTEST = 1
00685 RESULT( 1 ) = ULPINV
00686
00687 CALL CGEQR2( N, N, T, LDA, WORK, WORK( N+1 ), IINFO )
00688 IF( IINFO.NE.0 ) THEN
00689 WRITE( NOUNIT, FMT = 9999 )'CGEQR2', IINFO, N, JTYPE,
00690 $ IOLDSD
00691 INFO = ABS( IINFO )
00692 GO TO 210
00693 END IF
00694
00695 CALL CUNM2R( 'L', 'C', N, N, N, T, LDA, WORK, H, LDA,
00696 $ WORK( N+1 ), IINFO )
00697 IF( IINFO.NE.0 ) THEN
00698 WRITE( NOUNIT, FMT = 9999 )'CUNM2R', IINFO, N, JTYPE,
00699 $ IOLDSD
00700 INFO = ABS( IINFO )
00701 GO TO 210
00702 END IF
00703
00704 CALL CLASET( 'Full', N, N, CZERO, CONE, U, LDU )
00705 CALL CUNM2R( 'R', 'N', N, N, N, T, LDA, WORK, U, LDU,
00706 $ WORK( N+1 ), IINFO )
00707 IF( IINFO.NE.0 ) THEN
00708 WRITE( NOUNIT, FMT = 9999 )'CUNM2R', IINFO, N, JTYPE,
00709 $ IOLDSD
00710 INFO = ABS( IINFO )
00711 GO TO 210
00712 END IF
00713
00714 CALL CGGHRD( 'V', 'I', N, 1, N, H, LDA, T, LDA, U, LDU, V,
00715 $ LDU, IINFO )
00716 IF( IINFO.NE.0 ) THEN
00717 WRITE( NOUNIT, FMT = 9999 )'CGGHRD', IINFO, N, JTYPE,
00718 $ IOLDSD
00719 INFO = ABS( IINFO )
00720 GO TO 210
00721 END IF
00722 NTEST = 4
00723
00724
00725
00726 CALL CGET51( 1, N, A, LDA, H, LDA, U, LDU, V, LDU, WORK,
00727 $ RWORK, RESULT( 1 ) )
00728 CALL CGET51( 1, N, B, LDA, T, LDA, U, LDU, V, LDU, WORK,
00729 $ RWORK, RESULT( 2 ) )
00730 CALL CGET51( 3, N, B, LDA, T, LDA, U, LDU, U, LDU, WORK,
00731 $ RWORK, RESULT( 3 ) )
00732 CALL CGET51( 3, N, B, LDA, T, LDA, V, LDU, V, LDU, WORK,
00733 $ RWORK, RESULT( 4 ) )
00734
00735
00736
00737
00738
00739
00740
00741 CALL CLACPY( ' ', N, N, H, LDA, S2, LDA )
00742 CALL CLACPY( ' ', N, N, T, LDA, P2, LDA )
00743 NTEST = 5
00744 RESULT( 5 ) = ULPINV
00745
00746 CALL CHGEQZ( 'E', 'N', 'N', N, 1, N, S2, LDA, P2, LDA,
00747 $ ALPHA3, BETA3, Q, LDU, Z, LDU, WORK, LWORK,
00748 $ RWORK, IINFO )
00749 IF( IINFO.NE.0 ) THEN
00750 WRITE( NOUNIT, FMT = 9999 )'CHGEQZ(E)', IINFO, N, JTYPE,
00751 $ IOLDSD
00752 INFO = ABS( IINFO )
00753 GO TO 210
00754 END IF
00755
00756
00757
00758 CALL CLACPY( ' ', N, N, H, LDA, S2, LDA )
00759 CALL CLACPY( ' ', N, N, T, LDA, P2, LDA )
00760
00761 CALL CHGEQZ( 'S', 'N', 'N', N, 1, N, S2, LDA, P2, LDA,
00762 $ ALPHA1, BETA1, Q, LDU, Z, LDU, WORK, LWORK,
00763 $ RWORK, IINFO )
00764 IF( IINFO.NE.0 ) THEN
00765 WRITE( NOUNIT, FMT = 9999 )'CHGEQZ(S)', IINFO, N, JTYPE,
00766 $ IOLDSD
00767 INFO = ABS( IINFO )
00768 GO TO 210
00769 END IF
00770
00771
00772
00773 CALL CLACPY( ' ', N, N, H, LDA, S1, LDA )
00774 CALL CLACPY( ' ', N, N, T, LDA, P1, LDA )
00775
00776 CALL CHGEQZ( 'S', 'I', 'I', N, 1, N, S1, LDA, P1, LDA,
00777 $ ALPHA1, BETA1, Q, LDU, Z, LDU, WORK, LWORK,
00778 $ RWORK, IINFO )
00779 IF( IINFO.NE.0 ) THEN
00780 WRITE( NOUNIT, FMT = 9999 )'CHGEQZ(V)', IINFO, N, JTYPE,
00781 $ IOLDSD
00782 INFO = ABS( IINFO )
00783 GO TO 210
00784 END IF
00785
00786 NTEST = 8
00787
00788
00789
00790 CALL CGET51( 1, N, H, LDA, S1, LDA, Q, LDU, Z, LDU, WORK,
00791 $ RWORK, RESULT( 5 ) )
00792 CALL CGET51( 1, N, T, LDA, P1, LDA, Q, LDU, Z, LDU, WORK,
00793 $ RWORK, RESULT( 6 ) )
00794 CALL CGET51( 3, N, T, LDA, P1, LDA, Q, LDU, Q, LDU, WORK,
00795 $ RWORK, RESULT( 7 ) )
00796 CALL CGET51( 3, N, T, LDA, P1, LDA, Z, LDU, Z, LDU, WORK,
00797 $ RWORK, RESULT( 8 ) )
00798
00799
00800
00801
00802
00803
00804 NTEST = 9
00805 RESULT( 9 ) = ULPINV
00806
00807
00808
00809
00810 I1 = N / 2
00811 DO 120 J = 1, I1
00812 LLWORK( J ) = .TRUE.
00813 120 CONTINUE
00814 DO 130 J = I1 + 1, N
00815 LLWORK( J ) = .FALSE.
00816 130 CONTINUE
00817
00818 CALL CTGEVC( 'L', 'S', LLWORK, N, S1, LDA, P1, LDA, EVECTL,
00819 $ LDU, CDUMMA, LDU, N, IN, WORK, RWORK, IINFO )
00820 IF( IINFO.NE.0 ) THEN
00821 WRITE( NOUNIT, FMT = 9999 )'CTGEVC(L,S1)', IINFO, N,
00822 $ JTYPE, IOLDSD
00823 INFO = ABS( IINFO )
00824 GO TO 210
00825 END IF
00826
00827 I1 = IN
00828 DO 140 J = 1, I1
00829 LLWORK( J ) = .FALSE.
00830 140 CONTINUE
00831 DO 150 J = I1 + 1, N
00832 LLWORK( J ) = .TRUE.
00833 150 CONTINUE
00834
00835 CALL CTGEVC( 'L', 'S', LLWORK, N, S1, LDA, P1, LDA,
00836 $ EVECTL( 1, I1+1 ), LDU, CDUMMA, LDU, N, IN,
00837 $ WORK, RWORK, IINFO )
00838 IF( IINFO.NE.0 ) THEN
00839 WRITE( NOUNIT, FMT = 9999 )'CTGEVC(L,S2)', IINFO, N,
00840 $ JTYPE, IOLDSD
00841 INFO = ABS( IINFO )
00842 GO TO 210
00843 END IF
00844
00845 CALL CGET52( .TRUE., N, S1, LDA, P1, LDA, EVECTL, LDU,
00846 $ ALPHA1, BETA1, WORK, RWORK, DUMMA( 1 ) )
00847 RESULT( 9 ) = DUMMA( 1 )
00848 IF( DUMMA( 2 ).GT.THRSHN ) THEN
00849 WRITE( NOUNIT, FMT = 9998 )'Left', 'CTGEVC(HOWMNY=S)',
00850 $ DUMMA( 2 ), N, JTYPE, IOLDSD
00851 END IF
00852
00853
00854
00855
00856 NTEST = 10
00857 RESULT( 10 ) = ULPINV
00858 CALL CLACPY( 'F', N, N, Q, LDU, EVECTL, LDU )
00859 CALL CTGEVC( 'L', 'B', LLWORK, N, S1, LDA, P1, LDA, EVECTL,
00860 $ LDU, CDUMMA, LDU, N, IN, WORK, RWORK, IINFO )
00861 IF( IINFO.NE.0 ) THEN
00862 WRITE( NOUNIT, FMT = 9999 )'CTGEVC(L,B)', IINFO, N,
00863 $ JTYPE, IOLDSD
00864 INFO = ABS( IINFO )
00865 GO TO 210
00866 END IF
00867
00868 CALL CGET52( .TRUE., N, H, LDA, T, LDA, EVECTL, LDU, ALPHA1,
00869 $ BETA1, WORK, RWORK, DUMMA( 1 ) )
00870 RESULT( 10 ) = DUMMA( 1 )
00871 IF( DUMMA( 2 ).GT.THRSHN ) THEN
00872 WRITE( NOUNIT, FMT = 9998 )'Left', 'CTGEVC(HOWMNY=B)',
00873 $ DUMMA( 2 ), N, JTYPE, IOLDSD
00874 END IF
00875
00876
00877
00878
00879 NTEST = 11
00880 RESULT( 11 ) = ULPINV
00881
00882
00883
00884
00885 I1 = N / 2
00886 DO 160 J = 1, I1
00887 LLWORK( J ) = .TRUE.
00888 160 CONTINUE
00889 DO 170 J = I1 + 1, N
00890 LLWORK( J ) = .FALSE.
00891 170 CONTINUE
00892
00893 CALL CTGEVC( 'R', 'S', LLWORK, N, S1, LDA, P1, LDA, CDUMMA,
00894 $ LDU, EVECTR, LDU, N, IN, WORK, RWORK, IINFO )
00895 IF( IINFO.NE.0 ) THEN
00896 WRITE( NOUNIT, FMT = 9999 )'CTGEVC(R,S1)', IINFO, N,
00897 $ JTYPE, IOLDSD
00898 INFO = ABS( IINFO )
00899 GO TO 210
00900 END IF
00901
00902 I1 = IN
00903 DO 180 J = 1, I1
00904 LLWORK( J ) = .FALSE.
00905 180 CONTINUE
00906 DO 190 J = I1 + 1, N
00907 LLWORK( J ) = .TRUE.
00908 190 CONTINUE
00909
00910 CALL CTGEVC( 'R', 'S', LLWORK, N, S1, LDA, P1, LDA, CDUMMA,
00911 $ LDU, EVECTR( 1, I1+1 ), LDU, N, IN, WORK,
00912 $ RWORK, IINFO )
00913 IF( IINFO.NE.0 ) THEN
00914 WRITE( NOUNIT, FMT = 9999 )'CTGEVC(R,S2)', IINFO, N,
00915 $ JTYPE, IOLDSD
00916 INFO = ABS( IINFO )
00917 GO TO 210
00918 END IF
00919
00920 CALL CGET52( .FALSE., N, S1, LDA, P1, LDA, EVECTR, LDU,
00921 $ ALPHA1, BETA1, WORK, RWORK, DUMMA( 1 ) )
00922 RESULT( 11 ) = DUMMA( 1 )
00923 IF( DUMMA( 2 ).GT.THRESH ) THEN
00924 WRITE( NOUNIT, FMT = 9998 )'Right', 'CTGEVC(HOWMNY=S)',
00925 $ DUMMA( 2 ), N, JTYPE, IOLDSD
00926 END IF
00927
00928
00929
00930
00931 NTEST = 12
00932 RESULT( 12 ) = ULPINV
00933 CALL CLACPY( 'F', N, N, Z, LDU, EVECTR, LDU )
00934 CALL CTGEVC( 'R', 'B', LLWORK, N, S1, LDA, P1, LDA, CDUMMA,
00935 $ LDU, EVECTR, LDU, N, IN, WORK, RWORK, IINFO )
00936 IF( IINFO.NE.0 ) THEN
00937 WRITE( NOUNIT, FMT = 9999 )'CTGEVC(R,B)', IINFO, N,
00938 $ JTYPE, IOLDSD
00939 INFO = ABS( IINFO )
00940 GO TO 210
00941 END IF
00942
00943 CALL CGET52( .FALSE., N, H, LDA, T, LDA, EVECTR, LDU,
00944 $ ALPHA1, BETA1, WORK, RWORK, DUMMA( 1 ) )
00945 RESULT( 12 ) = DUMMA( 1 )
00946 IF( DUMMA( 2 ).GT.THRESH ) THEN
00947 WRITE( NOUNIT, FMT = 9998 )'Right', 'CTGEVC(HOWMNY=B)',
00948 $ DUMMA( 2 ), N, JTYPE, IOLDSD
00949 END IF
00950
00951
00952
00953 IF( TSTDIF ) THEN
00954
00955
00956
00957 CALL CGET51( 2, N, S1, LDA, S2, LDA, Q, LDU, Z, LDU,
00958 $ WORK, RWORK, RESULT( 13 ) )
00959 CALL CGET51( 2, N, P1, LDA, P2, LDA, Q, LDU, Z, LDU,
00960 $ WORK, RWORK, RESULT( 14 ) )
00961
00962
00963
00964 TEMP1 = ZERO
00965 TEMP2 = ZERO
00966 DO 200 J = 1, N
00967 TEMP1 = MAX( TEMP1, ABS( ALPHA1( J )-ALPHA3( J ) ) )
00968 TEMP2 = MAX( TEMP2, ABS( BETA1( J )-BETA3( J ) ) )
00969 200 CONTINUE
00970
00971 TEMP1 = TEMP1 / MAX( SAFMIN, ULP*MAX( TEMP1, ANORM ) )
00972 TEMP2 = TEMP2 / MAX( SAFMIN, ULP*MAX( TEMP2, BNORM ) )
00973 RESULT( 15 ) = MAX( TEMP1, TEMP2 )
00974 NTEST = 15
00975 ELSE
00976 RESULT( 13 ) = ZERO
00977 RESULT( 14 ) = ZERO
00978 RESULT( 15 ) = ZERO
00979 NTEST = 12
00980 END IF
00981
00982
00983
00984 210 CONTINUE
00985
00986 NTESTT = NTESTT + NTEST
00987
00988
00989
00990 DO 220 JR = 1, NTEST
00991 IF( RESULT( JR ).GE.THRESH ) THEN
00992
00993
00994
00995
00996 IF( NERRS.EQ.0 ) THEN
00997 WRITE( NOUNIT, FMT = 9997 )'CGG'
00998
00999
01000
01001 WRITE( NOUNIT, FMT = 9996 )
01002 WRITE( NOUNIT, FMT = 9995 )
01003 WRITE( NOUNIT, FMT = 9994 )'Unitary'
01004
01005
01006
01007 WRITE( NOUNIT, FMT = 9993 )'unitary', '*',
01008 $ 'conjugate transpose', ( '*', J = 1, 10 )
01009
01010 END IF
01011 NERRS = NERRS + 1
01012 IF( RESULT( JR ).LT.10000.0 ) THEN
01013 WRITE( NOUNIT, FMT = 9992 )N, JTYPE, IOLDSD, JR,
01014 $ RESULT( JR )
01015 ELSE
01016 WRITE( NOUNIT, FMT = 9991 )N, JTYPE, IOLDSD, JR,
01017 $ RESULT( JR )
01018 END IF
01019 END IF
01020 220 CONTINUE
01021
01022 230 CONTINUE
01023 240 CONTINUE
01024
01025
01026
01027 CALL SLASUM( 'CGG', NOUNIT, NERRS, NTESTT )
01028 RETURN
01029
01030 9999 FORMAT( ' CCHKGG: ', A, ' returned INFO=', I6, '.', / 9X, 'N=',
01031 $ I6, ', JTYPE=', I6, ', ISEED=(', 3( I5, ',' ), I5, ')' )
01032
01033 9998 FORMAT( ' CCHKGG: ', A, ' Eigenvectors from ', A, ' incorrectly ',
01034 $ 'normalized.', / ' Bits of error=', 0P, G10.3, ',', 9X,
01035 $ 'N=', I6, ', JTYPE=', I6, ', ISEED=(', 3( I5, ',' ), I5,
01036 $ ')' )
01037
01038 9997 FORMAT( 1X, A3, ' -- Complex Generalized eigenvalue problem' )
01039
01040 9996 FORMAT( ' Matrix types (see CCHKGG for details): ' )
01041
01042 9995 FORMAT( ' Special Matrices:', 23X,
01043 $ '(J''=transposed Jordan block)',
01044 $ / ' 1=(0,0) 2=(I,0) 3=(0,I) 4=(I,I) 5=(J'',J'') ',
01045 $ '6=(diag(J'',I), diag(I,J''))', / ' Diagonal Matrices: ( ',
01046 $ 'D=diag(0,1,2,...) )', / ' 7=(D,I) 9=(large*D, small*I',
01047 $ ') 11=(large*I, small*D) 13=(large*D, large*I)', /
01048 $ ' 8=(I,D) 10=(small*D, large*I) 12=(small*I, large*D) ',
01049 $ ' 14=(small*D, small*I)', / ' 15=(D, reversed D)' )
01050 9994 FORMAT( ' Matrices Rotated by Random ', A, ' Matrices U, V:',
01051 $ / ' 16=Transposed Jordan Blocks 19=geometric ',
01052 $ 'alpha, beta=0,1', / ' 17=arithm. alpha&beta ',
01053 $ ' 20=arithmetic alpha, beta=0,1', / ' 18=clustered ',
01054 $ 'alpha, beta=0,1 21=random alpha, beta=0,1',
01055 $ / ' Large & Small Matrices:', / ' 22=(large, small) ',
01056 $ '23=(small,large) 24=(small,small) 25=(large,large)',
01057 $ / ' 26=random O(1) matrices.' )
01058
01059 9993 FORMAT( / ' Tests performed: (H is Hessenberg, S is Schur, B, ',
01060 $ 'T, P are triangular,', / 20X, 'U, V, Q, and Z are ', A,
01061 $ ', l and r are the', / 20X,
01062 $ 'appropriate left and right eigenvectors, resp., a is',
01063 $ / 20X, 'alpha, b is beta, and ', A, ' means ', A, '.)',
01064 $ / ' 1 = | A - U H V', A,
01065 $ ' | / ( |A| n ulp ) 2 = | B - U T V', A,
01066 $ ' | / ( |B| n ulp )', / ' 3 = | I - UU', A,
01067 $ ' | / ( n ulp ) 4 = | I - VV', A,
01068 $ ' | / ( n ulp )', / ' 5 = | H - Q S Z', A,
01069 $ ' | / ( |H| n ulp )', 6X, '6 = | T - Q P Z', A,
01070 $ ' | / ( |T| n ulp )', / ' 7 = | I - QQ', A,
01071 $ ' | / ( n ulp ) 8 = | I - ZZ', A,
01072 $ ' | / ( n ulp )', / ' 9 = max | ( b S - a P )', A,
01073 $ ' l | / const. 10 = max | ( b H - a T )', A,
01074 $ ' l | / const.', /
01075 $ ' 11= max | ( b S - a P ) r | / const. 12 = max | ( b H',
01076 $ ' - a T ) r | / const.', / 1X )
01077
01078 9992 FORMAT( ' Matrix order=', I5, ', type=', I2, ', seed=',
01079 $ 4( I4, ',' ), ' result ', I2, ' is', 0P, F8.2 )
01080 9991 FORMAT( ' Matrix order=', I5, ', type=', I2, ', seed=',
01081 $ 4( I4, ',' ), ' result ', I2, ' is', 1P, E10.3 )
01082
01083
01084
01085 END