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