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 doublecomplex c_b1 = {0.,0.};
00019 static doublecomplex c_b2 = {1.,0.};
00020 static integer c__1 = 1;
00021 static doublereal c_b27 = 1.;
00022 static integer c__0 = 0;
00023 static doublereal c_b33 = 0.;
00024 static integer c__4 = 4;
00025 static integer c__6 = 6;
00026
00027 int zchkhs_(integer *nsizes, integer *nn, integer *ntypes,
00028 logical *dotype, integer *iseed, doublereal *thresh, integer *nounit,
00029 doublecomplex *a, integer *lda, doublecomplex *h__, doublecomplex *t1,
00030 doublecomplex *t2, doublecomplex *u, integer *ldu, doublecomplex *
00031 z__, doublecomplex *uz, doublecomplex *w1, doublecomplex *w3,
00032 doublecomplex *evectl, doublecomplex *evectr, doublecomplex *evecty,
00033 doublecomplex *evectx, doublecomplex *uu, doublecomplex *tau,
00034 doublecomplex *work, integer *nwork, doublereal *rwork, integer *
00035 iwork, logical *select, doublereal *result, integer *info)
00036 {
00037
00038
00039 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 };
00040 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 };
00041 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 };
00042 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 };
00043
00044
00045 static char fmt_9999[] = "(\002 ZCHKHS: \002,a,\002 returned INFO=\002,i"
00046 "6,\002.\002,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, ISEED="
00047 "(\002,3(i5,\002,\002),i5,\002)\002)";
00048 static char fmt_9998[] = "(\002 ZCHKHS: \002,a,\002 Eigenvectors from"
00049 " \002,a,\002 incorrectly \002,\002normalized.\002,/\002 Bits of "
00050 "error=\002,0p,g10.3,\002,\002,9x,\002N=\002,i6,\002, JTYPE=\002,"
00051 "i6,\002, ISEED=(\002,3(i5,\002,\002),i5,\002)\002)";
00052 static char fmt_9997[] = "(\002 ZCHKHS: Selected \002,a,\002 Eigenvector"
00053 "s from \002,a,\002 do not match other eigenvectors \002,9x,\002N="
00054 "\002,i6,\002, JTYPE=\002,i6,\002, ISEED=(\002,3(i5,\002,\002),i5,"
00055 "\002)\002)";
00056
00057
00058 integer a_dim1, a_offset, evectl_dim1, evectl_offset, evectr_dim1,
00059 evectr_offset, evectx_dim1, evectx_offset, evecty_dim1,
00060 evecty_offset, h_dim1, h_offset, t1_dim1, t1_offset, t2_dim1,
00061 t2_offset, u_dim1, u_offset, uu_dim1, uu_offset, uz_dim1,
00062 uz_offset, z_dim1, z_offset, i__1, i__2, i__3, i__4, i__5, i__6;
00063 doublereal d__1, d__2;
00064 doublecomplex z__1;
00065
00066
00067 double sqrt(doublereal);
00068 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00069 double z_abs(doublecomplex *);
00070
00071
00072 integer i__, j, k, n, n1, jj, in, ihi, ilo;
00073 doublereal ulp, cond;
00074 integer jcol, nmax;
00075 doublereal unfl, ovfl, temp1, temp2;
00076 logical badnn, match;
00077 integer imode;
00078 doublereal dumma[4];
00079 integer iinfo;
00080 doublereal conds;
00081 extern int zget10_(integer *, integer *, doublecomplex *,
00082 integer *, doublecomplex *, integer *, doublecomplex *,
00083 doublereal *, doublereal *);
00084 doublereal aninv, anorm;
00085 extern int zget22_(char *, char *, char *, integer *,
00086 doublecomplex *, integer *, doublecomplex *, integer *,
00087 doublecomplex *, doublecomplex *, doublereal *, doublereal *), zgemm_(char *, char *, integer *,
00088 integer *, integer *, doublecomplex *, doublecomplex *, integer *,
00089 doublecomplex *, integer *, doublecomplex *, doublecomplex *,
00090 integer *);
00091 integer nmats, jsize, nerrs, itype, jtype, ntest;
00092 extern int zhst01_(integer *, integer *, integer *,
00093 doublecomplex *, integer *, doublecomplex *, integer *,
00094 doublecomplex *, integer *, doublecomplex *, integer *,
00095 doublereal *, doublereal *), zcopy_(integer *, doublecomplex *,
00096 integer *, doublecomplex *, integer *);
00097 doublereal rtulp;
00098 extern int dlabad_(doublereal *, doublereal *);
00099 extern doublereal dlamch_(char *);
00100 doublecomplex cdumma[4];
00101 integer idumma[1];
00102 extern int dlafts_(char *, integer *, integer *, integer
00103 *, integer *, doublereal *, integer *, doublereal *, integer *,
00104 integer *);
00105 integer ioldsd[4];
00106 extern int xerbla_(char *, integer *), zgehrd_(
00107 integer *, integer *, integer *, doublecomplex *, integer *,
00108 doublecomplex *, doublecomplex *, integer *, integer *), dlasum_(
00109 char *, integer *, integer *, integer *), zlatme_(integer
00110 *, char *, integer *, doublecomplex *, integer *, doublereal *,
00111 doublecomplex *, char *, char *, char *, char *, doublereal *,
00112 integer *, doublereal *, integer *, integer *, doublereal *,
00113 doublecomplex *, integer *, doublecomplex *, integer *), zhsein_(char *, char *, char *,
00114 logical *, integer *, doublecomplex *, integer *, doublecomplex *,
00115 doublecomplex *, integer *, doublecomplex *, integer *, integer *
00116 , integer *, doublecomplex *, doublereal *, integer *, integer *,
00117 integer *), zlacpy_(char *, integer *,
00118 integer *, doublecomplex *, integer *, doublecomplex *, integer *), zlaset_(char *, integer *, integer *, doublecomplex *,
00119 doublecomplex *, doublecomplex *, integer *), zlatmr_(
00120 integer *, integer *, char *, integer *, char *, doublecomplex *,
00121 integer *, doublereal *, doublecomplex *, char *, char *,
00122 doublecomplex *, integer *, doublereal *, doublecomplex *,
00123 integer *, doublereal *, char *, integer *, integer *, integer *,
00124 doublereal *, doublereal *, char *, doublecomplex *, integer *,
00125 integer *, integer *);
00126 doublereal rtunfl, rtovfl, rtulpi, ulpinv;
00127 integer mtypes, ntestt;
00128 extern int zhseqr_(char *, char *, integer *, integer *,
00129 integer *, doublecomplex *, integer *, doublecomplex *,
00130 doublecomplex *, integer *, doublecomplex *, integer *, integer *), zlatms_(integer *, integer *, char *, integer *,
00131 char *, doublereal *, integer *, doublereal *, doublereal *,
00132 integer *, integer *, char *, doublecomplex *, integer *,
00133 doublecomplex *, integer *), ztrevc_(char
00134 *, char *, logical *, integer *, doublecomplex *, integer *,
00135 doublecomplex *, integer *, doublecomplex *, integer *, integer *,
00136 integer *, doublecomplex *, doublereal *, integer *), zunghr_(integer *, integer *, integer *, doublecomplex *,
00137 integer *, doublecomplex *, doublecomplex *, integer *, integer *
00138 ), zunmhr_(char *, char *, integer *, integer *, integer *,
00139 integer *, doublecomplex *, integer *, doublecomplex *,
00140 doublecomplex *, integer *, doublecomplex *, integer *, integer *);
00141
00142
00143 static cilist io___35 = { 0, 0, 0, fmt_9999, 0 };
00144 static cilist io___38 = { 0, 0, 0, fmt_9999, 0 };
00145 static cilist io___40 = { 0, 0, 0, fmt_9999, 0 };
00146 static cilist io___41 = { 0, 0, 0, fmt_9999, 0 };
00147 static cilist io___42 = { 0, 0, 0, fmt_9999, 0 };
00148 static cilist io___47 = { 0, 0, 0, fmt_9999, 0 };
00149 static cilist io___49 = { 0, 0, 0, fmt_9998, 0 };
00150 static cilist io___50 = { 0, 0, 0, fmt_9999, 0 };
00151 static cilist io___54 = { 0, 0, 0, fmt_9997, 0 };
00152 static cilist io___55 = { 0, 0, 0, fmt_9999, 0 };
00153 static cilist io___56 = { 0, 0, 0, fmt_9998, 0 };
00154 static cilist io___57 = { 0, 0, 0, fmt_9999, 0 };
00155 static cilist io___58 = { 0, 0, 0, fmt_9997, 0 };
00156 static cilist io___59 = { 0, 0, 0, fmt_9999, 0 };
00157 static cilist io___60 = { 0, 0, 0, fmt_9998, 0 };
00158 static cilist io___61 = { 0, 0, 0, fmt_9999, 0 };
00159 static cilist io___62 = { 0, 0, 0, fmt_9998, 0 };
00160 static cilist io___63 = { 0, 0, 0, fmt_9999, 0 };
00161 static cilist io___64 = { 0, 0, 0, fmt_9999, 0 };
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
00464
00465
00466
00467
00468
00469
00470
00471
00472
00473
00474
00475
00476
00477
00478
00479
00480
00481
00482
00483
00484
00485
00486
00487
00488
00489
00490
00491
00492
00493
00494
00495
00496
00497
00498
00499
00500
00501
00502
00503
00504
00505
00506
00507
00508
00509
00510
00511
00512
00513
00514
00515
00516
00517
00518
00519
00520
00521
00522
00523
00524
00525
00526
00527
00528
00529
00530
00531
00532
00533
00534
00535
00536
00537
00538
00539
00540
00541
00542
00543
00544
00545
00546
00547 --nn;
00548 --dotype;
00549 --iseed;
00550 t2_dim1 = *lda;
00551 t2_offset = 1 + t2_dim1;
00552 t2 -= t2_offset;
00553 t1_dim1 = *lda;
00554 t1_offset = 1 + t1_dim1;
00555 t1 -= t1_offset;
00556 h_dim1 = *lda;
00557 h_offset = 1 + h_dim1;
00558 h__ -= h_offset;
00559 a_dim1 = *lda;
00560 a_offset = 1 + a_dim1;
00561 a -= a_offset;
00562 uu_dim1 = *ldu;
00563 uu_offset = 1 + uu_dim1;
00564 uu -= uu_offset;
00565 evectx_dim1 = *ldu;
00566 evectx_offset = 1 + evectx_dim1;
00567 evectx -= evectx_offset;
00568 evecty_dim1 = *ldu;
00569 evecty_offset = 1 + evecty_dim1;
00570 evecty -= evecty_offset;
00571 evectr_dim1 = *ldu;
00572 evectr_offset = 1 + evectr_dim1;
00573 evectr -= evectr_offset;
00574 evectl_dim1 = *ldu;
00575 evectl_offset = 1 + evectl_dim1;
00576 evectl -= evectl_offset;
00577 uz_dim1 = *ldu;
00578 uz_offset = 1 + uz_dim1;
00579 uz -= uz_offset;
00580 z_dim1 = *ldu;
00581 z_offset = 1 + z_dim1;
00582 z__ -= z_offset;
00583 u_dim1 = *ldu;
00584 u_offset = 1 + u_dim1;
00585 u -= u_offset;
00586 --w1;
00587 --w3;
00588 --tau;
00589 --work;
00590 --rwork;
00591 --iwork;
00592 --select;
00593 --result;
00594
00595
00596
00597
00598
00599
00600
00601 ntestt = 0;
00602 *info = 0;
00603
00604 badnn = FALSE_;
00605 nmax = 0;
00606 i__1 = *nsizes;
00607 for (j = 1; j <= i__1; ++j) {
00608
00609 i__2 = nmax, i__3 = nn[j];
00610 nmax = max(i__2,i__3);
00611 if (nn[j] < 0) {
00612 badnn = TRUE_;
00613 }
00614
00615 }
00616
00617
00618
00619 if (*nsizes < 0) {
00620 *info = -1;
00621 } else if (badnn) {
00622 *info = -2;
00623 } else if (*ntypes < 0) {
00624 *info = -3;
00625 } else if (*thresh < 0.) {
00626 *info = -6;
00627 } else if (*lda <= 1 || *lda < nmax) {
00628 *info = -9;
00629 } else if (*ldu <= 1 || *ldu < nmax) {
00630 *info = -14;
00631 } else if ((nmax << 2) * nmax + 2 > *nwork) {
00632 *info = -26;
00633 }
00634
00635 if (*info != 0) {
00636 i__1 = -(*info);
00637 xerbla_("ZCHKHS", &i__1);
00638 return 0;
00639 }
00640
00641
00642
00643 if (*nsizes == 0 || *ntypes == 0) {
00644 return 0;
00645 }
00646
00647
00648
00649 unfl = dlamch_("Safe minimum");
00650 ovfl = dlamch_("Overflow");
00651 dlabad_(&unfl, &ovfl);
00652 ulp = dlamch_("Epsilon") * dlamch_("Base");
00653 ulpinv = 1. / ulp;
00654 rtunfl = sqrt(unfl);
00655 rtovfl = sqrt(ovfl);
00656 rtulp = sqrt(ulp);
00657 rtulpi = 1. / rtulp;
00658
00659
00660
00661 nerrs = 0;
00662 nmats = 0;
00663
00664 i__1 = *nsizes;
00665 for (jsize = 1; jsize <= i__1; ++jsize) {
00666 n = nn[jsize];
00667 n1 = max(1,n);
00668 aninv = 1. / (doublereal) n1;
00669
00670 if (*nsizes != 1) {
00671 mtypes = min(21,*ntypes);
00672 } else {
00673 mtypes = min(22,*ntypes);
00674 }
00675
00676 i__2 = mtypes;
00677 for (jtype = 1; jtype <= i__2; ++jtype) {
00678 if (! dotype[jtype]) {
00679 goto L250;
00680 }
00681 ++nmats;
00682 ntest = 0;
00683
00684
00685
00686 for (j = 1; j <= 4; ++j) {
00687 ioldsd[j - 1] = iseed[j];
00688
00689 }
00690
00691
00692
00693 for (j = 1; j <= 14; ++j) {
00694 result[j] = 0.;
00695
00696 }
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707
00708
00709
00710
00711
00712
00713
00714 if (mtypes > 21) {
00715 goto L100;
00716 }
00717
00718 itype = ktype[jtype - 1];
00719 imode = kmode[jtype - 1];
00720
00721
00722
00723 switch (kmagn[jtype - 1]) {
00724 case 1: goto L40;
00725 case 2: goto L50;
00726 case 3: goto L60;
00727 }
00728
00729 L40:
00730 anorm = 1.;
00731 goto L70;
00732
00733 L50:
00734 anorm = rtovfl * ulp * aninv;
00735 goto L70;
00736
00737 L60:
00738 anorm = rtunfl * n * ulpinv;
00739 goto L70;
00740
00741 L70:
00742
00743 zlaset_("Full", lda, &n, &c_b1, &c_b1, &a[a_offset], lda);
00744 iinfo = 0;
00745 cond = ulpinv;
00746
00747
00748
00749 if (itype == 1) {
00750
00751
00752
00753 iinfo = 0;
00754 } else if (itype == 2) {
00755
00756
00757
00758 i__3 = n;
00759 for (jcol = 1; jcol <= i__3; ++jcol) {
00760 i__4 = jcol + jcol * a_dim1;
00761 a[i__4].r = anorm, a[i__4].i = 0.;
00762
00763 }
00764
00765 } else if (itype == 3) {
00766
00767
00768
00769 i__3 = n;
00770 for (jcol = 1; jcol <= i__3; ++jcol) {
00771 i__4 = jcol + jcol * a_dim1;
00772 a[i__4].r = anorm, a[i__4].i = 0.;
00773 if (jcol > 1) {
00774 i__4 = jcol + (jcol - 1) * a_dim1;
00775 a[i__4].r = 1., a[i__4].i = 0.;
00776 }
00777
00778 }
00779
00780 } else if (itype == 4) {
00781
00782
00783
00784 zlatmr_(&n, &n, "D", &iseed[1], "N", &work[1], &imode, &cond,
00785 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b27, &work[(
00786 n << 1) + 1], &c__1, &c_b27, "N", idumma, &c__0, &
00787 c__0, &c_b33, &anorm, "NO", &a[a_offset], lda, &iwork[
00788 1], &iinfo);
00789
00790 } else if (itype == 5) {
00791
00792
00793
00794 zlatms_(&n, &n, "D", &iseed[1], "H", &rwork[1], &imode, &cond,
00795 &anorm, &n, &n, "N", &a[a_offset], lda, &work[1], &
00796 iinfo);
00797
00798 } else if (itype == 6) {
00799
00800
00801
00802 if (kconds[jtype - 1] == 1) {
00803 conds = 1.;
00804 } else if (kconds[jtype - 1] == 2) {
00805 conds = rtulpi;
00806 } else {
00807 conds = 0.;
00808 }
00809
00810 zlatme_(&n, "D", &iseed[1], &work[1], &imode, &cond, &c_b2,
00811 " ", "T", "T", "T", &rwork[1], &c__4, &conds, &n, &n,
00812 &anorm, &a[a_offset], lda, &work[n + 1], &iinfo);
00813
00814 } else if (itype == 7) {
00815
00816
00817
00818 zlatmr_(&n, &n, "D", &iseed[1], "N", &work[1], &c__6, &c_b27,
00819 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b27, &work[(
00820 n << 1) + 1], &c__1, &c_b27, "N", idumma, &c__0, &
00821 c__0, &c_b33, &anorm, "NO", &a[a_offset], lda, &iwork[
00822 1], &iinfo);
00823
00824 } else if (itype == 8) {
00825
00826
00827
00828 zlatmr_(&n, &n, "D", &iseed[1], "H", &work[1], &c__6, &c_b27,
00829 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b27, &work[(
00830 n << 1) + 1], &c__1, &c_b27, "N", idumma, &n, &n, &
00831 c_b33, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00832 iinfo);
00833
00834 } else if (itype == 9) {
00835
00836
00837
00838 zlatmr_(&n, &n, "D", &iseed[1], "N", &work[1], &c__6, &c_b27,
00839 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b27, &work[(
00840 n << 1) + 1], &c__1, &c_b27, "N", idumma, &n, &n, &
00841 c_b33, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00842 iinfo);
00843
00844 } else if (itype == 10) {
00845
00846
00847
00848 zlatmr_(&n, &n, "D", &iseed[1], "N", &work[1], &c__6, &c_b27,
00849 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b27, &work[(
00850 n << 1) + 1], &c__1, &c_b27, "N", idumma, &n, &c__0, &
00851 c_b33, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00852 iinfo);
00853
00854 } else {
00855
00856 iinfo = 1;
00857 }
00858
00859 if (iinfo != 0) {
00860 io___35.ciunit = *nounit;
00861 s_wsfe(&io___35);
00862 do_fio(&c__1, "Generator", (ftnlen)9);
00863 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00864 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00865 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00866 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00867 e_wsfe();
00868 *info = abs(iinfo);
00869 return 0;
00870 }
00871
00872 L100:
00873
00874
00875
00876 zlacpy_(" ", &n, &n, &a[a_offset], lda, &h__[h_offset], lda);
00877 ntest = 1;
00878
00879 ilo = 1;
00880 ihi = n;
00881
00882 i__3 = *nwork - n;
00883 zgehrd_(&n, &ilo, &ihi, &h__[h_offset], lda, &work[1], &work[n +
00884 1], &i__3, &iinfo);
00885
00886 if (iinfo != 0) {
00887 result[1] = ulpinv;
00888 io___38.ciunit = *nounit;
00889 s_wsfe(&io___38);
00890 do_fio(&c__1, "ZGEHRD", (ftnlen)6);
00891 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00892 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00893 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00894 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00895 e_wsfe();
00896 *info = abs(iinfo);
00897 goto L240;
00898 }
00899
00900 i__3 = n - 1;
00901 for (j = 1; j <= i__3; ++j) {
00902 i__4 = j + 1 + j * uu_dim1;
00903 uu[i__4].r = 0., uu[i__4].i = 0.;
00904 i__4 = n;
00905 for (i__ = j + 2; i__ <= i__4; ++i__) {
00906 i__5 = i__ + j * u_dim1;
00907 i__6 = i__ + j * h_dim1;
00908 u[i__5].r = h__[i__6].r, u[i__5].i = h__[i__6].i;
00909 i__5 = i__ + j * uu_dim1;
00910 i__6 = i__ + j * h_dim1;
00911 uu[i__5].r = h__[i__6].r, uu[i__5].i = h__[i__6].i;
00912 i__5 = i__ + j * h_dim1;
00913 h__[i__5].r = 0., h__[i__5].i = 0.;
00914
00915 }
00916
00917 }
00918 i__3 = n - 1;
00919 zcopy_(&i__3, &work[1], &c__1, &tau[1], &c__1);
00920 i__3 = *nwork - n;
00921 zunghr_(&n, &ilo, &ihi, &u[u_offset], ldu, &work[1], &work[n + 1],
00922 &i__3, &iinfo);
00923 ntest = 2;
00924
00925 zhst01_(&n, &ilo, &ihi, &a[a_offset], lda, &h__[h_offset], lda, &
00926 u[u_offset], ldu, &work[1], nwork, &rwork[1], &result[1]);
00927
00928
00929
00930
00931
00932 zlacpy_(" ", &n, &n, &h__[h_offset], lda, &t2[t2_offset], lda);
00933 ntest = 3;
00934 result[3] = ulpinv;
00935
00936 zhseqr_("E", "N", &n, &ilo, &ihi, &t2[t2_offset], lda, &w3[1], &
00937 uz[uz_offset], ldu, &work[1], nwork, &iinfo);
00938 if (iinfo != 0) {
00939 io___40.ciunit = *nounit;
00940 s_wsfe(&io___40);
00941 do_fio(&c__1, "ZHSEQR(E)", (ftnlen)9);
00942 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00943 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00944 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00945 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00946 e_wsfe();
00947 if (iinfo <= n + 2) {
00948 *info = abs(iinfo);
00949 goto L240;
00950 }
00951 }
00952
00953
00954
00955 zlacpy_(" ", &n, &n, &h__[h_offset], lda, &t2[t2_offset], lda);
00956
00957 zhseqr_("S", "N", &n, &ilo, &ihi, &t2[t2_offset], lda, &w1[1], &
00958 uz[uz_offset], ldu, &work[1], nwork, &iinfo);
00959 if (iinfo != 0 && iinfo <= n + 2) {
00960 io___41.ciunit = *nounit;
00961 s_wsfe(&io___41);
00962 do_fio(&c__1, "ZHSEQR(S)", (ftnlen)9);
00963 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00964 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00965 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00966 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00967 e_wsfe();
00968 *info = abs(iinfo);
00969 goto L240;
00970 }
00971
00972
00973
00974 zlacpy_(" ", &n, &n, &h__[h_offset], lda, &t1[t1_offset], lda);
00975 zlacpy_(" ", &n, &n, &u[u_offset], ldu, &uz[uz_offset], ldu);
00976
00977 zhseqr_("S", "V", &n, &ilo, &ihi, &t1[t1_offset], lda, &w1[1], &
00978 uz[uz_offset], ldu, &work[1], nwork, &iinfo);
00979 if (iinfo != 0 && iinfo <= n + 2) {
00980 io___42.ciunit = *nounit;
00981 s_wsfe(&io___42);
00982 do_fio(&c__1, "ZHSEQR(V)", (ftnlen)9);
00983 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00984 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00985 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00986 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00987 e_wsfe();
00988 *info = abs(iinfo);
00989 goto L240;
00990 }
00991
00992
00993
00994 zgemm_("C", "N", &n, &n, &n, &c_b2, &u[u_offset], ldu, &uz[
00995 uz_offset], ldu, &c_b1, &z__[z_offset], ldu);
00996 ntest = 8;
00997
00998
00999
01000
01001 zhst01_(&n, &ilo, &ihi, &h__[h_offset], lda, &t1[t1_offset], lda,
01002 &z__[z_offset], ldu, &work[1], nwork, &rwork[1], &result[
01003 3]);
01004
01005
01006
01007
01008 zhst01_(&n, &ilo, &ihi, &a[a_offset], lda, &t1[t1_offset], lda, &
01009 uz[uz_offset], ldu, &work[1], nwork, &rwork[1], &result[5]
01010 );
01011
01012
01013
01014 zget10_(&n, &n, &t2[t2_offset], lda, &t1[t1_offset], lda, &work[1]
01015 , &rwork[1], &result[7]);
01016
01017
01018
01019 temp1 = 0.;
01020 temp2 = 0.;
01021 i__3 = n;
01022 for (j = 1; j <= i__3; ++j) {
01023
01024 d__1 = temp1, d__2 = z_abs(&w1[j]), d__1 = max(d__1,d__2),
01025 d__2 = z_abs(&w3[j]);
01026 temp1 = max(d__1,d__2);
01027
01028 i__4 = j;
01029 i__5 = j;
01030 z__1.r = w1[i__4].r - w3[i__5].r, z__1.i = w1[i__4].i - w3[
01031 i__5].i;
01032 d__1 = temp2, d__2 = z_abs(&z__1);
01033 temp2 = max(d__1,d__2);
01034
01035 }
01036
01037
01038 d__1 = unfl, d__2 = ulp * max(temp1,temp2);
01039 result[8] = temp2 / max(d__1,d__2);
01040
01041
01042
01043
01044
01045 ntest = 9;
01046 result[9] = ulpinv;
01047
01048
01049
01050 i__3 = n;
01051 for (j = 1; j <= i__3; ++j) {
01052 select[j] = FALSE_;
01053
01054 }
01055 i__3 = n;
01056 for (j = 1; j <= i__3; j += 2) {
01057 select[j] = TRUE_;
01058
01059 }
01060 ztrevc_("Right", "All", &select[1], &n, &t1[t1_offset], lda,
01061 cdumma, ldu, &evectr[evectr_offset], ldu, &n, &in, &work[
01062 1], &rwork[1], &iinfo);
01063 if (iinfo != 0) {
01064 io___47.ciunit = *nounit;
01065 s_wsfe(&io___47);
01066 do_fio(&c__1, "ZTREVC(R,A)", (ftnlen)11);
01067 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01068 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01069 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01070 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01071 e_wsfe();
01072 *info = abs(iinfo);
01073 goto L240;
01074 }
01075
01076
01077
01078 zget22_("N", "N", "N", &n, &t1[t1_offset], lda, &evectr[
01079 evectr_offset], ldu, &w1[1], &work[1], &rwork[1], dumma);
01080 result[9] = dumma[0];
01081 if (dumma[1] > *thresh) {
01082 io___49.ciunit = *nounit;
01083 s_wsfe(&io___49);
01084 do_fio(&c__1, "Right", (ftnlen)5);
01085 do_fio(&c__1, "ZTREVC", (ftnlen)6);
01086 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(doublereal));
01087 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01088 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01089 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01090 e_wsfe();
01091 }
01092
01093
01094
01095
01096 ztrevc_("Right", "Some", &select[1], &n, &t1[t1_offset], lda,
01097 cdumma, ldu, &evectl[evectl_offset], ldu, &n, &in, &work[
01098 1], &rwork[1], &iinfo);
01099 if (iinfo != 0) {
01100 io___50.ciunit = *nounit;
01101 s_wsfe(&io___50);
01102 do_fio(&c__1, "ZTREVC(R,S)", (ftnlen)11);
01103 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01104 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01105 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01106 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01107 e_wsfe();
01108 *info = abs(iinfo);
01109 goto L240;
01110 }
01111
01112 k = 1;
01113 match = TRUE_;
01114 i__3 = n;
01115 for (j = 1; j <= i__3; ++j) {
01116 if (select[j]) {
01117 i__4 = n;
01118 for (jj = 1; jj <= i__4; ++jj) {
01119 i__5 = jj + j * evectr_dim1;
01120 i__6 = jj + k * evectl_dim1;
01121 if (evectr[i__5].r != evectl[i__6].r || evectr[i__5]
01122 .i != evectl[i__6].i) {
01123 match = FALSE_;
01124 goto L180;
01125 }
01126
01127 }
01128 ++k;
01129 }
01130
01131 }
01132 L180:
01133 if (! match) {
01134 io___54.ciunit = *nounit;
01135 s_wsfe(&io___54);
01136 do_fio(&c__1, "Right", (ftnlen)5);
01137 do_fio(&c__1, "ZTREVC", (ftnlen)6);
01138 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01139 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01140 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01141 e_wsfe();
01142 }
01143
01144
01145
01146 ntest = 10;
01147 result[10] = ulpinv;
01148 ztrevc_("Left", "All", &select[1], &n, &t1[t1_offset], lda, &
01149 evectl[evectl_offset], ldu, cdumma, ldu, &n, &in, &work[1]
01150 , &rwork[1], &iinfo);
01151 if (iinfo != 0) {
01152 io___55.ciunit = *nounit;
01153 s_wsfe(&io___55);
01154 do_fio(&c__1, "ZTREVC(L,A)", (ftnlen)11);
01155 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01156 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01157 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01158 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01159 e_wsfe();
01160 *info = abs(iinfo);
01161 goto L240;
01162 }
01163
01164
01165
01166 zget22_("C", "N", "C", &n, &t1[t1_offset], lda, &evectl[
01167 evectl_offset], ldu, &w1[1], &work[1], &rwork[1], &dumma[
01168 2]);
01169 result[10] = dumma[2];
01170 if (dumma[3] > *thresh) {
01171 io___56.ciunit = *nounit;
01172 s_wsfe(&io___56);
01173 do_fio(&c__1, "Left", (ftnlen)4);
01174 do_fio(&c__1, "ZTREVC", (ftnlen)6);
01175 do_fio(&c__1, (char *)&dumma[3], (ftnlen)sizeof(doublereal));
01176 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01177 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01178 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01179 e_wsfe();
01180 }
01181
01182
01183
01184
01185 ztrevc_("Left", "Some", &select[1], &n, &t1[t1_offset], lda, &
01186 evectr[evectr_offset], ldu, cdumma, ldu, &n, &in, &work[1]
01187 , &rwork[1], &iinfo);
01188 if (iinfo != 0) {
01189 io___57.ciunit = *nounit;
01190 s_wsfe(&io___57);
01191 do_fio(&c__1, "ZTREVC(L,S)", (ftnlen)11);
01192 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01193 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01194 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01195 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01196 e_wsfe();
01197 *info = abs(iinfo);
01198 goto L240;
01199 }
01200
01201 k = 1;
01202 match = TRUE_;
01203 i__3 = n;
01204 for (j = 1; j <= i__3; ++j) {
01205 if (select[j]) {
01206 i__4 = n;
01207 for (jj = 1; jj <= i__4; ++jj) {
01208 i__5 = jj + j * evectl_dim1;
01209 i__6 = jj + k * evectr_dim1;
01210 if (evectl[i__5].r != evectr[i__6].r || evectl[i__5]
01211 .i != evectr[i__6].i) {
01212 match = FALSE_;
01213 goto L210;
01214 }
01215
01216 }
01217 ++k;
01218 }
01219
01220 }
01221 L210:
01222 if (! match) {
01223 io___58.ciunit = *nounit;
01224 s_wsfe(&io___58);
01225 do_fio(&c__1, "Left", (ftnlen)4);
01226 do_fio(&c__1, "ZTREVC", (ftnlen)6);
01227 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01228 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01229 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01230 e_wsfe();
01231 }
01232
01233
01234
01235 ntest = 11;
01236 result[11] = ulpinv;
01237 i__3 = n;
01238 for (j = 1; j <= i__3; ++j) {
01239 select[j] = TRUE_;
01240
01241 }
01242
01243 zhsein_("Right", "Qr", "Ninitv", &select[1], &n, &h__[h_offset],
01244 lda, &w3[1], cdumma, ldu, &evectx[evectx_offset], ldu, &
01245 n1, &in, &work[1], &rwork[1], &iwork[1], &iwork[1], &
01246 iinfo);
01247 if (iinfo != 0) {
01248 io___59.ciunit = *nounit;
01249 s_wsfe(&io___59);
01250 do_fio(&c__1, "ZHSEIN(R)", (ftnlen)9);
01251 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01252 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01253 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01254 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01255 e_wsfe();
01256 *info = abs(iinfo);
01257 if (iinfo < 0) {
01258 goto L240;
01259 }
01260 } else {
01261
01262
01263
01264
01265
01266 zget22_("N", "N", "N", &n, &h__[h_offset], lda, &evectx[
01267 evectx_offset], ldu, &w3[1], &work[1], &rwork[1],
01268 dumma);
01269 if (dumma[0] < ulpinv) {
01270 result[11] = dumma[0] * aninv;
01271 }
01272 if (dumma[1] > *thresh) {
01273 io___60.ciunit = *nounit;
01274 s_wsfe(&io___60);
01275 do_fio(&c__1, "Right", (ftnlen)5);
01276 do_fio(&c__1, "ZHSEIN", (ftnlen)6);
01277 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(
01278 doublereal));
01279 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01280 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01281 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01282 ;
01283 e_wsfe();
01284 }
01285 }
01286
01287
01288
01289 ntest = 12;
01290 result[12] = ulpinv;
01291 i__3 = n;
01292 for (j = 1; j <= i__3; ++j) {
01293 select[j] = TRUE_;
01294
01295 }
01296
01297 zhsein_("Left", "Qr", "Ninitv", &select[1], &n, &h__[h_offset],
01298 lda, &w3[1], &evecty[evecty_offset], ldu, cdumma, ldu, &
01299 n1, &in, &work[1], &rwork[1], &iwork[1], &iwork[1], &
01300 iinfo);
01301 if (iinfo != 0) {
01302 io___61.ciunit = *nounit;
01303 s_wsfe(&io___61);
01304 do_fio(&c__1, "ZHSEIN(L)", (ftnlen)9);
01305 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01306 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01307 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01308 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01309 e_wsfe();
01310 *info = abs(iinfo);
01311 if (iinfo < 0) {
01312 goto L240;
01313 }
01314 } else {
01315
01316
01317
01318
01319
01320 zget22_("C", "N", "C", &n, &h__[h_offset], lda, &evecty[
01321 evecty_offset], ldu, &w3[1], &work[1], &rwork[1], &
01322 dumma[2]);
01323 if (dumma[2] < ulpinv) {
01324 result[12] = dumma[2] * aninv;
01325 }
01326 if (dumma[3] > *thresh) {
01327 io___62.ciunit = *nounit;
01328 s_wsfe(&io___62);
01329 do_fio(&c__1, "Left", (ftnlen)4);
01330 do_fio(&c__1, "ZHSEIN", (ftnlen)6);
01331 do_fio(&c__1, (char *)&dumma[3], (ftnlen)sizeof(
01332 doublereal));
01333 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01334 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01335 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01336 ;
01337 e_wsfe();
01338 }
01339 }
01340
01341
01342
01343 ntest = 13;
01344 result[13] = ulpinv;
01345
01346 zunmhr_("Left", "No transpose", &n, &n, &ilo, &ihi, &uu[uu_offset]
01347 , ldu, &tau[1], &evectx[evectx_offset], ldu, &work[1],
01348 nwork, &iinfo);
01349 if (iinfo != 0) {
01350 io___63.ciunit = *nounit;
01351 s_wsfe(&io___63);
01352 do_fio(&c__1, "ZUNMHR(L)", (ftnlen)9);
01353 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01354 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01355 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01356 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01357 e_wsfe();
01358 *info = abs(iinfo);
01359 if (iinfo < 0) {
01360 goto L240;
01361 }
01362 } else {
01363
01364
01365
01366
01367
01368 zget22_("N", "N", "N", &n, &a[a_offset], lda, &evectx[
01369 evectx_offset], ldu, &w3[1], &work[1], &rwork[1],
01370 dumma);
01371 if (dumma[0] < ulpinv) {
01372 result[13] = dumma[0] * aninv;
01373 }
01374 }
01375
01376
01377
01378 ntest = 14;
01379 result[14] = ulpinv;
01380
01381 zunmhr_("Left", "No transpose", &n, &n, &ilo, &ihi, &uu[uu_offset]
01382 , ldu, &tau[1], &evecty[evecty_offset], ldu, &work[1],
01383 nwork, &iinfo);
01384 if (iinfo != 0) {
01385 io___64.ciunit = *nounit;
01386 s_wsfe(&io___64);
01387 do_fio(&c__1, "ZUNMHR(L)", (ftnlen)9);
01388 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01389 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01390 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01391 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01392 e_wsfe();
01393 *info = abs(iinfo);
01394 if (iinfo < 0) {
01395 goto L240;
01396 }
01397 } else {
01398
01399
01400
01401
01402
01403 zget22_("C", "N", "C", &n, &a[a_offset], lda, &evecty[
01404 evecty_offset], ldu, &w3[1], &work[1], &rwork[1], &
01405 dumma[2]);
01406 if (dumma[2] < ulpinv) {
01407 result[14] = dumma[2] * aninv;
01408 }
01409 }
01410
01411
01412
01413 L240:
01414
01415 ntestt += ntest;
01416 dlafts_("ZHS", &n, &n, &jtype, &ntest, &result[1], ioldsd, thresh,
01417 nounit, &nerrs);
01418
01419 L250:
01420 ;
01421 }
01422
01423 }
01424
01425
01426
01427 dlasum_("ZHS", nounit, &nerrs, &ntestt);
01428
01429 return 0;
01430
01431
01432
01433
01434 }