00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016
00017
00018 static doublereal c_b17 = 0.;
00019 static integer c__0 = 0;
00020 static doublereal c_b31 = 1.;
00021 static integer c__4 = 4;
00022 static integer c__6 = 6;
00023 static integer c__1 = 1;
00024 static integer c__2 = 2;
00025
00026 int ddrvev_(integer *nsizes, integer *nn, integer *ntypes,
00027 logical *dotype, integer *iseed, doublereal *thresh, integer *nounit,
00028 doublereal *a, integer *lda, doublereal *h__, doublereal *wr,
00029 doublereal *wi, doublereal *wr1, doublereal *wi1, doublereal *vl,
00030 integer *ldvl, doublereal *vr, integer *ldvr, doublereal *lre,
00031 integer *ldlre, doublereal *result, doublereal *work, integer *nwork,
00032 integer *iwork, integer *info)
00033 {
00034
00035
00036 static integer ktype[21] = { 1,2,3,4,4,4,4,4,6,6,6,6,6,6,6,6,6,6,9,9,9 };
00037 static integer kmagn[21] = { 1,1,1,1,1,1,2,3,1,1,1,1,1,1,1,1,2,3,1,2,3 };
00038 static integer kmode[21] = { 0,0,0,4,3,1,4,4,4,3,1,5,4,3,1,5,5,5,4,3,1 };
00039 static integer kconds[21] = { 0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,2,2,0,0,0 };
00040
00041
00042 static char fmt_9993[] = "(\002 DDRVEV: \002,a,\002 returned INFO=\002,i"
00043 "6,\002.\002,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, ISEED="
00044 "(\002,3(i5,\002,\002),i5,\002)\002)";
00045 static char fmt_9999[] = "(/1x,a3,\002 -- Real Eigenvalue-Eigenvector De"
00046 "composition\002,\002 Driver\002,/\002 Matrix types (see DDRVEV f"
00047 "or details): \002)";
00048 static char fmt_9998[] = "(/\002 Special Matrices:\002,/\002 1=Zero mat"
00049 "rix. \002,\002 \002,\002 5=Diagonal: geom"
00050 "etr. spaced entries.\002,/\002 2=Identity matrix. "
00051 " \002,\002 6=Diagona\002,\002l: clustered entries.\002,"
00052 "/\002 3=Transposed Jordan block. \002,\002 \002,\002 "
00053 " 7=Diagonal: large, evenly spaced.\002,/\002 \002,\0024=Diagona"
00054 "l: evenly spaced entries. \002,\002 8=Diagonal: s\002,\002ma"
00055 "ll, evenly spaced.\002)";
00056 static char fmt_9997[] = "(\002 Dense, Non-Symmetric Matrices:\002,/\002"
00057 " 9=Well-cond., ev\002,\002enly spaced eigenvals.\002,\002 14=Il"
00058 "l-cond., geomet. spaced e\002,\002igenals.\002,/\002 10=Well-con"
00059 "d., geom. spaced eigenvals. \002,\002 15=Ill-conditioned, cluste"
00060 "red e.vals.\002,/\002 11=Well-cond\002,\002itioned, clustered e."
00061 "vals. \002,\002 16=Ill-cond., random comp\002,\002lex \002,/\002"
00062 " 12=Well-cond., random complex \002,6x,\002 \002,\002 17=Ill-c"
00063 "ond., large rand. complx \002,/\002 13=Ill-condi\002,\002tioned,"
00064 " evenly spaced. \002,\002 18=Ill-cond., small rand.\002,\002"
00065 " complx \002)";
00066 static char fmt_9996[] = "(\002 19=Matrix with random O(1) entries. "
00067 " \002,\002 21=Matrix \002,\002with small random entries.\002,"
00068 "/\002 20=Matrix with large ran\002,\002dom entries. \002,/)";
00069 static char fmt_9995[] = "(\002 Tests performed with test threshold ="
00070 "\002,f8.2,//\002 1 = | A VR - VR W | / ( n |A| ulp ) \002,/\002 "
00071 "2 = | transpose(A) VL - VL W | / ( n |A| ulp ) \002,/\002 3 = | "
00072 "|VR(i)| - 1 | / ulp \002,/\002 4 = | |VL(i)| - 1 | / ulp \002,"
00073 "/\002 5 = 0 if W same no matter if VR or VL computed,\002,\002 1"
00074 "/ulp otherwise\002,/\002 6 = 0 if VR same no matter if VL comput"
00075 "ed,\002,\002 1/ulp otherwise\002,/\002 7 = 0 if VL same no matt"
00076 "er if VR computed,\002,\002 1/ulp otherwise\002,/)";
00077 static char fmt_9994[] = "(\002 N=\002,i5,\002, IWK=\002,i2,\002, seed"
00078 "=\002,4(i4,\002,\002),\002 type \002,i2,\002, test(\002,i2,\002)="
00079 "\002,g10.3)";
00080
00081
00082 integer a_dim1, a_offset, h_dim1, h_offset, lre_dim1, lre_offset, vl_dim1,
00083 vl_offset, vr_dim1, vr_offset, i__1, i__2, i__3, i__4;
00084 doublereal d__1, d__2, d__3, d__4, d__5;
00085
00086
00087 int s_copy(char *, char *, ftnlen, ftnlen);
00088 double sqrt(doublereal);
00089 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00090
00091
00092 integer j, n, jj;
00093 doublereal dum[1], res[2];
00094 integer iwk;
00095 doublereal ulp, vmx, cond;
00096 integer jcol;
00097 char path[3];
00098 integer nmax;
00099 doublereal unfl, ovfl, tnrm, vrmx, vtst;
00100 extern doublereal dnrm2_(integer *, doublereal *, integer *);
00101 logical badnn;
00102 extern int dget22_(char *, char *, char *, integer *,
00103 doublereal *, integer *, doublereal *, integer *, doublereal *,
00104 doublereal *, doublereal *, doublereal *);
00105 integer nfail;
00106 extern int dgeev_(char *, char *, integer *, doublereal *
00107 , integer *, doublereal *, doublereal *, doublereal *, integer *,
00108 doublereal *, integer *, doublereal *, integer *, integer *);
00109 integer imode, iinfo;
00110 doublereal conds, anorm;
00111 integer jsize, nerrs, itype, jtype, ntest;
00112 doublereal rtulp;
00113 extern doublereal dlapy2_(doublereal *, doublereal *);
00114 extern int dlabad_(doublereal *, doublereal *);
00115 extern doublereal dlamch_(char *);
00116 char adumma[1*1];
00117 extern int dlatme_(integer *, char *, integer *,
00118 doublereal *, integer *, doublereal *, doublereal *, char *, char
00119 *, char *, char *, doublereal *, integer *, doublereal *, integer
00120 *, integer *, doublereal *, doublereal *, integer *, doublereal *,
00121 integer *);
00122 integer idumma[1];
00123 extern int dlacpy_(char *, integer *, integer *,
00124 doublereal *, integer *, doublereal *, integer *);
00125 integer ioldsd[4];
00126 extern int dlaset_(char *, integer *, integer *,
00127 doublereal *, doublereal *, doublereal *, integer *),
00128 xerbla_(char *, integer *), dlatmr_(integer *, integer *,
00129 char *, integer *, char *, doublereal *, integer *, doublereal *,
00130 doublereal *, char *, char *, doublereal *, integer *, doublereal
00131 *, doublereal *, integer *, doublereal *, char *, integer *,
00132 integer *, integer *, doublereal *, doublereal *, char *,
00133 doublereal *, integer *, integer *, integer *), dlatms_(integer *, integer *,
00134 char *, integer *, char *, doublereal *, integer *, doublereal *,
00135 doublereal *, integer *, integer *, char *, doublereal *, integer
00136 *, doublereal *, integer *), dlasum_(char
00137 *, integer *, integer *, integer *);
00138 integer ntestf;
00139 doublereal ulpinv;
00140 integer nnwork;
00141 doublereal rtulpi;
00142 integer mtypes, ntestt;
00143
00144
00145 static cilist io___32 = { 0, 0, 0, fmt_9993, 0 };
00146 static cilist io___35 = { 0, 0, 0, fmt_9993, 0 };
00147 static cilist io___43 = { 0, 0, 0, fmt_9993, 0 };
00148 static cilist io___44 = { 0, 0, 0, fmt_9993, 0 };
00149 static cilist io___45 = { 0, 0, 0, fmt_9993, 0 };
00150 static cilist io___48 = { 0, 0, 0, fmt_9999, 0 };
00151 static cilist io___49 = { 0, 0, 0, fmt_9998, 0 };
00152 static cilist io___50 = { 0, 0, 0, fmt_9997, 0 };
00153 static cilist io___51 = { 0, 0, 0, fmt_9996, 0 };
00154 static cilist io___52 = { 0, 0, 0, fmt_9995, 0 };
00155 static cilist io___53 = { 0, 0, 0, fmt_9994, 0 };
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
00374
00375
00376
00377
00378
00379
00380
00381
00382
00383
00384
00385
00386
00387
00388
00389
00390
00391
00392
00393
00394
00395
00396
00397
00398
00399
00400
00401
00402
00403
00404
00405
00406
00407
00408
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419
00420
00421
00422
00423
00424
00425
00426
00427
00428
00429
00430
00431
00432
00433
00434
00435
00436
00437
00438
00439
00440
00441
00442
00443
00444
00445
00446
00447
00448
00449
00450
00451
00452
00453
00454
00455
00456
00457
00458
00459
00460
00461
00462
00463 --nn;
00464 --dotype;
00465 --iseed;
00466 h_dim1 = *lda;
00467 h_offset = 1 + h_dim1;
00468 h__ -= h_offset;
00469 a_dim1 = *lda;
00470 a_offset = 1 + a_dim1;
00471 a -= a_offset;
00472 --wr;
00473 --wi;
00474 --wr1;
00475 --wi1;
00476 vl_dim1 = *ldvl;
00477 vl_offset = 1 + vl_dim1;
00478 vl -= vl_offset;
00479 vr_dim1 = *ldvr;
00480 vr_offset = 1 + vr_dim1;
00481 vr -= vr_offset;
00482 lre_dim1 = *ldlre;
00483 lre_offset = 1 + lre_dim1;
00484 lre -= lre_offset;
00485 --result;
00486 --work;
00487 --iwork;
00488
00489
00490
00491
00492
00493 s_copy(path, "Double precision", (ftnlen)1, (ftnlen)16);
00494 s_copy(path + 1, "EV", (ftnlen)2, (ftnlen)2);
00495
00496
00497
00498 ntestt = 0;
00499 ntestf = 0;
00500 *info = 0;
00501
00502
00503
00504 badnn = FALSE_;
00505 nmax = 0;
00506 i__1 = *nsizes;
00507 for (j = 1; j <= i__1; ++j) {
00508
00509 i__2 = nmax, i__3 = nn[j];
00510 nmax = max(i__2,i__3);
00511 if (nn[j] < 0) {
00512 badnn = TRUE_;
00513 }
00514
00515 }
00516
00517
00518
00519 if (*nsizes < 0) {
00520 *info = -1;
00521 } else if (badnn) {
00522 *info = -2;
00523 } else if (*ntypes < 0) {
00524 *info = -3;
00525 } else if (*thresh < 0.) {
00526 *info = -6;
00527 } else if (*nounit <= 0) {
00528 *info = -7;
00529 } else if (*lda < 1 || *lda < nmax) {
00530 *info = -9;
00531 } else if (*ldvl < 1 || *ldvl < nmax) {
00532 *info = -16;
00533 } else if (*ldvr < 1 || *ldvr < nmax) {
00534 *info = -18;
00535 } else if (*ldlre < 1 || *ldlre < nmax) {
00536 *info = -20;
00537 } else {
00538
00539 i__1 = nmax;
00540 if (nmax * 5 + (i__1 * i__1 << 1) > *nwork) {
00541 *info = -23;
00542 }
00543 }
00544
00545 if (*info != 0) {
00546 i__1 = -(*info);
00547 xerbla_("DDRVEV", &i__1);
00548 return 0;
00549 }
00550
00551
00552
00553 if (*nsizes == 0 || *ntypes == 0) {
00554 return 0;
00555 }
00556
00557
00558
00559 unfl = dlamch_("Safe minimum");
00560 ovfl = 1. / unfl;
00561 dlabad_(&unfl, &ovfl);
00562 ulp = dlamch_("Precision");
00563 ulpinv = 1. / ulp;
00564 rtulp = sqrt(ulp);
00565 rtulpi = 1. / rtulp;
00566
00567
00568
00569 nerrs = 0;
00570
00571 i__1 = *nsizes;
00572 for (jsize = 1; jsize <= i__1; ++jsize) {
00573 n = nn[jsize];
00574 if (*nsizes != 1) {
00575 mtypes = min(21,*ntypes);
00576 } else {
00577 mtypes = min(22,*ntypes);
00578 }
00579
00580 i__2 = mtypes;
00581 for (jtype = 1; jtype <= i__2; ++jtype) {
00582 if (! dotype[jtype]) {
00583 goto L260;
00584 }
00585
00586
00587
00588 for (j = 1; j <= 4; ++j) {
00589 ioldsd[j - 1] = iseed[j];
00590
00591 }
00592
00593
00594
00595
00596
00597
00598
00599
00600
00601
00602
00603
00604
00605
00606
00607
00608
00609 if (mtypes > 21) {
00610 goto L90;
00611 }
00612
00613 itype = ktype[jtype - 1];
00614 imode = kmode[jtype - 1];
00615
00616
00617
00618 switch (kmagn[jtype - 1]) {
00619 case 1: goto L30;
00620 case 2: goto L40;
00621 case 3: goto L50;
00622 }
00623
00624 L30:
00625 anorm = 1.;
00626 goto L60;
00627
00628 L40:
00629 anorm = ovfl * ulp;
00630 goto L60;
00631
00632 L50:
00633 anorm = unfl * ulpinv;
00634 goto L60;
00635
00636 L60:
00637
00638 dlaset_("Full", lda, &n, &c_b17, &c_b17, &a[a_offset], lda);
00639 iinfo = 0;
00640 cond = ulpinv;
00641
00642
00643
00644
00645
00646 if (itype == 1) {
00647 iinfo = 0;
00648
00649 } else if (itype == 2) {
00650
00651
00652
00653 i__3 = n;
00654 for (jcol = 1; jcol <= i__3; ++jcol) {
00655 a[jcol + jcol * a_dim1] = anorm;
00656
00657 }
00658
00659 } else if (itype == 3) {
00660
00661
00662
00663 i__3 = n;
00664 for (jcol = 1; jcol <= i__3; ++jcol) {
00665 a[jcol + jcol * a_dim1] = anorm;
00666 if (jcol > 1) {
00667 a[jcol + (jcol - 1) * a_dim1] = 1.;
00668 }
00669
00670 }
00671
00672 } else if (itype == 4) {
00673
00674
00675
00676 dlatms_(&n, &n, "S", &iseed[1], "S", &work[1], &imode, &cond,
00677 &anorm, &c__0, &c__0, "N", &a[a_offset], lda, &work[n
00678 + 1], &iinfo);
00679
00680 } else if (itype == 5) {
00681
00682
00683
00684 dlatms_(&n, &n, "S", &iseed[1], "S", &work[1], &imode, &cond,
00685 &anorm, &n, &n, "N", &a[a_offset], lda, &work[n + 1],
00686 &iinfo);
00687
00688 } else if (itype == 6) {
00689
00690
00691
00692 if (kconds[jtype - 1] == 1) {
00693 conds = 1.;
00694 } else if (kconds[jtype - 1] == 2) {
00695 conds = rtulpi;
00696 } else {
00697 conds = 0.;
00698 }
00699
00700 *(unsigned char *)&adumma[0] = ' ';
00701 dlatme_(&n, "S", &iseed[1], &work[1], &imode, &cond, &c_b31,
00702 adumma, "T", "T", "T", &work[n + 1], &c__4, &conds, &
00703 n, &n, &anorm, &a[a_offset], lda, &work[(n << 1) + 1],
00704 &iinfo);
00705
00706 } else if (itype == 7) {
00707
00708
00709
00710 dlatmr_(&n, &n, "S", &iseed[1], "S", &work[1], &c__6, &c_b31,
00711 &c_b31, "T", "N", &work[n + 1], &c__1, &c_b31, &work[(
00712 n << 1) + 1], &c__1, &c_b31, "N", idumma, &c__0, &
00713 c__0, &c_b17, &anorm, "NO", &a[a_offset], lda, &iwork[
00714 1], &iinfo);
00715
00716 } else if (itype == 8) {
00717
00718
00719
00720 dlatmr_(&n, &n, "S", &iseed[1], "S", &work[1], &c__6, &c_b31,
00721 &c_b31, "T", "N", &work[n + 1], &c__1, &c_b31, &work[(
00722 n << 1) + 1], &c__1, &c_b31, "N", idumma, &n, &n, &
00723 c_b17, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00724 iinfo);
00725
00726 } else if (itype == 9) {
00727
00728
00729
00730 dlatmr_(&n, &n, "S", &iseed[1], "N", &work[1], &c__6, &c_b31,
00731 &c_b31, "T", "N", &work[n + 1], &c__1, &c_b31, &work[(
00732 n << 1) + 1], &c__1, &c_b31, "N", idumma, &n, &n, &
00733 c_b17, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00734 iinfo);
00735 if (n >= 4) {
00736 dlaset_("Full", &c__2, &n, &c_b17, &c_b17, &a[a_offset],
00737 lda);
00738 i__3 = n - 3;
00739 dlaset_("Full", &i__3, &c__1, &c_b17, &c_b17, &a[a_dim1 +
00740 3], lda);
00741 i__3 = n - 3;
00742 dlaset_("Full", &i__3, &c__2, &c_b17, &c_b17, &a[(n - 1) *
00743 a_dim1 + 3], lda);
00744 dlaset_("Full", &c__1, &n, &c_b17, &c_b17, &a[n + a_dim1],
00745 lda);
00746 }
00747
00748 } else if (itype == 10) {
00749
00750
00751
00752 dlatmr_(&n, &n, "S", &iseed[1], "N", &work[1], &c__6, &c_b31,
00753 &c_b31, "T", "N", &work[n + 1], &c__1, &c_b31, &work[(
00754 n << 1) + 1], &c__1, &c_b31, "N", idumma, &n, &c__0, &
00755 c_b17, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00756 iinfo);
00757
00758 } else {
00759
00760 iinfo = 1;
00761 }
00762
00763 if (iinfo != 0) {
00764 io___32.ciunit = *nounit;
00765 s_wsfe(&io___32);
00766 do_fio(&c__1, "Generator", (ftnlen)9);
00767 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00768 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00769 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00770 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00771 e_wsfe();
00772 *info = abs(iinfo);
00773 return 0;
00774 }
00775
00776 L90:
00777
00778
00779
00780 for (iwk = 1; iwk <= 2; ++iwk) {
00781 if (iwk == 1) {
00782 nnwork = n << 2;
00783 } else {
00784
00785 i__3 = n;
00786 nnwork = n * 5 + (i__3 * i__3 << 1);
00787 }
00788 nnwork = max(nnwork,1);
00789
00790
00791
00792 for (j = 1; j <= 7; ++j) {
00793 result[j] = -1.;
00794
00795 }
00796
00797
00798
00799 dlacpy_("F", &n, &n, &a[a_offset], lda, &h__[h_offset], lda);
00800 dgeev_("V", "V", &n, &h__[h_offset], lda, &wr[1], &wi[1], &vl[
00801 vl_offset], ldvl, &vr[vr_offset], ldvr, &work[1], &
00802 nnwork, &iinfo);
00803 if (iinfo != 0) {
00804 result[1] = ulpinv;
00805 io___35.ciunit = *nounit;
00806 s_wsfe(&io___35);
00807 do_fio(&c__1, "DGEEV1", (ftnlen)6);
00808 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00809 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00810 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00811 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00812 ;
00813 e_wsfe();
00814 *info = abs(iinfo);
00815 goto L220;
00816 }
00817
00818
00819
00820 dget22_("N", "N", "N", &n, &a[a_offset], lda, &vr[vr_offset],
00821 ldvr, &wr[1], &wi[1], &work[1], res);
00822 result[1] = res[0];
00823
00824
00825
00826 dget22_("T", "N", "T", &n, &a[a_offset], lda, &vl[vl_offset],
00827 ldvl, &wr[1], &wi[1], &work[1], res);
00828 result[2] = res[0];
00829
00830
00831
00832 i__3 = n;
00833 for (j = 1; j <= i__3; ++j) {
00834 tnrm = 1.;
00835 if (wi[j] == 0.) {
00836 tnrm = dnrm2_(&n, &vr[j * vr_dim1 + 1], &c__1);
00837 } else if (wi[j] > 0.) {
00838 d__1 = dnrm2_(&n, &vr[j * vr_dim1 + 1], &c__1);
00839 d__2 = dnrm2_(&n, &vr[(j + 1) * vr_dim1 + 1], &c__1);
00840 tnrm = dlapy2_(&d__1, &d__2);
00841 }
00842
00843
00844 d__4 = ulpinv, d__5 = (d__1 = tnrm - 1., abs(d__1)) / ulp;
00845 d__2 = result[3], d__3 = min(d__4,d__5);
00846 result[3] = max(d__2,d__3);
00847 if (wi[j] > 0.) {
00848 vmx = 0.;
00849 vrmx = 0.;
00850 i__4 = n;
00851 for (jj = 1; jj <= i__4; ++jj) {
00852 vtst = dlapy2_(&vr[jj + j * vr_dim1], &vr[jj + (j
00853 + 1) * vr_dim1]);
00854 if (vtst > vmx) {
00855 vmx = vtst;
00856 }
00857 if (vr[jj + (j + 1) * vr_dim1] == 0. && (d__1 =
00858 vr[jj + j * vr_dim1], abs(d__1)) > vrmx) {
00859 vrmx = (d__2 = vr[jj + j * vr_dim1], abs(d__2)
00860 );
00861 }
00862
00863 }
00864 if (vrmx / vmx < 1. - ulp * 2.) {
00865 result[3] = ulpinv;
00866 }
00867 }
00868
00869 }
00870
00871
00872
00873 i__3 = n;
00874 for (j = 1; j <= i__3; ++j) {
00875 tnrm = 1.;
00876 if (wi[j] == 0.) {
00877 tnrm = dnrm2_(&n, &vl[j * vl_dim1 + 1], &c__1);
00878 } else if (wi[j] > 0.) {
00879 d__1 = dnrm2_(&n, &vl[j * vl_dim1 + 1], &c__1);
00880 d__2 = dnrm2_(&n, &vl[(j + 1) * vl_dim1 + 1], &c__1);
00881 tnrm = dlapy2_(&d__1, &d__2);
00882 }
00883
00884
00885 d__4 = ulpinv, d__5 = (d__1 = tnrm - 1., abs(d__1)) / ulp;
00886 d__2 = result[4], d__3 = min(d__4,d__5);
00887 result[4] = max(d__2,d__3);
00888 if (wi[j] > 0.) {
00889 vmx = 0.;
00890 vrmx = 0.;
00891 i__4 = n;
00892 for (jj = 1; jj <= i__4; ++jj) {
00893 vtst = dlapy2_(&vl[jj + j * vl_dim1], &vl[jj + (j
00894 + 1) * vl_dim1]);
00895 if (vtst > vmx) {
00896 vmx = vtst;
00897 }
00898 if (vl[jj + (j + 1) * vl_dim1] == 0. && (d__1 =
00899 vl[jj + j * vl_dim1], abs(d__1)) > vrmx) {
00900 vrmx = (d__2 = vl[jj + j * vl_dim1], abs(d__2)
00901 );
00902 }
00903
00904 }
00905 if (vrmx / vmx < 1. - ulp * 2.) {
00906 result[4] = ulpinv;
00907 }
00908 }
00909
00910 }
00911
00912
00913
00914 dlacpy_("F", &n, &n, &a[a_offset], lda, &h__[h_offset], lda);
00915 dgeev_("N", "N", &n, &h__[h_offset], lda, &wr1[1], &wi1[1],
00916 dum, &c__1, dum, &c__1, &work[1], &nnwork, &iinfo);
00917 if (iinfo != 0) {
00918 result[1] = ulpinv;
00919 io___43.ciunit = *nounit;
00920 s_wsfe(&io___43);
00921 do_fio(&c__1, "DGEEV2", (ftnlen)6);
00922 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00923 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00924 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00925 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00926 ;
00927 e_wsfe();
00928 *info = abs(iinfo);
00929 goto L220;
00930 }
00931
00932
00933
00934 i__3 = n;
00935 for (j = 1; j <= i__3; ++j) {
00936 if (wr[j] != wr1[j] || wi[j] != wi1[j]) {
00937 result[5] = ulpinv;
00938 }
00939
00940 }
00941
00942
00943
00944 dlacpy_("F", &n, &n, &a[a_offset], lda, &h__[h_offset], lda);
00945 dgeev_("N", "V", &n, &h__[h_offset], lda, &wr1[1], &wi1[1],
00946 dum, &c__1, &lre[lre_offset], ldlre, &work[1], &
00947 nnwork, &iinfo);
00948 if (iinfo != 0) {
00949 result[1] = ulpinv;
00950 io___44.ciunit = *nounit;
00951 s_wsfe(&io___44);
00952 do_fio(&c__1, "DGEEV3", (ftnlen)6);
00953 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00954 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00955 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00956 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00957 ;
00958 e_wsfe();
00959 *info = abs(iinfo);
00960 goto L220;
00961 }
00962
00963
00964
00965 i__3 = n;
00966 for (j = 1; j <= i__3; ++j) {
00967 if (wr[j] != wr1[j] || wi[j] != wi1[j]) {
00968 result[5] = ulpinv;
00969 }
00970
00971 }
00972
00973
00974
00975 i__3 = n;
00976 for (j = 1; j <= i__3; ++j) {
00977 i__4 = n;
00978 for (jj = 1; jj <= i__4; ++jj) {
00979 if (vr[j + jj * vr_dim1] != lre[j + jj * lre_dim1]) {
00980 result[6] = ulpinv;
00981 }
00982
00983 }
00984
00985 }
00986
00987
00988
00989 dlacpy_("F", &n, &n, &a[a_offset], lda, &h__[h_offset], lda);
00990 dgeev_("V", "N", &n, &h__[h_offset], lda, &wr1[1], &wi1[1], &
00991 lre[lre_offset], ldlre, dum, &c__1, &work[1], &nnwork,
00992 &iinfo);
00993 if (iinfo != 0) {
00994 result[1] = ulpinv;
00995 io___45.ciunit = *nounit;
00996 s_wsfe(&io___45);
00997 do_fio(&c__1, "DGEEV4", (ftnlen)6);
00998 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00999 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01000 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01001 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01002 ;
01003 e_wsfe();
01004 *info = abs(iinfo);
01005 goto L220;
01006 }
01007
01008
01009
01010 i__3 = n;
01011 for (j = 1; j <= i__3; ++j) {
01012 if (wr[j] != wr1[j] || wi[j] != wi1[j]) {
01013 result[5] = ulpinv;
01014 }
01015
01016 }
01017
01018
01019
01020 i__3 = n;
01021 for (j = 1; j <= i__3; ++j) {
01022 i__4 = n;
01023 for (jj = 1; jj <= i__4; ++jj) {
01024 if (vl[j + jj * vl_dim1] != lre[j + jj * lre_dim1]) {
01025 result[7] = ulpinv;
01026 }
01027
01028 }
01029
01030 }
01031
01032
01033
01034 L220:
01035
01036 ntest = 0;
01037 nfail = 0;
01038 for (j = 1; j <= 7; ++j) {
01039 if (result[j] >= 0.) {
01040 ++ntest;
01041 }
01042 if (result[j] >= *thresh) {
01043 ++nfail;
01044 }
01045
01046 }
01047
01048 if (nfail > 0) {
01049 ++ntestf;
01050 }
01051 if (ntestf == 1) {
01052 io___48.ciunit = *nounit;
01053 s_wsfe(&io___48);
01054 do_fio(&c__1, path, (ftnlen)3);
01055 e_wsfe();
01056 io___49.ciunit = *nounit;
01057 s_wsfe(&io___49);
01058 e_wsfe();
01059 io___50.ciunit = *nounit;
01060 s_wsfe(&io___50);
01061 e_wsfe();
01062 io___51.ciunit = *nounit;
01063 s_wsfe(&io___51);
01064 e_wsfe();
01065 io___52.ciunit = *nounit;
01066 s_wsfe(&io___52);
01067 do_fio(&c__1, (char *)&(*thresh), (ftnlen)sizeof(
01068 doublereal));
01069 e_wsfe();
01070 ntestf = 2;
01071 }
01072
01073 for (j = 1; j <= 7; ++j) {
01074 if (result[j] >= *thresh) {
01075 io___53.ciunit = *nounit;
01076 s_wsfe(&io___53);
01077 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01078 do_fio(&c__1, (char *)&iwk, (ftnlen)sizeof(integer));
01079 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01080 integer));
01081 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01082 ;
01083 do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer));
01084 do_fio(&c__1, (char *)&result[j], (ftnlen)sizeof(
01085 doublereal));
01086 e_wsfe();
01087 }
01088
01089 }
01090
01091 nerrs += nfail;
01092 ntestt += ntest;
01093
01094
01095 }
01096 L260:
01097 ;
01098 }
01099
01100 }
01101
01102
01103
01104 dlasum_(path, nounit, &nerrs, &ntestt);
01105
01106
01107
01108 return 0;
01109
01110
01111
01112 }