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 complex c_b1 = {0.f,0.f};
00019 static complex c_b2 = {1.f,0.f};
00020 static integer c__1 = 1;
00021 static real c_b27 = 1.f;
00022 static integer c__0 = 0;
00023 static real c_b33 = 0.f;
00024 static integer c__4 = 4;
00025 static integer c__6 = 6;
00026
00027 int cchkhs_(integer *nsizes, integer *nn, integer *ntypes,
00028 logical *dotype, integer *iseed, real *thresh, integer *nounit,
00029 complex *a, integer *lda, complex *h__, complex *t1, complex *t2,
00030 complex *u, integer *ldu, complex *z__, complex *uz, complex *w1,
00031 complex *w3, complex *evectl, complex *evectr, complex *evecty,
00032 complex *evectx, complex *uu, complex *tau, complex *work, integer *
00033 nwork, real *rwork, integer *iwork, logical *select, real *result,
00034 integer *info)
00035 {
00036
00037
00038 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 };
00039 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 };
00040 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 };
00041 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 };
00042
00043
00044 static char fmt_9999[] = "(\002 CCHKHS: \002,a,\002 returned INFO=\002,i"
00045 "6,\002.\002,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, ISEED="
00046 "(\002,3(i5,\002,\002),i5,\002)\002)";
00047 static char fmt_9998[] = "(\002 CCHKHS: \002,a,\002 Eigenvectors from"
00048 " \002,a,\002 incorrectly \002,\002normalized.\002,/\002 Bits of "
00049 "error=\002,0p,g10.3,\002,\002,9x,\002N=\002,i6,\002, JTYPE=\002,"
00050 "i6,\002, ISEED=(\002,3(i5,\002,\002),i5,\002)\002)";
00051 static char fmt_9997[] = "(\002 CCHKHS: Selected \002,a,\002 Eigenvector"
00052 "s from \002,a,\002 do not match other eigenvectors \002,9x,\002N="
00053 "\002,i6,\002, JTYPE=\002,i6,\002, ISEED=(\002,3(i5,\002,\002),i5,"
00054 "\002)\002)";
00055
00056
00057 integer a_dim1, a_offset, evectl_dim1, evectl_offset, evectr_dim1,
00058 evectr_offset, evectx_dim1, evectx_offset, evecty_dim1,
00059 evecty_offset, h_dim1, h_offset, t1_dim1, t1_offset, t2_dim1,
00060 t2_offset, u_dim1, u_offset, uu_dim1, uu_offset, uz_dim1,
00061 uz_offset, z_dim1, z_offset, i__1, i__2, i__3, i__4, i__5, i__6;
00062 real r__1, r__2;
00063 complex q__1;
00064
00065
00066 double sqrt(doublereal);
00067 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00068 double c_abs(complex *);
00069
00070
00071 integer i__, j, k, n, n1, jj, in, ihi, ilo;
00072 real ulp, cond;
00073 integer jcol, nmax;
00074 real unfl, ovfl, temp1, temp2;
00075 logical badnn;
00076 extern int cget10_(integer *, integer *, complex *,
00077 integer *, complex *, integer *, complex *, real *, real *),
00078 cget22_(char *, char *, char *, integer *, complex *, integer *,
00079 complex *, integer *, complex *, complex *, real *, real *), cgemm_(char *, char *, integer *,
00080 integer *, integer *, complex *, complex *, integer *, complex *,
00081 integer *, complex *, complex *, integer *);
00082 logical match;
00083 integer imode;
00084 extern int chst01_(integer *, integer *, integer *,
00085 complex *, integer *, complex *, integer *, complex *, integer *,
00086 complex *, integer *, real *, real *);
00087 real dumma[4];
00088 integer iinfo;
00089 real conds, aninv, anorm;
00090 extern int ccopy_(integer *, complex *, integer *,
00091 complex *, integer *);
00092 integer nmats, jsize, nerrs, itype, jtype, ntest;
00093 real rtulp;
00094 extern int slabad_(real *, real *), cgehrd_(integer *,
00095 integer *, integer *, complex *, integer *, complex *, complex *,
00096 integer *, integer *), clatme_(integer *, char *, integer *,
00097 complex *, integer *, real *, complex *, char *, char *, char *,
00098 char *, real *, integer *, real *, integer *, integer *, real *,
00099 complex *, integer *, complex *, integer *);
00100 complex cdumma[4];
00101 extern doublereal slamch_(char *);
00102 extern int chsein_(char *, char *, char *, logical *,
00103 integer *, complex *, integer *, complex *, complex *, integer *,
00104 complex *, integer *, integer *, integer *, complex *, real *,
00105 integer *, integer *, integer *), clacpy_(
00106 char *, integer *, integer *, complex *, integer *, complex *,
00107 integer *);
00108 integer idumma[1];
00109 extern int claset_(char *, integer *, integer *, complex
00110 *, complex *, complex *, integer *);
00111 integer ioldsd[4];
00112 extern int xerbla_(char *, integer *), clatmr_(
00113 integer *, integer *, char *, integer *, char *, complex *,
00114 integer *, real *, complex *, char *, char *, complex *, integer *
00115 , real *, complex *, integer *, real *, char *, integer *,
00116 integer *, integer *, real *, real *, char *, complex *, integer *
00117 , integer *, integer *), clatms_(integer *, integer *, char *, integer *, char *,
00118 real *, integer *, real *, real *, integer *, integer *, char *,
00119 complex *, integer *, complex *, integer *), chseqr_(char *, char *, integer *, integer *, integer *,
00120 complex *, integer *, complex *, complex *, integer *, complex *,
00121 integer *, integer *), ctrevc_(char *, char *,
00122 logical *, integer *, complex *, integer *, complex *, integer *,
00123 complex *, integer *, integer *, integer *, complex *, real *,
00124 integer *), cunghr_(integer *, integer *, integer
00125 *, complex *, integer *, complex *, complex *, integer *, integer
00126 *), cunmhr_(char *, char *, integer *, integer *, integer *,
00127 integer *, complex *, integer *, complex *, complex *, integer *,
00128 complex *, integer *, integer *), slafts_(char *,
00129 integer *, integer *, integer *, integer *, real *, integer *,
00130 real *, integer *, integer *), slasum_(char *, integer *,
00131 integer *, integer *);
00132 real rtunfl, rtovfl, rtulpi, ulpinv;
00133 integer mtypes, ntestt;
00134
00135
00136 static cilist io___35 = { 0, 0, 0, fmt_9999, 0 };
00137 static cilist io___38 = { 0, 0, 0, fmt_9999, 0 };
00138 static cilist io___40 = { 0, 0, 0, fmt_9999, 0 };
00139 static cilist io___41 = { 0, 0, 0, fmt_9999, 0 };
00140 static cilist io___42 = { 0, 0, 0, fmt_9999, 0 };
00141 static cilist io___47 = { 0, 0, 0, fmt_9999, 0 };
00142 static cilist io___49 = { 0, 0, 0, fmt_9998, 0 };
00143 static cilist io___50 = { 0, 0, 0, fmt_9999, 0 };
00144 static cilist io___54 = { 0, 0, 0, fmt_9997, 0 };
00145 static cilist io___55 = { 0, 0, 0, fmt_9999, 0 };
00146 static cilist io___56 = { 0, 0, 0, fmt_9998, 0 };
00147 static cilist io___57 = { 0, 0, 0, fmt_9999, 0 };
00148 static cilist io___58 = { 0, 0, 0, fmt_9997, 0 };
00149 static cilist io___59 = { 0, 0, 0, fmt_9999, 0 };
00150 static cilist io___60 = { 0, 0, 0, fmt_9998, 0 };
00151 static cilist io___61 = { 0, 0, 0, fmt_9999, 0 };
00152 static cilist io___62 = { 0, 0, 0, fmt_9998, 0 };
00153 static cilist io___63 = { 0, 0, 0, fmt_9999, 0 };
00154 static cilist io___64 = { 0, 0, 0, fmt_9999, 0 };
00155
00156
00157
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179
00180
00181
00182
00183
00184
00185
00186
00187
00188
00189
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00201
00202
00203
00204
00205
00206
00207
00208
00209
00210
00211
00212
00213
00214
00215
00216
00217
00218
00219
00220
00221
00222
00223
00224
00225
00226
00227
00228
00229
00230
00231
00232
00233
00234
00235
00236
00237
00238
00239
00240
00241
00242
00243
00244
00245
00246
00247
00248
00249
00250
00251
00252
00253
00254
00255
00256
00257
00258
00259
00260
00261
00262
00263
00264
00265
00266
00267
00268
00269
00270
00271
00272
00273
00274
00275
00276
00277
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294
00295
00296
00297
00298
00299
00300
00301
00302
00303
00304
00305
00306
00307
00308
00309
00310
00311
00312
00313
00314
00315
00316
00317
00318
00319
00320
00321
00322
00323
00324
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
00339
00340
00341
00342
00343
00344
00345
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 --nn;
00541 --dotype;
00542 --iseed;
00543 t2_dim1 = *lda;
00544 t2_offset = 1 + t2_dim1;
00545 t2 -= t2_offset;
00546 t1_dim1 = *lda;
00547 t1_offset = 1 + t1_dim1;
00548 t1 -= t1_offset;
00549 h_dim1 = *lda;
00550 h_offset = 1 + h_dim1;
00551 h__ -= h_offset;
00552 a_dim1 = *lda;
00553 a_offset = 1 + a_dim1;
00554 a -= a_offset;
00555 uu_dim1 = *ldu;
00556 uu_offset = 1 + uu_dim1;
00557 uu -= uu_offset;
00558 evectx_dim1 = *ldu;
00559 evectx_offset = 1 + evectx_dim1;
00560 evectx -= evectx_offset;
00561 evecty_dim1 = *ldu;
00562 evecty_offset = 1 + evecty_dim1;
00563 evecty -= evecty_offset;
00564 evectr_dim1 = *ldu;
00565 evectr_offset = 1 + evectr_dim1;
00566 evectr -= evectr_offset;
00567 evectl_dim1 = *ldu;
00568 evectl_offset = 1 + evectl_dim1;
00569 evectl -= evectl_offset;
00570 uz_dim1 = *ldu;
00571 uz_offset = 1 + uz_dim1;
00572 uz -= uz_offset;
00573 z_dim1 = *ldu;
00574 z_offset = 1 + z_dim1;
00575 z__ -= z_offset;
00576 u_dim1 = *ldu;
00577 u_offset = 1 + u_dim1;
00578 u -= u_offset;
00579 --w1;
00580 --w3;
00581 --tau;
00582 --work;
00583 --rwork;
00584 --iwork;
00585 --select;
00586 --result;
00587
00588
00589
00590
00591
00592
00593
00594 ntestt = 0;
00595 *info = 0;
00596
00597 badnn = FALSE_;
00598 nmax = 0;
00599 i__1 = *nsizes;
00600 for (j = 1; j <= i__1; ++j) {
00601
00602 i__2 = nmax, i__3 = nn[j];
00603 nmax = max(i__2,i__3);
00604 if (nn[j] < 0) {
00605 badnn = TRUE_;
00606 }
00607
00608 }
00609
00610
00611
00612 if (*nsizes < 0) {
00613 *info = -1;
00614 } else if (badnn) {
00615 *info = -2;
00616 } else if (*ntypes < 0) {
00617 *info = -3;
00618 } else if (*thresh < 0.f) {
00619 *info = -6;
00620 } else if (*lda <= 1 || *lda < nmax) {
00621 *info = -9;
00622 } else if (*ldu <= 1 || *ldu < nmax) {
00623 *info = -14;
00624 } else if ((nmax << 2) * nmax + 2 > *nwork) {
00625 *info = -26;
00626 }
00627
00628 if (*info != 0) {
00629 i__1 = -(*info);
00630 xerbla_("CCHKHS", &i__1);
00631 return 0;
00632 }
00633
00634
00635
00636 if (*nsizes == 0 || *ntypes == 0) {
00637 return 0;
00638 }
00639
00640
00641
00642 unfl = slamch_("Safe minimum");
00643 ovfl = slamch_("Overflow");
00644 slabad_(&unfl, &ovfl);
00645 ulp = slamch_("Epsilon") * slamch_("Base");
00646 ulpinv = 1.f / ulp;
00647 rtunfl = sqrt(unfl);
00648 rtovfl = sqrt(ovfl);
00649 rtulp = sqrt(ulp);
00650 rtulpi = 1.f / rtulp;
00651
00652
00653
00654 nerrs = 0;
00655 nmats = 0;
00656
00657 i__1 = *nsizes;
00658 for (jsize = 1; jsize <= i__1; ++jsize) {
00659 n = nn[jsize];
00660 n1 = max(1,n);
00661 aninv = 1.f / (real) n1;
00662
00663 if (*nsizes != 1) {
00664 mtypes = min(21,*ntypes);
00665 } else {
00666 mtypes = min(22,*ntypes);
00667 }
00668
00669 i__2 = mtypes;
00670 for (jtype = 1; jtype <= i__2; ++jtype) {
00671 if (! dotype[jtype]) {
00672 goto L250;
00673 }
00674 ++nmats;
00675 ntest = 0;
00676
00677
00678
00679 for (j = 1; j <= 4; ++j) {
00680 ioldsd[j - 1] = iseed[j];
00681
00682 }
00683
00684
00685
00686 for (j = 1; j <= 14; ++j) {
00687 result[j] = 0.f;
00688
00689 }
00690
00691
00692
00693
00694
00695
00696
00697
00698
00699
00700
00701
00702
00703
00704
00705
00706
00707 if (mtypes > 21) {
00708 goto L100;
00709 }
00710
00711 itype = ktype[jtype - 1];
00712 imode = kmode[jtype - 1];
00713
00714
00715
00716 switch (kmagn[jtype - 1]) {
00717 case 1: goto L40;
00718 case 2: goto L50;
00719 case 3: goto L60;
00720 }
00721
00722 L40:
00723 anorm = 1.f;
00724 goto L70;
00725
00726 L50:
00727 anorm = rtovfl * ulp * aninv;
00728 goto L70;
00729
00730 L60:
00731 anorm = rtunfl * n * ulpinv;
00732 goto L70;
00733
00734 L70:
00735
00736 claset_("Full", lda, &n, &c_b1, &c_b1, &a[a_offset], lda);
00737 iinfo = 0;
00738 cond = ulpinv;
00739
00740
00741
00742 if (itype == 1) {
00743
00744
00745
00746 iinfo = 0;
00747 } else if (itype == 2) {
00748
00749
00750
00751 i__3 = n;
00752 for (jcol = 1; jcol <= i__3; ++jcol) {
00753 i__4 = jcol + jcol * a_dim1;
00754 a[i__4].r = anorm, a[i__4].i = 0.f;
00755
00756 }
00757
00758 } else if (itype == 3) {
00759
00760
00761
00762 i__3 = n;
00763 for (jcol = 1; jcol <= i__3; ++jcol) {
00764 i__4 = jcol + jcol * a_dim1;
00765 a[i__4].r = anorm, a[i__4].i = 0.f;
00766 if (jcol > 1) {
00767 i__4 = jcol + (jcol - 1) * a_dim1;
00768 a[i__4].r = 1.f, a[i__4].i = 0.f;
00769 }
00770
00771 }
00772
00773 } else if (itype == 4) {
00774
00775
00776
00777 clatmr_(&n, &n, "D", &iseed[1], "N", &work[1], &imode, &cond,
00778 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b27, &work[(
00779 n << 1) + 1], &c__1, &c_b27, "N", idumma, &c__0, &
00780 c__0, &c_b33, &anorm, "NO", &a[a_offset], lda, &iwork[
00781 1], &iinfo);
00782
00783 } else if (itype == 5) {
00784
00785
00786
00787 clatms_(&n, &n, "D", &iseed[1], "H", &rwork[1], &imode, &cond,
00788 &anorm, &n, &n, "N", &a[a_offset], lda, &work[1], &
00789 iinfo);
00790
00791 } else if (itype == 6) {
00792
00793
00794
00795 if (kconds[jtype - 1] == 1) {
00796 conds = 1.f;
00797 } else if (kconds[jtype - 1] == 2) {
00798 conds = rtulpi;
00799 } else {
00800 conds = 0.f;
00801 }
00802
00803 clatme_(&n, "D", &iseed[1], &work[1], &imode, &cond, &c_b2,
00804 " ", "T", "T", "T", &rwork[1], &c__4, &conds, &n, &n,
00805 &anorm, &a[a_offset], lda, &work[n + 1], &iinfo);
00806
00807 } else if (itype == 7) {
00808
00809
00810
00811 clatmr_(&n, &n, "D", &iseed[1], "N", &work[1], &c__6, &c_b27,
00812 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b27, &work[(
00813 n << 1) + 1], &c__1, &c_b27, "N", idumma, &c__0, &
00814 c__0, &c_b33, &anorm, "NO", &a[a_offset], lda, &iwork[
00815 1], &iinfo);
00816
00817 } else if (itype == 8) {
00818
00819
00820
00821 clatmr_(&n, &n, "D", &iseed[1], "H", &work[1], &c__6, &c_b27,
00822 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b27, &work[(
00823 n << 1) + 1], &c__1, &c_b27, "N", idumma, &n, &n, &
00824 c_b33, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00825 iinfo);
00826
00827 } else if (itype == 9) {
00828
00829
00830
00831 clatmr_(&n, &n, "D", &iseed[1], "N", &work[1], &c__6, &c_b27,
00832 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b27, &work[(
00833 n << 1) + 1], &c__1, &c_b27, "N", idumma, &n, &n, &
00834 c_b33, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00835 iinfo);
00836
00837 } else if (itype == 10) {
00838
00839
00840
00841 clatmr_(&n, &n, "D", &iseed[1], "N", &work[1], &c__6, &c_b27,
00842 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b27, &work[(
00843 n << 1) + 1], &c__1, &c_b27, "N", idumma, &n, &c__0, &
00844 c_b33, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00845 iinfo);
00846
00847 } else {
00848
00849 iinfo = 1;
00850 }
00851
00852 if (iinfo != 0) {
00853 io___35.ciunit = *nounit;
00854 s_wsfe(&io___35);
00855 do_fio(&c__1, "Generator", (ftnlen)9);
00856 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00857 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00858 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00859 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00860 e_wsfe();
00861 *info = abs(iinfo);
00862 return 0;
00863 }
00864
00865 L100:
00866
00867
00868
00869 clacpy_(" ", &n, &n, &a[a_offset], lda, &h__[h_offset], lda);
00870 ntest = 1;
00871
00872 ilo = 1;
00873 ihi = n;
00874
00875 i__3 = *nwork - n;
00876 cgehrd_(&n, &ilo, &ihi, &h__[h_offset], lda, &work[1], &work[n +
00877 1], &i__3, &iinfo);
00878
00879 if (iinfo != 0) {
00880 result[1] = ulpinv;
00881 io___38.ciunit = *nounit;
00882 s_wsfe(&io___38);
00883 do_fio(&c__1, "CGEHRD", (ftnlen)6);
00884 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00885 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00886 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00887 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00888 e_wsfe();
00889 *info = abs(iinfo);
00890 goto L240;
00891 }
00892
00893 i__3 = n - 1;
00894 for (j = 1; j <= i__3; ++j) {
00895 i__4 = j + 1 + j * uu_dim1;
00896 uu[i__4].r = 0.f, uu[i__4].i = 0.f;
00897 i__4 = n;
00898 for (i__ = j + 2; i__ <= i__4; ++i__) {
00899 i__5 = i__ + j * u_dim1;
00900 i__6 = i__ + j * h_dim1;
00901 u[i__5].r = h__[i__6].r, u[i__5].i = h__[i__6].i;
00902 i__5 = i__ + j * uu_dim1;
00903 i__6 = i__ + j * h_dim1;
00904 uu[i__5].r = h__[i__6].r, uu[i__5].i = h__[i__6].i;
00905 i__5 = i__ + j * h_dim1;
00906 h__[i__5].r = 0.f, h__[i__5].i = 0.f;
00907
00908 }
00909
00910 }
00911 i__3 = n - 1;
00912 ccopy_(&i__3, &work[1], &c__1, &tau[1], &c__1);
00913 i__3 = *nwork - n;
00914 cunghr_(&n, &ilo, &ihi, &u[u_offset], ldu, &work[1], &work[n + 1],
00915 &i__3, &iinfo);
00916 ntest = 2;
00917
00918 chst01_(&n, &ilo, &ihi, &a[a_offset], lda, &h__[h_offset], lda, &
00919 u[u_offset], ldu, &work[1], nwork, &rwork[1], &result[1]);
00920
00921
00922
00923
00924
00925 clacpy_(" ", &n, &n, &h__[h_offset], lda, &t2[t2_offset], lda);
00926 ntest = 3;
00927 result[3] = ulpinv;
00928
00929 chseqr_("E", "N", &n, &ilo, &ihi, &t2[t2_offset], lda, &w3[1], &
00930 uz[uz_offset], ldu, &work[1], nwork, &iinfo);
00931 if (iinfo != 0) {
00932 io___40.ciunit = *nounit;
00933 s_wsfe(&io___40);
00934 do_fio(&c__1, "CHSEQR(E)", (ftnlen)9);
00935 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00936 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00937 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00938 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00939 e_wsfe();
00940 if (iinfo <= n + 2) {
00941 *info = abs(iinfo);
00942 goto L240;
00943 }
00944 }
00945
00946
00947
00948 clacpy_(" ", &n, &n, &h__[h_offset], lda, &t2[t2_offset], lda);
00949
00950 chseqr_("S", "N", &n, &ilo, &ihi, &t2[t2_offset], lda, &w1[1], &
00951 uz[uz_offset], ldu, &work[1], nwork, &iinfo);
00952 if (iinfo != 0 && iinfo <= n + 2) {
00953 io___41.ciunit = *nounit;
00954 s_wsfe(&io___41);
00955 do_fio(&c__1, "CHSEQR(S)", (ftnlen)9);
00956 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00957 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00958 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00959 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00960 e_wsfe();
00961 *info = abs(iinfo);
00962 goto L240;
00963 }
00964
00965
00966
00967 clacpy_(" ", &n, &n, &h__[h_offset], lda, &t1[t1_offset], lda);
00968 clacpy_(" ", &n, &n, &u[u_offset], ldu, &uz[uz_offset], ldu);
00969
00970 chseqr_("S", "V", &n, &ilo, &ihi, &t1[t1_offset], lda, &w1[1], &
00971 uz[uz_offset], ldu, &work[1], nwork, &iinfo);
00972 if (iinfo != 0 && iinfo <= n + 2) {
00973 io___42.ciunit = *nounit;
00974 s_wsfe(&io___42);
00975 do_fio(&c__1, "CHSEQR(V)", (ftnlen)9);
00976 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00977 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00978 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00979 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00980 e_wsfe();
00981 *info = abs(iinfo);
00982 goto L240;
00983 }
00984
00985
00986
00987 cgemm_("C", "N", &n, &n, &n, &c_b2, &u[u_offset], ldu, &uz[
00988 uz_offset], ldu, &c_b1, &z__[z_offset], ldu);
00989 ntest = 8;
00990
00991
00992
00993
00994 chst01_(&n, &ilo, &ihi, &h__[h_offset], lda, &t1[t1_offset], lda,
00995 &z__[z_offset], ldu, &work[1], nwork, &rwork[1], &result[
00996 3]);
00997
00998
00999
01000
01001 chst01_(&n, &ilo, &ihi, &a[a_offset], lda, &t1[t1_offset], lda, &
01002 uz[uz_offset], ldu, &work[1], nwork, &rwork[1], &result[5]
01003 );
01004
01005
01006
01007 cget10_(&n, &n, &t2[t2_offset], lda, &t1[t1_offset], lda, &work[1]
01008 , &rwork[1], &result[7]);
01009
01010
01011
01012 temp1 = 0.f;
01013 temp2 = 0.f;
01014 i__3 = n;
01015 for (j = 1; j <= i__3; ++j) {
01016
01017 r__1 = temp1, r__2 = c_abs(&w1[j]), r__1 = max(r__1,r__2),
01018 r__2 = c_abs(&w3[j]);
01019 temp1 = dmax(r__1,r__2);
01020
01021 i__4 = j;
01022 i__5 = j;
01023 q__1.r = w1[i__4].r - w3[i__5].r, q__1.i = w1[i__4].i - w3[
01024 i__5].i;
01025 r__1 = temp2, r__2 = c_abs(&q__1);
01026 temp2 = dmax(r__1,r__2);
01027
01028 }
01029
01030
01031 r__1 = unfl, r__2 = ulp * dmax(temp1,temp2);
01032 result[8] = temp2 / dmax(r__1,r__2);
01033
01034
01035
01036
01037
01038 ntest = 9;
01039 result[9] = ulpinv;
01040
01041
01042
01043 i__3 = n;
01044 for (j = 1; j <= i__3; ++j) {
01045 select[j] = FALSE_;
01046
01047 }
01048 i__3 = n;
01049 for (j = 1; j <= i__3; j += 2) {
01050 select[j] = TRUE_;
01051
01052 }
01053 ctrevc_("Right", "All", &select[1], &n, &t1[t1_offset], lda,
01054 cdumma, ldu, &evectr[evectr_offset], ldu, &n, &in, &work[
01055 1], &rwork[1], &iinfo);
01056 if (iinfo != 0) {
01057 io___47.ciunit = *nounit;
01058 s_wsfe(&io___47);
01059 do_fio(&c__1, "CTREVC(R,A)", (ftnlen)11);
01060 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01061 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01062 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01063 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01064 e_wsfe();
01065 *info = abs(iinfo);
01066 goto L240;
01067 }
01068
01069
01070
01071 cget22_("N", "N", "N", &n, &t1[t1_offset], lda, &evectr[
01072 evectr_offset], ldu, &w1[1], &work[1], &rwork[1], dumma);
01073 result[9] = dumma[0];
01074 if (dumma[1] > *thresh) {
01075 io___49.ciunit = *nounit;
01076 s_wsfe(&io___49);
01077 do_fio(&c__1, "Right", (ftnlen)5);
01078 do_fio(&c__1, "CTREVC", (ftnlen)6);
01079 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(real));
01080 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01081 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01082 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01083 e_wsfe();
01084 }
01085
01086
01087
01088
01089 ctrevc_("Right", "Some", &select[1], &n, &t1[t1_offset], lda,
01090 cdumma, ldu, &evectl[evectl_offset], ldu, &n, &in, &work[
01091 1], &rwork[1], &iinfo);
01092 if (iinfo != 0) {
01093 io___50.ciunit = *nounit;
01094 s_wsfe(&io___50);
01095 do_fio(&c__1, "CTREVC(R,S)", (ftnlen)11);
01096 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01097 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01098 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01099 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01100 e_wsfe();
01101 *info = abs(iinfo);
01102 goto L240;
01103 }
01104
01105 k = 1;
01106 match = TRUE_;
01107 i__3 = n;
01108 for (j = 1; j <= i__3; ++j) {
01109 if (select[j]) {
01110 i__4 = n;
01111 for (jj = 1; jj <= i__4; ++jj) {
01112 i__5 = jj + j * evectr_dim1;
01113 i__6 = jj + k * evectl_dim1;
01114 if (evectr[i__5].r != evectl[i__6].r || evectr[i__5]
01115 .i != evectl[i__6].i) {
01116 match = FALSE_;
01117 goto L180;
01118 }
01119
01120 }
01121 ++k;
01122 }
01123
01124 }
01125 L180:
01126 if (! match) {
01127 io___54.ciunit = *nounit;
01128 s_wsfe(&io___54);
01129 do_fio(&c__1, "Right", (ftnlen)5);
01130 do_fio(&c__1, "CTREVC", (ftnlen)6);
01131 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01132 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01133 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01134 e_wsfe();
01135 }
01136
01137
01138
01139 ntest = 10;
01140 result[10] = ulpinv;
01141 ctrevc_("Left", "All", &select[1], &n, &t1[t1_offset], lda, &
01142 evectl[evectl_offset], ldu, cdumma, ldu, &n, &in, &work[1]
01143 , &rwork[1], &iinfo);
01144 if (iinfo != 0) {
01145 io___55.ciunit = *nounit;
01146 s_wsfe(&io___55);
01147 do_fio(&c__1, "CTREVC(L,A)", (ftnlen)11);
01148 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01149 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01150 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01151 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01152 e_wsfe();
01153 *info = abs(iinfo);
01154 goto L240;
01155 }
01156
01157
01158
01159 cget22_("C", "N", "C", &n, &t1[t1_offset], lda, &evectl[
01160 evectl_offset], ldu, &w1[1], &work[1], &rwork[1], &dumma[
01161 2]);
01162 result[10] = dumma[2];
01163 if (dumma[3] > *thresh) {
01164 io___56.ciunit = *nounit;
01165 s_wsfe(&io___56);
01166 do_fio(&c__1, "Left", (ftnlen)4);
01167 do_fio(&c__1, "CTREVC", (ftnlen)6);
01168 do_fio(&c__1, (char *)&dumma[3], (ftnlen)sizeof(real));
01169 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01170 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01171 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01172 e_wsfe();
01173 }
01174
01175
01176
01177
01178 ctrevc_("Left", "Some", &select[1], &n, &t1[t1_offset], lda, &
01179 evectr[evectr_offset], ldu, cdumma, ldu, &n, &in, &work[1]
01180 , &rwork[1], &iinfo);
01181 if (iinfo != 0) {
01182 io___57.ciunit = *nounit;
01183 s_wsfe(&io___57);
01184 do_fio(&c__1, "CTREVC(L,S)", (ftnlen)11);
01185 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01186 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01187 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01188 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01189 e_wsfe();
01190 *info = abs(iinfo);
01191 goto L240;
01192 }
01193
01194 k = 1;
01195 match = TRUE_;
01196 i__3 = n;
01197 for (j = 1; j <= i__3; ++j) {
01198 if (select[j]) {
01199 i__4 = n;
01200 for (jj = 1; jj <= i__4; ++jj) {
01201 i__5 = jj + j * evectl_dim1;
01202 i__6 = jj + k * evectr_dim1;
01203 if (evectl[i__5].r != evectr[i__6].r || evectl[i__5]
01204 .i != evectr[i__6].i) {
01205 match = FALSE_;
01206 goto L210;
01207 }
01208
01209 }
01210 ++k;
01211 }
01212
01213 }
01214 L210:
01215 if (! match) {
01216 io___58.ciunit = *nounit;
01217 s_wsfe(&io___58);
01218 do_fio(&c__1, "Left", (ftnlen)4);
01219 do_fio(&c__1, "CTREVC", (ftnlen)6);
01220 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01221 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01222 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01223 e_wsfe();
01224 }
01225
01226
01227
01228 ntest = 11;
01229 result[11] = ulpinv;
01230 i__3 = n;
01231 for (j = 1; j <= i__3; ++j) {
01232 select[j] = TRUE_;
01233
01234 }
01235
01236 chsein_("Right", "Qr", "Ninitv", &select[1], &n, &h__[h_offset],
01237 lda, &w3[1], cdumma, ldu, &evectx[evectx_offset], ldu, &
01238 n1, &in, &work[1], &rwork[1], &iwork[1], &iwork[1], &
01239 iinfo);
01240 if (iinfo != 0) {
01241 io___59.ciunit = *nounit;
01242 s_wsfe(&io___59);
01243 do_fio(&c__1, "CHSEIN(R)", (ftnlen)9);
01244 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01245 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01246 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01247 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01248 e_wsfe();
01249 *info = abs(iinfo);
01250 if (iinfo < 0) {
01251 goto L240;
01252 }
01253 } else {
01254
01255
01256
01257
01258
01259 cget22_("N", "N", "N", &n, &h__[h_offset], lda, &evectx[
01260 evectx_offset], ldu, &w3[1], &work[1], &rwork[1],
01261 dumma);
01262 if (dumma[0] < ulpinv) {
01263 result[11] = dumma[0] * aninv;
01264 }
01265 if (dumma[1] > *thresh) {
01266 io___60.ciunit = *nounit;
01267 s_wsfe(&io___60);
01268 do_fio(&c__1, "Right", (ftnlen)5);
01269 do_fio(&c__1, "CHSEIN", (ftnlen)6);
01270 do_fio(&c__1, (char *)&dumma[1], (ftnlen)sizeof(real));
01271 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01272 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01273 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01274 ;
01275 e_wsfe();
01276 }
01277 }
01278
01279
01280
01281 ntest = 12;
01282 result[12] = ulpinv;
01283 i__3 = n;
01284 for (j = 1; j <= i__3; ++j) {
01285 select[j] = TRUE_;
01286
01287 }
01288
01289 chsein_("Left", "Qr", "Ninitv", &select[1], &n, &h__[h_offset],
01290 lda, &w3[1], &evecty[evecty_offset], ldu, cdumma, ldu, &
01291 n1, &in, &work[1], &rwork[1], &iwork[1], &iwork[1], &
01292 iinfo);
01293 if (iinfo != 0) {
01294 io___61.ciunit = *nounit;
01295 s_wsfe(&io___61);
01296 do_fio(&c__1, "CHSEIN(L)", (ftnlen)9);
01297 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01298 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01299 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01300 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01301 e_wsfe();
01302 *info = abs(iinfo);
01303 if (iinfo < 0) {
01304 goto L240;
01305 }
01306 } else {
01307
01308
01309
01310
01311
01312 cget22_("C", "N", "C", &n, &h__[h_offset], lda, &evecty[
01313 evecty_offset], ldu, &w3[1], &work[1], &rwork[1], &
01314 dumma[2]);
01315 if (dumma[2] < ulpinv) {
01316 result[12] = dumma[2] * aninv;
01317 }
01318 if (dumma[3] > *thresh) {
01319 io___62.ciunit = *nounit;
01320 s_wsfe(&io___62);
01321 do_fio(&c__1, "Left", (ftnlen)4);
01322 do_fio(&c__1, "CHSEIN", (ftnlen)6);
01323 do_fio(&c__1, (char *)&dumma[3], (ftnlen)sizeof(real));
01324 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01325 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01326 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01327 ;
01328 e_wsfe();
01329 }
01330 }
01331
01332
01333
01334 ntest = 13;
01335 result[13] = ulpinv;
01336
01337 cunmhr_("Left", "No transpose", &n, &n, &ilo, &ihi, &uu[uu_offset]
01338 , ldu, &tau[1], &evectx[evectx_offset], ldu, &work[1],
01339 nwork, &iinfo);
01340 if (iinfo != 0) {
01341 io___63.ciunit = *nounit;
01342 s_wsfe(&io___63);
01343 do_fio(&c__1, "CUNMHR(L)", (ftnlen)9);
01344 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01345 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01346 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01347 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01348 e_wsfe();
01349 *info = abs(iinfo);
01350 if (iinfo < 0) {
01351 goto L240;
01352 }
01353 } else {
01354
01355
01356
01357
01358
01359 cget22_("N", "N", "N", &n, &a[a_offset], lda, &evectx[
01360 evectx_offset], ldu, &w3[1], &work[1], &rwork[1],
01361 dumma);
01362 if (dumma[0] < ulpinv) {
01363 result[13] = dumma[0] * aninv;
01364 }
01365 }
01366
01367
01368
01369 ntest = 14;
01370 result[14] = ulpinv;
01371
01372 cunmhr_("Left", "No transpose", &n, &n, &ilo, &ihi, &uu[uu_offset]
01373 , ldu, &tau[1], &evecty[evecty_offset], ldu, &work[1],
01374 nwork, &iinfo);
01375 if (iinfo != 0) {
01376 io___64.ciunit = *nounit;
01377 s_wsfe(&io___64);
01378 do_fio(&c__1, "CUNMHR(L)", (ftnlen)9);
01379 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01380 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01381 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01382 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
01383 e_wsfe();
01384 *info = abs(iinfo);
01385 if (iinfo < 0) {
01386 goto L240;
01387 }
01388 } else {
01389
01390
01391
01392
01393
01394 cget22_("C", "N", "C", &n, &a[a_offset], lda, &evecty[
01395 evecty_offset], ldu, &w3[1], &work[1], &rwork[1], &
01396 dumma[2]);
01397 if (dumma[2] < ulpinv) {
01398 result[14] = dumma[2] * aninv;
01399 }
01400 }
01401
01402
01403
01404 L240:
01405
01406 ntestt += ntest;
01407 slafts_("CHS", &n, &n, &jtype, &ntest, &result[1], ioldsd, thresh,
01408 nounit, &nerrs);
01409
01410 L250:
01411 ;
01412 }
01413
01414 }
01415
01416
01417
01418 slasum_("CHS", nounit, &nerrs, &ntestt);
01419
01420 return 0;
01421
01422
01423
01424
01425 }