00001 SUBROUTINE ZDRVVX( NSIZES, NN, NTYPES, DOTYPE, ISEED, THRESH,
00002 $ NIUNIT, NOUNIT, A, LDA, H, W, W1, VL, LDVL, VR,
00003 $ LDVR, LRE, LDLRE, RCONDV, RCNDV1, RCDVIN,
00004 $ RCONDE, RCNDE1, RCDEIN, SCALE, SCALE1, RESULT,
00005 $ WORK, NWORK, RWORK, INFO )
00006
00007
00008
00009
00010
00011
00012 INTEGER INFO, LDA, LDLRE, LDVL, LDVR, NIUNIT, NOUNIT,
00013 $ NSIZES, NTYPES, NWORK
00014 DOUBLE PRECISION THRESH
00015
00016
00017 LOGICAL DOTYPE( * )
00018 INTEGER ISEED( 4 ), NN( * )
00019 DOUBLE PRECISION RCDEIN( * ), RCDVIN( * ), RCNDE1( * ),
00020 $ RCNDV1( * ), RCONDE( * ), RCONDV( * ),
00021 $ RESULT( 11 ), RWORK( * ), SCALE( * ),
00022 $ SCALE1( * )
00023 COMPLEX*16 A( LDA, * ), H( LDA, * ), LRE( LDLRE, * ),
00024 $ VL( LDVL, * ), VR( LDVR, * ), W( * ), W1( * ),
00025 $ WORK( * )
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
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 COMPLEX*16 CZERO
00346 PARAMETER ( CZERO = ( 0.0D+0, 0.0D+0 ) )
00347 COMPLEX*16 CONE
00348 PARAMETER ( CONE = ( 1.0D+0, 0.0D+0 ) )
00349 DOUBLE PRECISION ZERO, ONE
00350 PARAMETER ( ZERO = 0.0D+0, ONE = 1.0D+0 )
00351 INTEGER MAXTYP
00352 PARAMETER ( MAXTYP = 21 )
00353
00354
00355 LOGICAL BADNN
00356 CHARACTER BALANC
00357 CHARACTER*3 PATH
00358 INTEGER I, IBAL, IINFO, IMODE, ISRT, ITYPE, IWK, J,
00359 $ JCOL, JSIZE, JTYPE, MTYPES, N, NERRS, NFAIL,
00360 $ NMAX, NNWORK, NTEST, NTESTF, NTESTT
00361 DOUBLE PRECISION ANORM, COND, CONDS, OVFL, RTULP, RTULPI, ULP,
00362 $ ULPINV, UNFL, WI, WR
00363
00364
00365 CHARACTER BAL( 4 )
00366 INTEGER IDUMMA( 1 ), IOLDSD( 4 ), KCONDS( MAXTYP ),
00367 $ KMAGN( MAXTYP ), KMODE( MAXTYP ),
00368 $ KTYPE( MAXTYP )
00369
00370
00371 DOUBLE PRECISION DLAMCH
00372 EXTERNAL DLAMCH
00373
00374
00375 EXTERNAL DLABAD, DLASUM, XERBLA, ZGET23, ZLASET, ZLATME,
00376 $ ZLATMR, ZLATMS
00377
00378
00379 INTRINSIC ABS, DCMPLX, MAX, MIN, SQRT
00380
00381
00382 DATA KTYPE / 1, 2, 3, 5*4, 4*6, 6*6, 3*9 /
00383 DATA KMAGN / 3*1, 1, 1, 1, 2, 3, 4*1, 1, 1, 1, 1, 2,
00384 $ 3, 1, 2, 3 /
00385 DATA KMODE / 3*0, 4, 3, 1, 4, 4, 4, 3, 1, 5, 4, 3,
00386 $ 1, 5, 5, 5, 4, 3, 1 /
00387 DATA KCONDS / 3*0, 5*0, 4*1, 6*2, 3*0 /
00388 DATA BAL / 'N', 'P', 'S', 'B' /
00389
00390
00391
00392 PATH( 1: 1 ) = 'Zomplex precision'
00393 PATH( 2: 3 ) = 'VX'
00394
00395
00396
00397 NTESTT = 0
00398 NTESTF = 0
00399 INFO = 0
00400
00401
00402
00403 BADNN = .FALSE.
00404
00405
00406
00407
00408 NMAX = 7
00409 DO 10 J = 1, NSIZES
00410 NMAX = MAX( NMAX, NN( J ) )
00411 IF( NN( J ).LT.0 )
00412 $ BADNN = .TRUE.
00413 10 CONTINUE
00414
00415
00416
00417 IF( NSIZES.LT.0 ) THEN
00418 INFO = -1
00419 ELSE IF( BADNN ) THEN
00420 INFO = -2
00421 ELSE IF( NTYPES.LT.0 ) THEN
00422 INFO = -3
00423 ELSE IF( THRESH.LT.ZERO ) THEN
00424 INFO = -6
00425 ELSE IF( LDA.LT.1 .OR. LDA.LT.NMAX ) THEN
00426 INFO = -10
00427 ELSE IF( LDVL.LT.1 .OR. LDVL.LT.NMAX ) THEN
00428 INFO = -15
00429 ELSE IF( LDVR.LT.1 .OR. LDVR.LT.NMAX ) THEN
00430 INFO = -17
00431 ELSE IF( LDLRE.LT.1 .OR. LDLRE.LT.NMAX ) THEN
00432 INFO = -19
00433 ELSE IF( 6*NMAX+2*NMAX**2.GT.NWORK ) THEN
00434 INFO = -30
00435 END IF
00436
00437 IF( INFO.NE.0 ) THEN
00438 CALL XERBLA( 'ZDRVVX', -INFO )
00439 RETURN
00440 END IF
00441
00442
00443
00444 IF( NSIZES.EQ.0 .OR. NTYPES.EQ.0 )
00445 $ GO TO 160
00446
00447
00448
00449 UNFL = DLAMCH( 'Safe minimum' )
00450 OVFL = ONE / UNFL
00451 CALL DLABAD( UNFL, OVFL )
00452 ULP = DLAMCH( 'Precision' )
00453 ULPINV = ONE / ULP
00454 RTULP = SQRT( ULP )
00455 RTULPI = ONE / RTULP
00456
00457
00458
00459 NERRS = 0
00460
00461 DO 150 JSIZE = 1, NSIZES
00462 N = NN( JSIZE )
00463 IF( NSIZES.NE.1 ) THEN
00464 MTYPES = MIN( MAXTYP, NTYPES )
00465 ELSE
00466 MTYPES = MIN( MAXTYP+1, NTYPES )
00467 END IF
00468
00469 DO 140 JTYPE = 1, MTYPES
00470 IF( .NOT.DOTYPE( JTYPE ) )
00471 $ GO TO 140
00472
00473
00474
00475 DO 20 J = 1, 4
00476 IOLDSD( J ) = ISEED( J )
00477 20 CONTINUE
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495 IF( MTYPES.GT.MAXTYP )
00496 $ GO TO 90
00497
00498 ITYPE = KTYPE( JTYPE )
00499 IMODE = KMODE( JTYPE )
00500
00501
00502
00503 GO TO ( 30, 40, 50 )KMAGN( JTYPE )
00504
00505 30 CONTINUE
00506 ANORM = ONE
00507 GO TO 60
00508
00509 40 CONTINUE
00510 ANORM = OVFL*ULP
00511 GO TO 60
00512
00513 50 CONTINUE
00514 ANORM = UNFL*ULPINV
00515 GO TO 60
00516
00517 60 CONTINUE
00518
00519 CALL ZLASET( 'Full', LDA, N, CZERO, CZERO, A, LDA )
00520 IINFO = 0
00521 COND = ULPINV
00522
00523
00524
00525
00526
00527 IF( ITYPE.EQ.1 ) THEN
00528 IINFO = 0
00529
00530 ELSE IF( ITYPE.EQ.2 ) THEN
00531
00532
00533
00534 DO 70 JCOL = 1, N
00535 A( JCOL, JCOL ) = ANORM
00536 70 CONTINUE
00537
00538 ELSE IF( ITYPE.EQ.3 ) THEN
00539
00540
00541
00542 DO 80 JCOL = 1, N
00543 A( JCOL, JCOL ) = ANORM
00544 IF( JCOL.GT.1 )
00545 $ A( JCOL, JCOL-1 ) = ONE
00546 80 CONTINUE
00547
00548 ELSE IF( ITYPE.EQ.4 ) THEN
00549
00550
00551
00552 CALL ZLATMS( N, N, 'S', ISEED, 'H', RWORK, IMODE, COND,
00553 $ ANORM, 0, 0, 'N', A, LDA, WORK( N+1 ),
00554 $ IINFO )
00555
00556 ELSE IF( ITYPE.EQ.5 ) THEN
00557
00558
00559
00560 CALL ZLATMS( N, N, 'S', ISEED, 'H', RWORK, IMODE, COND,
00561 $ ANORM, N, N, 'N', A, LDA, WORK( N+1 ),
00562 $ IINFO )
00563
00564 ELSE IF( ITYPE.EQ.6 ) THEN
00565
00566
00567
00568 IF( KCONDS( JTYPE ).EQ.1 ) THEN
00569 CONDS = ONE
00570 ELSE IF( KCONDS( JTYPE ).EQ.2 ) THEN
00571 CONDS = RTULPI
00572 ELSE
00573 CONDS = ZERO
00574 END IF
00575
00576 CALL ZLATME( N, 'D', ISEED, WORK, IMODE, COND, CONE, ' ',
00577 $ 'T', 'T', 'T', RWORK, 4, CONDS, N, N, ANORM,
00578 $ A, LDA, WORK( 2*N+1 ), IINFO )
00579
00580 ELSE IF( ITYPE.EQ.7 ) THEN
00581
00582
00583
00584 CALL ZLATMR( N, N, 'D', ISEED, 'S', WORK, 6, ONE, CONE,
00585 $ 'T', 'N', WORK( N+1 ), 1, ONE,
00586 $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, 0, 0,
00587 $ ZERO, ANORM, 'NO', A, LDA, IDUMMA, IINFO )
00588
00589 ELSE IF( ITYPE.EQ.8 ) THEN
00590
00591
00592
00593 CALL ZLATMR( N, N, 'D', ISEED, 'H', WORK, 6, ONE, CONE,
00594 $ 'T', 'N', WORK( N+1 ), 1, ONE,
00595 $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, N, N,
00596 $ ZERO, ANORM, 'NO', A, LDA, IDUMMA, IINFO )
00597
00598 ELSE IF( ITYPE.EQ.9 ) THEN
00599
00600
00601
00602 CALL ZLATMR( N, N, 'D', ISEED, 'N', WORK, 6, ONE, CONE,
00603 $ 'T', 'N', WORK( N+1 ), 1, ONE,
00604 $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, N, N,
00605 $ ZERO, ANORM, 'NO', A, LDA, IDUMMA, IINFO )
00606 IF( N.GE.4 ) THEN
00607 CALL ZLASET( 'Full', 2, N, CZERO, CZERO, A, LDA )
00608 CALL ZLASET( 'Full', N-3, 1, CZERO, CZERO, A( 3, 1 ),
00609 $ LDA )
00610 CALL ZLASET( 'Full', N-3, 2, CZERO, CZERO,
00611 $ A( 3, N-1 ), LDA )
00612 CALL ZLASET( 'Full', 1, N, CZERO, CZERO, A( N, 1 ),
00613 $ LDA )
00614 END IF
00615
00616 ELSE IF( ITYPE.EQ.10 ) THEN
00617
00618
00619
00620 CALL ZLATMR( N, N, 'D', ISEED, 'N', WORK, 6, ONE, CONE,
00621 $ 'T', 'N', WORK( N+1 ), 1, ONE,
00622 $ WORK( 2*N+1 ), 1, ONE, 'N', IDUMMA, N, 0,
00623 $ ZERO, ANORM, 'NO', A, LDA, IDUMMA, IINFO )
00624
00625 ELSE
00626
00627 IINFO = 1
00628 END IF
00629
00630 IF( IINFO.NE.0 ) THEN
00631 WRITE( NOUNIT, FMT = 9992 )'Generator', IINFO, N, JTYPE,
00632 $ IOLDSD
00633 INFO = ABS( IINFO )
00634 RETURN
00635 END IF
00636
00637 90 CONTINUE
00638
00639
00640
00641 DO 130 IWK = 1, 3
00642 IF( IWK.EQ.1 ) THEN
00643 NNWORK = 2*N
00644 ELSE IF( IWK.EQ.2 ) THEN
00645 NNWORK = 2*N + N**2
00646 ELSE
00647 NNWORK = 6*N + 2*N**2
00648 END IF
00649 NNWORK = MAX( NNWORK, 1 )
00650
00651
00652
00653 DO 120 IBAL = 1, 4
00654 BALANC = BAL( IBAL )
00655
00656
00657
00658 CALL ZGET23( .FALSE., 0, BALANC, JTYPE, THRESH,
00659 $ IOLDSD, NOUNIT, N, A, LDA, H, W, W1, VL,
00660 $ LDVL, VR, LDVR, LRE, LDLRE, RCONDV,
00661 $ RCNDV1, RCDVIN, RCONDE, RCNDE1, RCDEIN,
00662 $ SCALE, SCALE1, RESULT, WORK, NNWORK,
00663 $ RWORK, INFO )
00664
00665
00666
00667 NTEST = 0
00668 NFAIL = 0
00669 DO 100 J = 1, 9
00670 IF( RESULT( J ).GE.ZERO )
00671 $ NTEST = NTEST + 1
00672 IF( RESULT( J ).GE.THRESH )
00673 $ NFAIL = NFAIL + 1
00674 100 CONTINUE
00675
00676 IF( NFAIL.GT.0 )
00677 $ NTESTF = NTESTF + 1
00678 IF( NTESTF.EQ.1 ) THEN
00679 WRITE( NOUNIT, FMT = 9999 )PATH
00680 WRITE( NOUNIT, FMT = 9998 )
00681 WRITE( NOUNIT, FMT = 9997 )
00682 WRITE( NOUNIT, FMT = 9996 )
00683 WRITE( NOUNIT, FMT = 9995 )THRESH
00684 NTESTF = 2
00685 END IF
00686
00687 DO 110 J = 1, 9
00688 IF( RESULT( J ).GE.THRESH ) THEN
00689 WRITE( NOUNIT, FMT = 9994 )BALANC, N, IWK,
00690 $ IOLDSD, JTYPE, J, RESULT( J )
00691 END IF
00692 110 CONTINUE
00693
00694 NERRS = NERRS + NFAIL
00695 NTESTT = NTESTT + NTEST
00696
00697 120 CONTINUE
00698 130 CONTINUE
00699 140 CONTINUE
00700 150 CONTINUE
00701
00702 160 CONTINUE
00703
00704
00705
00706
00707
00708 JTYPE = 0
00709 170 CONTINUE
00710 READ( NIUNIT, FMT = *, END = 220 )N, ISRT
00711
00712
00713
00714 IF( N.EQ.0 )
00715 $ GO TO 220
00716 JTYPE = JTYPE + 1
00717 ISEED( 1 ) = JTYPE
00718 DO 180 I = 1, N
00719 READ( NIUNIT, FMT = * )( A( I, J ), J = 1, N )
00720 180 CONTINUE
00721 DO 190 I = 1, N
00722 READ( NIUNIT, FMT = * )WR, WI, RCDEIN( I ), RCDVIN( I )
00723 W1( I ) = DCMPLX( WR, WI )
00724 190 CONTINUE
00725 CALL ZGET23( .TRUE., ISRT, 'N', 22, THRESH, ISEED, NOUNIT, N, A,
00726 $ LDA, H, W, W1, VL, LDVL, VR, LDVR, LRE, LDLRE,
00727 $ RCONDV, RCNDV1, RCDVIN, RCONDE, RCNDE1, RCDEIN,
00728 $ SCALE, SCALE1, RESULT, WORK, 6*N+2*N**2, RWORK,
00729 $ INFO )
00730
00731
00732
00733 NTEST = 0
00734 NFAIL = 0
00735 DO 200 J = 1, 11
00736 IF( RESULT( J ).GE.ZERO )
00737 $ NTEST = NTEST + 1
00738 IF( RESULT( J ).GE.THRESH )
00739 $ NFAIL = NFAIL + 1
00740 200 CONTINUE
00741
00742 IF( NFAIL.GT.0 )
00743 $ NTESTF = NTESTF + 1
00744 IF( NTESTF.EQ.1 ) THEN
00745 WRITE( NOUNIT, FMT = 9999 )PATH
00746 WRITE( NOUNIT, FMT = 9998 )
00747 WRITE( NOUNIT, FMT = 9997 )
00748 WRITE( NOUNIT, FMT = 9996 )
00749 WRITE( NOUNIT, FMT = 9995 )THRESH
00750 NTESTF = 2
00751 END IF
00752
00753 DO 210 J = 1, 11
00754 IF( RESULT( J ).GE.THRESH ) THEN
00755 WRITE( NOUNIT, FMT = 9993 )N, JTYPE, J, RESULT( J )
00756 END IF
00757 210 CONTINUE
00758
00759 NERRS = NERRS + NFAIL
00760 NTESTT = NTESTT + NTEST
00761 GO TO 170
00762 220 CONTINUE
00763
00764
00765
00766 CALL DLASUM( PATH, NOUNIT, NERRS, NTESTT )
00767
00768 9999 FORMAT( / 1X, A3, ' -- Complex Eigenvalue-Eigenvector ',
00769 $ 'Decomposition Expert Driver',
00770 $ / ' Matrix types (see ZDRVVX for details): ' )
00771
00772 9998 FORMAT( / ' Special Matrices:', / ' 1=Zero matrix. ',
00773 $ ' ', ' 5=Diagonal: geometr. spaced entries.',
00774 $ / ' 2=Identity matrix. ', ' 6=Diagona',
00775 $ 'l: clustered entries.', / ' 3=Transposed Jordan block. ',
00776 $ ' ', ' 7=Diagonal: large, evenly spaced.', / ' ',
00777 $ '4=Diagonal: evenly spaced entries. ', ' 8=Diagonal: s',
00778 $ 'mall, evenly spaced.' )
00779 9997 FORMAT( ' Dense, Non-Symmetric Matrices:', / ' 9=Well-cond., ev',
00780 $ 'enly spaced eigenvals.', ' 14=Ill-cond., geomet. spaced e',
00781 $ 'igenals.', / ' 10=Well-cond., geom. spaced eigenvals. ',
00782 $ ' 15=Ill-conditioned, clustered e.vals.', / ' 11=Well-cond',
00783 $ 'itioned, clustered e.vals. ', ' 16=Ill-cond., random comp',
00784 $ 'lex ', / ' 12=Well-cond., random complex ', ' ',
00785 $ ' 17=Ill-cond., large rand. complx ', / ' 13=Ill-condi',
00786 $ 'tioned, evenly spaced. ', ' 18=Ill-cond., small rand.',
00787 $ ' complx ' )
00788 9996 FORMAT( ' 19=Matrix with random O(1) entries. ', ' 21=Matrix ',
00789 $ 'with small random entries.', / ' 20=Matrix with large ran',
00790 $ 'dom entries. ', ' 22=Matrix read from input file', / )
00791 9995 FORMAT( ' Tests performed with test threshold =', F8.2,
00792 $ / / ' 1 = | A VR - VR W | / ( n |A| ulp ) ',
00793 $ / ' 2 = | transpose(A) VL - VL W | / ( n |A| ulp ) ',
00794 $ / ' 3 = | |VR(i)| - 1 | / ulp ',
00795 $ / ' 4 = | |VL(i)| - 1 | / ulp ',
00796 $ / ' 5 = 0 if W same no matter if VR or VL computed,',
00797 $ ' 1/ulp otherwise', /
00798 $ ' 6 = 0 if VR same no matter what else computed,',
00799 $ ' 1/ulp otherwise', /
00800 $ ' 7 = 0 if VL same no matter what else computed,',
00801 $ ' 1/ulp otherwise', /
00802 $ ' 8 = 0 if RCONDV same no matter what else computed,',
00803 $ ' 1/ulp otherwise', /
00804 $ ' 9 = 0 if SCALE, ILO, IHI, ABNRM same no matter what else',
00805 $ ' computed, 1/ulp otherwise',
00806 $ / ' 10 = | RCONDV - RCONDV(precomputed) | / cond(RCONDV),',
00807 $ / ' 11 = | RCONDE - RCONDE(precomputed) | / cond(RCONDE),' )
00808 9994 FORMAT( ' BALANC=''', A1, ''',N=', I4, ',IWK=', I1, ', seed=',
00809 $ 4( I4, ',' ), ' type ', I2, ', test(', I2, ')=', G10.3 )
00810 9993 FORMAT( ' N=', I5, ', input example =', I3, ', test(', I2, ')=',
00811 $ G10.3 )
00812 9992 FORMAT( ' ZDRVVX: ', A, ' returned INFO=', I6, '.', / 9X, 'N=',
00813 $ I6, ', JTYPE=', I6, ', ISEED=(', 3( I5, ',' ), I5, ')' )
00814
00815 RETURN
00816
00817
00818
00819 END