00001 SUBROUTINE DDRGSX( NSIZE, NCMAX, THRESH, NIN, NOUT, A, LDA, B, AI,
00002 $ BI, Z, Q, ALPHAR, ALPHAI, BETA, C, LDC, S,
00003 $ WORK, LWORK, IWORK, LIWORK, BWORK, INFO )
00004
00005
00006
00007
00008
00009
00010 INTEGER INFO, LDA, LDC, LIWORK, LWORK, NCMAX, NIN,
00011 $ NOUT, NSIZE
00012 DOUBLE PRECISION THRESH
00013
00014
00015 LOGICAL BWORK( * )
00016 INTEGER IWORK( * )
00017 DOUBLE PRECISION A( LDA, * ), AI( LDA, * ), ALPHAI( * ),
00018 $ ALPHAR( * ), B( LDA, * ), BETA( * ),
00019 $ BI( LDA, * ), C( LDC, * ), Q( LDA, * ), S( * ),
00020 $ WORK( * ), Z( LDA, * )
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
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 DOUBLE PRECISION ZERO, ONE, TEN
00264 PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0, TEN = 1.0D+1 )
00265
00266
00267 LOGICAL ILABAD
00268 CHARACTER SENSE
00269 INTEGER BDSPAC, I, I1, IFUNC, IINFO, J, LINFO, MAXWRK,
00270 $ MINWRK, MM, MN2, NERRS, NPTKNT, NTEST, NTESTT,
00271 $ PRTYPE, QBA, QBB
00272 DOUBLE PRECISION ABNRM, BIGNUM, DIFTRU, PLTRU, SMLNUM, TEMP1,
00273 $ TEMP2, THRSH2, ULP, ULPINV, WEIGHT
00274
00275
00276 DOUBLE PRECISION DIFEST( 2 ), PL( 2 ), RESULT( 10 )
00277
00278
00279 LOGICAL DLCTSX
00280 INTEGER ILAENV
00281 DOUBLE PRECISION DLAMCH, DLANGE
00282 EXTERNAL DLCTSX, ILAENV, DLAMCH, DLANGE
00283
00284
00285 EXTERNAL ALASVM, DGESVD, DGET51, DGET53, DGGESX, DLABAD,
00286 $ DLACPY, DLAKF2, DLASET, DLATM5, XERBLA
00287
00288
00289 INTRINSIC ABS, MAX, SQRT
00290
00291
00292 LOGICAL FS
00293 INTEGER K, M, MPLUSN, N
00294
00295
00296 COMMON / MN / M, N, MPLUSN, K, FS
00297
00298
00299
00300
00301
00302 IF( NSIZE.LT.0 ) THEN
00303 INFO = -1
00304 ELSE IF( THRESH.LT.ZERO ) THEN
00305 INFO = -2
00306 ELSE IF( NIN.LE.0 ) THEN
00307 INFO = -3
00308 ELSE IF( NOUT.LE.0 ) THEN
00309 INFO = -4
00310 ELSE IF( LDA.LT.1 .OR. LDA.LT.NSIZE ) THEN
00311 INFO = -6
00312 ELSE IF( LDC.LT.1 .OR. LDC.LT.NSIZE*NSIZE / 2 ) THEN
00313 INFO = -17
00314 ELSE IF( LIWORK.LT.NSIZE+6 ) THEN
00315 INFO = -21
00316 END IF
00317
00318
00319
00320
00321
00322
00323
00324
00325 MINWRK = 1
00326 IF( INFO.EQ.0 .AND. LWORK.GE.1 ) THEN
00327 MINWRK = MAX( 10*( NSIZE+1 ), 5*NSIZE*NSIZE / 2 )
00328
00329
00330
00331 MAXWRK = 9*( NSIZE+1 ) + NSIZE*
00332 $ ILAENV( 1, 'DGEQRF', ' ', NSIZE, 1, NSIZE, 0 )
00333 MAXWRK = MAX( MAXWRK, 9*( NSIZE+1 )+NSIZE*
00334 $ ILAENV( 1, 'DORGQR', ' ', NSIZE, 1, NSIZE, -1 ) )
00335
00336
00337
00338 BDSPAC = 5*NSIZE*NSIZE / 2
00339 MAXWRK = MAX( MAXWRK, 3*NSIZE*NSIZE / 2+NSIZE*NSIZE*
00340 $ ILAENV( 1, 'DGEBRD', ' ', NSIZE*NSIZE / 2,
00341 $ NSIZE*NSIZE / 2, -1, -1 ) )
00342 MAXWRK = MAX( MAXWRK, BDSPAC )
00343
00344 MAXWRK = MAX( MAXWRK, MINWRK )
00345
00346 WORK( 1 ) = MAXWRK
00347 END IF
00348
00349 IF( LWORK.LT.MINWRK )
00350 $ INFO = -19
00351
00352 IF( INFO.NE.0 ) THEN
00353 CALL XERBLA( 'DDRGSX', -INFO )
00354 RETURN
00355 END IF
00356
00357
00358
00359 ULP = DLAMCH( 'P' )
00360 ULPINV = ONE / ULP
00361 SMLNUM = DLAMCH( 'S' ) / ULP
00362 BIGNUM = ONE / SMLNUM
00363 CALL DLABAD( SMLNUM, BIGNUM )
00364 THRSH2 = TEN*THRESH
00365 NTESTT = 0
00366 NERRS = 0
00367
00368
00369
00370 IFUNC = 0
00371 IF( NSIZE.EQ.0 )
00372 $ GO TO 70
00373
00374
00375
00376
00377
00378 PRTYPE = 0
00379 QBA = 3
00380 QBB = 4
00381 WEIGHT = SQRT( ULP )
00382
00383 DO 60 IFUNC = 0, 3
00384 DO 50 PRTYPE = 1, 5
00385 DO 40 M = 1, NSIZE - 1
00386 DO 30 N = 1, NSIZE - M
00387
00388 WEIGHT = ONE / WEIGHT
00389 MPLUSN = M + N
00390
00391
00392
00393 FS = .TRUE.
00394 K = 0
00395
00396 CALL DLASET( 'Full', MPLUSN, MPLUSN, ZERO, ZERO, AI,
00397 $ LDA )
00398 CALL DLASET( 'Full', MPLUSN, MPLUSN, ZERO, ZERO, BI,
00399 $ LDA )
00400
00401 CALL DLATM5( PRTYPE, M, N, AI, LDA, AI( M+1, M+1 ),
00402 $ LDA, AI( 1, M+1 ), LDA, BI, LDA,
00403 $ BI( M+1, M+1 ), LDA, BI( 1, M+1 ), LDA,
00404 $ Q, LDA, Z, LDA, WEIGHT, QBA, QBB )
00405
00406
00407
00408
00409
00410
00411 IF( IFUNC.EQ.0 ) THEN
00412 SENSE = 'N'
00413 ELSE IF( IFUNC.EQ.1 ) THEN
00414 SENSE = 'E'
00415 ELSE IF( IFUNC.EQ.2 ) THEN
00416 SENSE = 'V'
00417 ELSE IF( IFUNC.EQ.3 ) THEN
00418 SENSE = 'B'
00419 END IF
00420
00421 CALL DLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, A, LDA )
00422 CALL DLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA, B, LDA )
00423
00424 CALL DGGESX( 'V', 'V', 'S', DLCTSX, SENSE, MPLUSN, AI,
00425 $ LDA, BI, LDA, MM, ALPHAR, ALPHAI, BETA,
00426 $ Q, LDA, Z, LDA, PL, DIFEST, WORK, LWORK,
00427 $ IWORK, LIWORK, BWORK, LINFO )
00428
00429 IF( LINFO.NE.0 .AND. LINFO.NE.MPLUSN+2 ) THEN
00430 RESULT( 1 ) = ULPINV
00431 WRITE( NOUT, FMT = 9999 )'DGGESX', LINFO, MPLUSN,
00432 $ PRTYPE
00433 INFO = LINFO
00434 GO TO 30
00435 END IF
00436
00437
00438
00439 CALL DLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, WORK,
00440 $ MPLUSN )
00441 CALL DLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA,
00442 $ WORK( MPLUSN*MPLUSN+1 ), MPLUSN )
00443 ABNRM = DLANGE( 'Fro', MPLUSN, 2*MPLUSN, WORK, MPLUSN,
00444 $ WORK )
00445
00446
00447
00448 CALL DGET51( 1, MPLUSN, A, LDA, AI, LDA, Q, LDA, Z,
00449 $ LDA, WORK, RESULT( 1 ) )
00450 CALL DGET51( 1, MPLUSN, B, LDA, BI, LDA, Q, LDA, Z,
00451 $ LDA, WORK, RESULT( 2 ) )
00452 CALL DGET51( 3, MPLUSN, B, LDA, BI, LDA, Q, LDA, Q,
00453 $ LDA, WORK, RESULT( 3 ) )
00454 CALL DGET51( 3, MPLUSN, B, LDA, BI, LDA, Z, LDA, Z,
00455 $ LDA, WORK, RESULT( 4 ) )
00456 NTEST = 4
00457
00458
00459
00460
00461 TEMP1 = ZERO
00462 RESULT( 5 ) = ZERO
00463 RESULT( 6 ) = ZERO
00464
00465 DO 10 J = 1, MPLUSN
00466 ILABAD = .FALSE.
00467 IF( ALPHAI( J ).EQ.ZERO ) THEN
00468 TEMP2 = ( ABS( ALPHAR( J )-AI( J, J ) ) /
00469 $ MAX( SMLNUM, ABS( ALPHAR( J ) ),
00470 $ ABS( AI( J, J ) ) )+
00471 $ ABS( BETA( J )-BI( J, J ) ) /
00472 $ MAX( SMLNUM, ABS( BETA( J ) ),
00473 $ ABS( BI( J, J ) ) ) ) / ULP
00474 IF( J.LT.MPLUSN ) THEN
00475 IF( AI( J+1, J ).NE.ZERO ) THEN
00476 ILABAD = .TRUE.
00477 RESULT( 5 ) = ULPINV
00478 END IF
00479 END IF
00480 IF( J.GT.1 ) THEN
00481 IF( AI( J, J-1 ).NE.ZERO ) THEN
00482 ILABAD = .TRUE.
00483 RESULT( 5 ) = ULPINV
00484 END IF
00485 END IF
00486 ELSE
00487 IF( ALPHAI( J ).GT.ZERO ) THEN
00488 I1 = J
00489 ELSE
00490 I1 = J - 1
00491 END IF
00492 IF( I1.LE.0 .OR. I1.GE.MPLUSN ) THEN
00493 ILABAD = .TRUE.
00494 ELSE IF( I1.LT.MPLUSN-1 ) THEN
00495 IF( AI( I1+2, I1+1 ).NE.ZERO ) THEN
00496 ILABAD = .TRUE.
00497 RESULT( 5 ) = ULPINV
00498 END IF
00499 ELSE IF( I1.GT.1 ) THEN
00500 IF( AI( I1, I1-1 ).NE.ZERO ) THEN
00501 ILABAD = .TRUE.
00502 RESULT( 5 ) = ULPINV
00503 END IF
00504 END IF
00505 IF( .NOT.ILABAD ) THEN
00506 CALL DGET53( AI( I1, I1 ), LDA, BI( I1, I1 ),
00507 $ LDA, BETA( J ), ALPHAR( J ),
00508 $ ALPHAI( J ), TEMP2, IINFO )
00509 IF( IINFO.GE.3 ) THEN
00510 WRITE( NOUT, FMT = 9997 )IINFO, J,
00511 $ MPLUSN, PRTYPE
00512 INFO = ABS( IINFO )
00513 END IF
00514 ELSE
00515 TEMP2 = ULPINV
00516 END IF
00517 END IF
00518 TEMP1 = MAX( TEMP1, TEMP2 )
00519 IF( ILABAD ) THEN
00520 WRITE( NOUT, FMT = 9996 )J, MPLUSN, PRTYPE
00521 END IF
00522 10 CONTINUE
00523 RESULT( 6 ) = TEMP1
00524 NTEST = NTEST + 2
00525
00526
00527
00528 RESULT( 7 ) = ZERO
00529 IF( LINFO.EQ.MPLUSN+3 ) THEN
00530 RESULT( 7 ) = ULPINV
00531 ELSE IF( MM.NE.N ) THEN
00532 RESULT( 7 ) = ULPINV
00533 END IF
00534 NTEST = NTEST + 1
00535
00536
00537
00538
00539 RESULT( 8 ) = ZERO
00540 MN2 = MM*( MPLUSN-MM )*2
00541 IF( IFUNC.GE.2 .AND. MN2.LE.NCMAX*NCMAX ) THEN
00542
00543
00544
00545
00546 CALL DLAKF2( MM, MPLUSN-MM, AI, LDA,
00547 $ AI( MM+1, MM+1 ), BI,
00548 $ BI( MM+1, MM+1 ), C, LDC )
00549
00550 CALL DGESVD( 'N', 'N', MN2, MN2, C, LDC, S, WORK,
00551 $ 1, WORK( 2 ), 1, WORK( 3 ), LWORK-2,
00552 $ INFO )
00553 DIFTRU = S( MN2 )
00554
00555 IF( DIFEST( 2 ).EQ.ZERO ) THEN
00556 IF( DIFTRU.GT.ABNRM*ULP )
00557 $ RESULT( 8 ) = ULPINV
00558 ELSE IF( DIFTRU.EQ.ZERO ) THEN
00559 IF( DIFEST( 2 ).GT.ABNRM*ULP )
00560 $ RESULT( 8 ) = ULPINV
00561 ELSE IF( ( DIFTRU.GT.THRSH2*DIFEST( 2 ) ) .OR.
00562 $ ( DIFTRU*THRSH2.LT.DIFEST( 2 ) ) ) THEN
00563 RESULT( 8 ) = MAX( DIFTRU / DIFEST( 2 ),
00564 $ DIFEST( 2 ) / DIFTRU )
00565 END IF
00566 NTEST = NTEST + 1
00567 END IF
00568
00569
00570
00571 RESULT( 9 ) = ZERO
00572 IF( LINFO.EQ.( MPLUSN+2 ) ) THEN
00573 IF( DIFTRU.GT.ABNRM*ULP )
00574 $ RESULT( 9 ) = ULPINV
00575 IF( ( IFUNC.GT.1 ) .AND. ( DIFEST( 2 ).NE.ZERO ) )
00576 $ RESULT( 9 ) = ULPINV
00577 IF( ( IFUNC.EQ.1 ) .AND. ( PL( 1 ).NE.ZERO ) )
00578 $ RESULT( 9 ) = ULPINV
00579 NTEST = NTEST + 1
00580 END IF
00581
00582 NTESTT = NTESTT + NTEST
00583
00584
00585
00586 DO 20 J = 1, 9
00587 IF( RESULT( J ).GE.THRESH ) THEN
00588
00589
00590
00591
00592 IF( NERRS.EQ.0 ) THEN
00593 WRITE( NOUT, FMT = 9995 )'SGX'
00594
00595
00596
00597 WRITE( NOUT, FMT = 9993 )
00598
00599
00600
00601 WRITE( NOUT, FMT = 9992 )'orthogonal', '''',
00602 $ 'transpose', ( '''', I = 1, 4 )
00603
00604 END IF
00605 NERRS = NERRS + 1
00606 IF( RESULT( J ).LT.10000.0D0 ) THEN
00607 WRITE( NOUT, FMT = 9991 )MPLUSN, PRTYPE,
00608 $ WEIGHT, M, J, RESULT( J )
00609 ELSE
00610 WRITE( NOUT, FMT = 9990 )MPLUSN, PRTYPE,
00611 $ WEIGHT, M, J, RESULT( J )
00612 END IF
00613 END IF
00614 20 CONTINUE
00615
00616 30 CONTINUE
00617 40 CONTINUE
00618 50 CONTINUE
00619 60 CONTINUE
00620
00621 GO TO 150
00622
00623 70 CONTINUE
00624
00625
00626
00627
00628 NPTKNT = 0
00629
00630 80 CONTINUE
00631 READ( NIN, FMT = *, END = 140 )MPLUSN
00632 IF( MPLUSN.EQ.0 )
00633 $ GO TO 140
00634 READ( NIN, FMT = *, END = 140 )N
00635 DO 90 I = 1, MPLUSN
00636 READ( NIN, FMT = * )( AI( I, J ), J = 1, MPLUSN )
00637 90 CONTINUE
00638 DO 100 I = 1, MPLUSN
00639 READ( NIN, FMT = * )( BI( I, J ), J = 1, MPLUSN )
00640 100 CONTINUE
00641 READ( NIN, FMT = * )PLTRU, DIFTRU
00642
00643 NPTKNT = NPTKNT + 1
00644 FS = .TRUE.
00645 K = 0
00646 M = MPLUSN - N
00647
00648 CALL DLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, A, LDA )
00649 CALL DLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA, B, LDA )
00650
00651
00652
00653
00654 CALL DGGESX( 'V', 'V', 'S', DLCTSX, 'B', MPLUSN, AI, LDA, BI, LDA,
00655 $ MM, ALPHAR, ALPHAI, BETA, Q, LDA, Z, LDA, PL, DIFEST,
00656 $ WORK, LWORK, IWORK, LIWORK, BWORK, LINFO )
00657
00658 IF( LINFO.NE.0 .AND. LINFO.NE.MPLUSN+2 ) THEN
00659 RESULT( 1 ) = ULPINV
00660 WRITE( NOUT, FMT = 9998 )'DGGESX', LINFO, MPLUSN, NPTKNT
00661 GO TO 130
00662 END IF
00663
00664
00665
00666
00667 CALL DLACPY( 'Full', MPLUSN, MPLUSN, AI, LDA, WORK, MPLUSN )
00668 CALL DLACPY( 'Full', MPLUSN, MPLUSN, BI, LDA,
00669 $ WORK( MPLUSN*MPLUSN+1 ), MPLUSN )
00670 ABNRM = DLANGE( 'Fro', MPLUSN, 2*MPLUSN, WORK, MPLUSN, WORK )
00671
00672
00673
00674 CALL DGET51( 1, MPLUSN, A, LDA, AI, LDA, Q, LDA, Z, LDA, WORK,
00675 $ RESULT( 1 ) )
00676 CALL DGET51( 1, MPLUSN, B, LDA, BI, LDA, Q, LDA, Z, LDA, WORK,
00677 $ RESULT( 2 ) )
00678 CALL DGET51( 3, MPLUSN, B, LDA, BI, LDA, Q, LDA, Q, LDA, WORK,
00679 $ RESULT( 3 ) )
00680 CALL DGET51( 3, MPLUSN, B, LDA, BI, LDA, Z, LDA, Z, LDA, WORK,
00681 $ RESULT( 4 ) )
00682
00683
00684
00685
00686 NTEST = 6
00687 TEMP1 = ZERO
00688 RESULT( 5 ) = ZERO
00689 RESULT( 6 ) = ZERO
00690
00691 DO 110 J = 1, MPLUSN
00692 ILABAD = .FALSE.
00693 IF( ALPHAI( J ).EQ.ZERO ) THEN
00694 TEMP2 = ( ABS( ALPHAR( J )-AI( J, J ) ) /
00695 $ MAX( SMLNUM, ABS( ALPHAR( J ) ), ABS( AI( J,
00696 $ J ) ) )+ABS( BETA( J )-BI( J, J ) ) /
00697 $ MAX( SMLNUM, ABS( BETA( J ) ), ABS( BI( J, J ) ) ) )
00698 $ / ULP
00699 IF( J.LT.MPLUSN ) THEN
00700 IF( AI( J+1, J ).NE.ZERO ) THEN
00701 ILABAD = .TRUE.
00702 RESULT( 5 ) = ULPINV
00703 END IF
00704 END IF
00705 IF( J.GT.1 ) THEN
00706 IF( AI( J, J-1 ).NE.ZERO ) THEN
00707 ILABAD = .TRUE.
00708 RESULT( 5 ) = ULPINV
00709 END IF
00710 END IF
00711 ELSE
00712 IF( ALPHAI( J ).GT.ZERO ) THEN
00713 I1 = J
00714 ELSE
00715 I1 = J - 1
00716 END IF
00717 IF( I1.LE.0 .OR. I1.GE.MPLUSN ) THEN
00718 ILABAD = .TRUE.
00719 ELSE IF( I1.LT.MPLUSN-1 ) THEN
00720 IF( AI( I1+2, I1+1 ).NE.ZERO ) THEN
00721 ILABAD = .TRUE.
00722 RESULT( 5 ) = ULPINV
00723 END IF
00724 ELSE IF( I1.GT.1 ) THEN
00725 IF( AI( I1, I1-1 ).NE.ZERO ) THEN
00726 ILABAD = .TRUE.
00727 RESULT( 5 ) = ULPINV
00728 END IF
00729 END IF
00730 IF( .NOT.ILABAD ) THEN
00731 CALL DGET53( AI( I1, I1 ), LDA, BI( I1, I1 ), LDA,
00732 $ BETA( J ), ALPHAR( J ), ALPHAI( J ), TEMP2,
00733 $ IINFO )
00734 IF( IINFO.GE.3 ) THEN
00735 WRITE( NOUT, FMT = 9997 )IINFO, J, MPLUSN, NPTKNT
00736 INFO = ABS( IINFO )
00737 END IF
00738 ELSE
00739 TEMP2 = ULPINV
00740 END IF
00741 END IF
00742 TEMP1 = MAX( TEMP1, TEMP2 )
00743 IF( ILABAD ) THEN
00744 WRITE( NOUT, FMT = 9996 )J, MPLUSN, NPTKNT
00745 END IF
00746 110 CONTINUE
00747 RESULT( 6 ) = TEMP1
00748
00749
00750
00751 NTEST = 7
00752 RESULT( 7 ) = ZERO
00753 IF( LINFO.EQ.MPLUSN+3 )
00754 $ RESULT( 7 ) = ULPINV
00755
00756
00757
00758 NTEST = 8
00759 RESULT( 8 ) = ZERO
00760 IF( DIFEST( 2 ).EQ.ZERO ) THEN
00761 IF( DIFTRU.GT.ABNRM*ULP )
00762 $ RESULT( 8 ) = ULPINV
00763 ELSE IF( DIFTRU.EQ.ZERO ) THEN
00764 IF( DIFEST( 2 ).GT.ABNRM*ULP )
00765 $ RESULT( 8 ) = ULPINV
00766 ELSE IF( ( DIFTRU.GT.THRSH2*DIFEST( 2 ) ) .OR.
00767 $ ( DIFTRU*THRSH2.LT.DIFEST( 2 ) ) ) THEN
00768 RESULT( 8 ) = MAX( DIFTRU / DIFEST( 2 ), DIFEST( 2 ) / DIFTRU )
00769 END IF
00770
00771
00772
00773 NTEST = 9
00774 RESULT( 9 ) = ZERO
00775 IF( LINFO.EQ.( MPLUSN+2 ) ) THEN
00776 IF( DIFTRU.GT.ABNRM*ULP )
00777 $ RESULT( 9 ) = ULPINV
00778 IF( ( IFUNC.GT.1 ) .AND. ( DIFEST( 2 ).NE.ZERO ) )
00779 $ RESULT( 9 ) = ULPINV
00780 IF( ( IFUNC.EQ.1 ) .AND. ( PL( 1 ).NE.ZERO ) )
00781 $ RESULT( 9 ) = ULPINV
00782 END IF
00783
00784
00785
00786 NTEST = 10
00787 RESULT( 10 ) = ZERO
00788 IF( PL( 1 ).EQ.ZERO ) THEN
00789 IF( PLTRU.GT.ABNRM*ULP )
00790 $ RESULT( 10 ) = ULPINV
00791 ELSE IF( PLTRU.EQ.ZERO ) THEN
00792 IF( PL( 1 ).GT.ABNRM*ULP )
00793 $ RESULT( 10 ) = ULPINV
00794 ELSE IF( ( PLTRU.GT.THRESH*PL( 1 ) ) .OR.
00795 $ ( PLTRU*THRESH.LT.PL( 1 ) ) ) THEN
00796 RESULT( 10 ) = ULPINV
00797 END IF
00798
00799 NTESTT = NTESTT + NTEST
00800
00801
00802
00803 DO 120 J = 1, NTEST
00804 IF( RESULT( J ).GE.THRESH ) THEN
00805
00806
00807
00808
00809 IF( NERRS.EQ.0 ) THEN
00810 WRITE( NOUT, FMT = 9995 )'SGX'
00811
00812
00813
00814 WRITE( NOUT, FMT = 9994 )
00815
00816
00817
00818 WRITE( NOUT, FMT = 9992 )'orthogonal', '''',
00819 $ 'transpose', ( '''', I = 1, 4 )
00820
00821 END IF
00822 NERRS = NERRS + 1
00823 IF( RESULT( J ).LT.10000.0D0 ) THEN
00824 WRITE( NOUT, FMT = 9989 )NPTKNT, MPLUSN, J, RESULT( J )
00825 ELSE
00826 WRITE( NOUT, FMT = 9988 )NPTKNT, MPLUSN, J, RESULT( J )
00827 END IF
00828 END IF
00829
00830 120 CONTINUE
00831
00832 130 CONTINUE
00833 GO TO 80
00834 140 CONTINUE
00835
00836 150 CONTINUE
00837
00838
00839
00840 CALL ALASVM( 'SGX', NOUT, NERRS, NTESTT, 0 )
00841
00842 WORK( 1 ) = MAXWRK
00843
00844 RETURN
00845
00846 9999 FORMAT( ' DDRGSX: ', A, ' returned INFO=', I6, '.', / 9X, 'N=',
00847 $ I6, ', JTYPE=', I6, ')' )
00848
00849 9998 FORMAT( ' DDRGSX: ', A, ' returned INFO=', I6, '.', / 9X, 'N=',
00850 $ I6, ', Input Example #', I2, ')' )
00851
00852 9997 FORMAT( ' DDRGSX: DGET53 returned INFO=', I1, ' for eigenvalue ',
00853 $ I6, '.', / 9X, 'N=', I6, ', JTYPE=', I6, ')' )
00854
00855 9996 FORMAT( ' DDRGSX: S not in Schur form at eigenvalue ', I6, '.',
00856 $ / 9X, 'N=', I6, ', JTYPE=', I6, ')' )
00857
00858 9995 FORMAT( / 1X, A3, ' -- Real Expert Generalized Schur form',
00859 $ ' problem driver' )
00860
00861 9994 FORMAT( 'Input Example' )
00862
00863 9993 FORMAT( ' Matrix types: ', /
00864 $ ' 1: A is a block diagonal matrix of Jordan blocks ',
00865 $ 'and B is the identity ', / ' matrix, ',
00866 $ / ' 2: A and B are upper triangular matrices, ',
00867 $ / ' 3: A and B are as type 2, but each second diagonal ',
00868 $ 'block in A_11 and ', /
00869 $ ' each third diaongal block in A_22 are 2x2 blocks,',
00870 $ / ' 4: A and B are block diagonal matrices, ',
00871 $ / ' 5: (A,B) has potentially close or common ',
00872 $ 'eigenvalues.', / )
00873
00874 9992 FORMAT( / ' Tests performed: (S is Schur, T is triangular, ',
00875 $ 'Q and Z are ', A, ',', / 19X,
00876 $ ' a is alpha, b is beta, and ', A, ' means ', A, '.)',
00877 $ / ' 1 = | A - Q S Z', A,
00878 $ ' | / ( |A| n ulp ) 2 = | B - Q T Z', A,
00879 $ ' | / ( |B| n ulp )', / ' 3 = | I - QQ', A,
00880 $ ' | / ( n ulp ) 4 = | I - ZZ', A,
00881 $ ' | / ( n ulp )', / ' 5 = 1/ULP if A is not in ',
00882 $ 'Schur form S', / ' 6 = difference between (alpha,beta)',
00883 $ ' and diagonals of (S,T)', /
00884 $ ' 7 = 1/ULP if SDIM is not the correct number of ',
00885 $ 'selected eigenvalues', /
00886 $ ' 8 = 1/ULP if DIFEST/DIFTRU > 10*THRESH or ',
00887 $ 'DIFTRU/DIFEST > 10*THRESH',
00888 $ / ' 9 = 1/ULP if DIFEST <> 0 or DIFTRU > ULP*norm(A,B) ',
00889 $ 'when reordering fails', /
00890 $ ' 10 = 1/ULP if PLEST/PLTRU > THRESH or ',
00891 $ 'PLTRU/PLEST > THRESH', /
00892 $ ' ( Test 10 is only for input examples )', / )
00893 9991 FORMAT( ' Matrix order=', I2, ', type=', I2, ', a=', D10.4,
00894 $ ', order(A_11)=', I2, ', result ', I2, ' is ', 0P, F8.2 )
00895 9990 FORMAT( ' Matrix order=', I2, ', type=', I2, ', a=', D10.4,
00896 $ ', order(A_11)=', I2, ', result ', I2, ' is ', 0P, D10.4 )
00897 9989 FORMAT( ' Input example #', I2, ', matrix order=', I4, ',',
00898 $ ' result ', I2, ' is', 0P, F8.2 )
00899 9988 FORMAT( ' Input example #', I2, ', matrix order=', I4, ',',
00900 $ ' result ', I2, ' is', 1P, D10.3 )
00901
00902
00903
00904 END