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