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__2 = 2;
00021 static integer c__0 = 0;
00022 static integer c__6 = 6;
00023 static doublereal c_b34 = 1.;
00024 static integer c__1 = 1;
00025 static doublereal c_b44 = 0.;
00026 static integer c__4 = 4;
00027 static integer c__3 = 3;
00028
00029 int zdrvst_(integer *nsizes, integer *nn, integer *ntypes,
00030 logical *dotype, integer *iseed, doublereal *thresh, integer *nounit,
00031 doublecomplex *a, integer *lda, doublereal *d1, doublereal *d2,
00032 doublereal *d3, doublereal *wa1, doublereal *wa2, doublereal *wa3,
00033 doublecomplex *u, integer *ldu, doublecomplex *v, doublecomplex *tau,
00034 doublecomplex *z__, doublecomplex *work, integer *lwork, doublereal *
00035 rwork, integer *lrwork, integer *iwork, integer *liwork, doublereal *
00036 result, integer *info)
00037 {
00038
00039
00040 static integer ktype[18] = { 1,2,4,4,4,4,4,5,5,5,5,5,8,8,8,9,9,9 };
00041 static integer kmagn[18] = { 1,1,1,1,1,2,3,1,1,1,2,3,1,2,3,1,2,3 };
00042 static integer kmode[18] = { 0,0,4,3,1,4,4,4,3,1,4,4,0,0,0,4,4,4 };
00043
00044
00045 static char fmt_9999[] = "(\002 ZDRVST: \002,a,\002 returned INFO=\002,i"
00046 "6,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, ISEED=(\002,3(i5"
00047 ",\002,\002),i5,\002)\002)";
00048 static char fmt_9998[] = "(\002 ZDRVST: \002,a,\002 returned INFO=\002,i"
00049 "6,/9x,\002N=\002,i6,\002, KD=\002,i6,\002, JTYPE=\002,i6,\002, I"
00050 "SEED=(\002,3(i5,\002,\002),i5,\002)\002)";
00051
00052
00053 address a__1[3];
00054 integer a_dim1, a_offset, u_dim1, u_offset, v_dim1, v_offset, z_dim1,
00055 z_offset, i__1, i__2, i__3, i__4, i__5, i__6, i__7[3];
00056 doublereal d__1, d__2, d__3, d__4;
00057 char ch__1[11], ch__2[13], ch__3[10];
00058
00059
00060 double sqrt(doublereal), log(doublereal);
00061 integer pow_ii(integer *, integer *), s_wsfe(cilist *), do_fio(integer *,
00062 char *, ftnlen), e_wsfe(void);
00063 int s_cat(char *, char **, integer *, integer *, ftnlen);
00064
00065
00066 integer i__, j, m, n, j1, j2, m2, m3, kd, il, iu;
00067 doublereal vl, vu;
00068 integer lgn;
00069 doublereal ulp, cond;
00070 integer jcol, ihbw, indx, nmax;
00071 doublereal unfl, ovfl;
00072 char uplo[1];
00073 integer irow;
00074 doublereal temp1, temp2, temp3;
00075 extern doublereal dsxt1_(integer *, doublereal *, integer *, doublereal *,
00076 integer *, doublereal *, doublereal *, doublereal *);
00077 integer idiag;
00078 logical badnn;
00079 integer imode, lwedc, iinfo;
00080 doublereal aninv, anorm;
00081 extern int zhet21_(integer *, char *, integer *, integer
00082 *, doublecomplex *, integer *, doublereal *, doublereal *,
00083 doublecomplex *, integer *, doublecomplex *, integer *,
00084 doublecomplex *, doublecomplex *, doublereal *, doublereal *);
00085 integer itemp;
00086 extern int zhbev_(char *, char *, integer *, integer *,
00087 doublecomplex *, integer *, doublereal *, doublecomplex *,
00088 integer *, doublecomplex *, doublereal *, integer *), zhet22_(integer *, char *, integer *, integer *, integer
00089 *, doublecomplex *, integer *, doublereal *, doublereal *,
00090 doublecomplex *, integer *, doublecomplex *, integer *,
00091 doublecomplex *, doublecomplex *, doublereal *, doublereal *), zheev_(char *, char *, integer *, doublecomplex *,
00092 integer *, doublereal *, doublecomplex *, integer *, doublereal *,
00093 integer *);
00094 integer nmats, jsize, iuplo, nerrs, itype, jtype, ntest;
00095 extern int zhpev_(char *, char *, integer *,
00096 doublecomplex *, doublereal *, doublecomplex *, integer *,
00097 doublecomplex *, doublereal *, integer *);
00098 integer iseed2[4], iseed3[4];
00099 extern int dlabad_(doublereal *, doublereal *);
00100 extern doublereal dlamch_(char *), dlarnd_(integer *, integer *);
00101 integer liwedc, 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 *);
00107 integer lrwedc;
00108 extern int zhbevd_(char *, char *, integer *, integer *,
00109 doublecomplex *, integer *, doublereal *, doublecomplex *,
00110 integer *, doublecomplex *, integer *, doublereal *, integer *,
00111 integer *, integer *, integer *), alasvm_(char *,
00112 integer *, integer *, integer *, integer *);
00113 doublereal abstol;
00114 extern int zheevd_(char *, char *, integer *,
00115 doublecomplex *, integer *, doublereal *, doublecomplex *,
00116 integer *, doublereal *, integer *, integer *, integer *, integer
00117 *);
00118 integer indwrk;
00119 extern int zhpevd_(char *, char *, integer *,
00120 doublecomplex *, doublereal *, doublecomplex *, integer *,
00121 doublecomplex *, integer *, doublereal *, integer *, integer *,
00122 integer *, integer *), zlacpy_(char *, integer *,
00123 integer *, doublecomplex *, integer *, doublecomplex *, integer *), zheevr_(char *, char *, char *, integer *,
00124 doublecomplex *, integer *, doublereal *, doublereal *, integer *,
00125 integer *, doublereal *, integer *, doublereal *, doublecomplex *
00126 , integer *, integer *, doublecomplex *, integer *, doublereal *,
00127 integer *, integer *, integer *, integer *), zlaset_(char *, integer *, integer *, doublecomplex *,
00128 doublecomplex *, doublecomplex *, integer *), zhbevx_(
00129 char *, char *, char *, integer *, integer *, doublecomplex *,
00130 integer *, doublecomplex *, integer *, doublereal *, doublereal *,
00131 integer *, integer *, doublereal *, integer *, doublereal *,
00132 doublecomplex *, integer *, doublecomplex *, doublereal *,
00133 integer *, integer *, integer *), zheevx_(
00134 char *, char *, char *, integer *, doublecomplex *, integer *,
00135 doublereal *, doublereal *, integer *, integer *, doublereal *,
00136 integer *, doublereal *, doublecomplex *, integer *,
00137 doublecomplex *, integer *, doublereal *, integer *, integer *,
00138 integer *);
00139 doublereal rtunfl, rtovfl, ulpinv;
00140 integer mtypes, ntestt;
00141 extern int zhpevx_(char *, char *, char *, integer *,
00142 doublecomplex *, doublereal *, doublereal *, integer *, integer *,
00143 doublereal *, integer *, doublereal *, doublecomplex *, integer *
00144 , doublecomplex *, doublereal *, integer *, integer *, integer *), zlatmr_(integer *, integer *, char *,
00145 integer *, char *, doublecomplex *, integer *, doublereal *,
00146 doublecomplex *, char *, char *, doublecomplex *, integer *,
00147 doublereal *, doublecomplex *, integer *, doublereal *, char *,
00148 integer *, integer *, integer *, doublereal *, doublereal *, char
00149 *, doublecomplex *, integer *, integer *, integer *), zlatms_(integer *,
00150 integer *, char *, integer *, char *, doublereal *, integer *,
00151 doublereal *, doublereal *, integer *, integer *, char *,
00152 doublecomplex *, integer *, doublecomplex *, integer *);
00153
00154
00155 static cilist io___42 = { 0, 0, 0, fmt_9999, 0 };
00156 static cilist io___49 = { 0, 0, 0, fmt_9999, 0 };
00157 static cilist io___50 = { 0, 0, 0, fmt_9999, 0 };
00158 static cilist io___57 = { 0, 0, 0, fmt_9999, 0 };
00159 static cilist io___59 = { 0, 0, 0, fmt_9999, 0 };
00160 static cilist io___60 = { 0, 0, 0, fmt_9999, 0 };
00161 static cilist io___62 = { 0, 0, 0, fmt_9999, 0 };
00162 static cilist io___63 = { 0, 0, 0, fmt_9999, 0 };
00163 static cilist io___64 = { 0, 0, 0, fmt_9999, 0 };
00164 static cilist io___67 = { 0, 0, 0, fmt_9999, 0 };
00165 static cilist io___68 = { 0, 0, 0, fmt_9999, 0 };
00166 static cilist io___69 = { 0, 0, 0, fmt_9999, 0 };
00167 static cilist io___70 = { 0, 0, 0, fmt_9999, 0 };
00168 static cilist io___71 = { 0, 0, 0, fmt_9999, 0 };
00169 static cilist io___72 = { 0, 0, 0, fmt_9999, 0 };
00170 static cilist io___73 = { 0, 0, 0, fmt_9999, 0 };
00171 static cilist io___74 = { 0, 0, 0, fmt_9999, 0 };
00172 static cilist io___76 = { 0, 0, 0, fmt_9998, 0 };
00173 static cilist io___77 = { 0, 0, 0, fmt_9998, 0 };
00174 static cilist io___78 = { 0, 0, 0, fmt_9999, 0 };
00175 static cilist io___79 = { 0, 0, 0, fmt_9998, 0 };
00176 static cilist io___80 = { 0, 0, 0, fmt_9998, 0 };
00177 static cilist io___81 = { 0, 0, 0, fmt_9998, 0 };
00178 static cilist io___82 = { 0, 0, 0, fmt_9998, 0 };
00179 static cilist io___83 = { 0, 0, 0, fmt_9998, 0 };
00180 static cilist io___84 = { 0, 0, 0, fmt_9999, 0 };
00181 static cilist io___85 = { 0, 0, 0, fmt_9999, 0 };
00182 static cilist io___86 = { 0, 0, 0, fmt_9999, 0 };
00183 static cilist io___87 = { 0, 0, 0, fmt_9999, 0 };
00184 static cilist io___88 = { 0, 0, 0, fmt_9998, 0 };
00185 static cilist io___89 = { 0, 0, 0, fmt_9998, 0 };
00186 static cilist io___90 = { 0, 0, 0, fmt_9999, 0 };
00187 static cilist io___91 = { 0, 0, 0, fmt_9999, 0 };
00188 static cilist io___92 = { 0, 0, 0, fmt_9999, 0 };
00189 static cilist io___93 = { 0, 0, 0, fmt_9999, 0 };
00190 static cilist io___94 = { 0, 0, 0, fmt_9999, 0 };
00191 static cilist io___95 = { 0, 0, 0, fmt_9999, 0 };
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 --nn;
00509 --dotype;
00510 --iseed;
00511 a_dim1 = *lda;
00512 a_offset = 1 + a_dim1;
00513 a -= a_offset;
00514 --d1;
00515 --d2;
00516 --d3;
00517 --wa1;
00518 --wa2;
00519 --wa3;
00520 z_dim1 = *ldu;
00521 z_offset = 1 + z_dim1;
00522 z__ -= z_offset;
00523 v_dim1 = *ldu;
00524 v_offset = 1 + v_dim1;
00525 v -= v_offset;
00526 u_dim1 = *ldu;
00527 u_offset = 1 + u_dim1;
00528 u -= u_offset;
00529 --tau;
00530 --work;
00531 --rwork;
00532 --iwork;
00533 --result;
00534
00535
00536
00537
00538
00539
00540
00541 ntestt = 0;
00542 *info = 0;
00543
00544 badnn = FALSE_;
00545 nmax = 1;
00546 i__1 = *nsizes;
00547 for (j = 1; j <= i__1; ++j) {
00548
00549 i__2 = nmax, i__3 = nn[j];
00550 nmax = max(i__2,i__3);
00551 if (nn[j] < 0) {
00552 badnn = TRUE_;
00553 }
00554
00555 }
00556
00557
00558
00559 if (*nsizes < 0) {
00560 *info = -1;
00561 } else if (badnn) {
00562 *info = -2;
00563 } else if (*ntypes < 0) {
00564 *info = -3;
00565 } else if (*lda < nmax) {
00566 *info = -9;
00567 } else if (*ldu < nmax) {
00568 *info = -16;
00569 } else {
00570
00571 i__1 = max(2,nmax);
00572 if (i__1 * i__1 << 1 > *lwork) {
00573 *info = -22;
00574 }
00575 }
00576
00577 if (*info != 0) {
00578 i__1 = -(*info);
00579 xerbla_("ZDRVST", &i__1);
00580 return 0;
00581 }
00582
00583
00584
00585 if (*nsizes == 0 || *ntypes == 0) {
00586 return 0;
00587 }
00588
00589
00590
00591 unfl = dlamch_("Safe minimum");
00592 ovfl = dlamch_("Overflow");
00593 dlabad_(&unfl, &ovfl);
00594 ulp = dlamch_("Epsilon") * dlamch_("Base");
00595 ulpinv = 1. / ulp;
00596 rtunfl = sqrt(unfl);
00597 rtovfl = sqrt(ovfl);
00598
00599
00600
00601 for (i__ = 1; i__ <= 4; ++i__) {
00602 iseed2[i__ - 1] = iseed[i__];
00603 iseed3[i__ - 1] = iseed[i__];
00604
00605 }
00606
00607 nerrs = 0;
00608 nmats = 0;
00609
00610 i__1 = *nsizes;
00611 for (jsize = 1; jsize <= i__1; ++jsize) {
00612 n = nn[jsize];
00613 if (n > 0) {
00614 lgn = (integer) (log((doublereal) n) / log(2.));
00615 if (pow_ii(&c__2, &lgn) < n) {
00616 ++lgn;
00617 }
00618 if (pow_ii(&c__2, &lgn) < n) {
00619 ++lgn;
00620 }
00621
00622 i__2 = (n << 1) + n * n, i__3 = (n << 1) * n;
00623 lwedc = max(i__2,i__3);
00624
00625 i__2 = n;
00626 lrwedc = (n << 2) + 1 + (n << 1) * lgn + i__2 * i__2 * 3;
00627 liwedc = n * 5 + 3;
00628 } else {
00629 lwedc = 2;
00630 lrwedc = 8;
00631 liwedc = 8;
00632 }
00633 aninv = 1. / (doublereal) max(1,n);
00634
00635 if (*nsizes != 1) {
00636 mtypes = min(18,*ntypes);
00637 } else {
00638 mtypes = min(19,*ntypes);
00639 }
00640
00641 i__2 = mtypes;
00642 for (jtype = 1; jtype <= i__2; ++jtype) {
00643 if (! dotype[jtype]) {
00644 goto L1210;
00645 }
00646 ++nmats;
00647 ntest = 0;
00648
00649 for (j = 1; j <= 4; ++j) {
00650 ioldsd[j - 1] = iseed[j];
00651
00652 }
00653
00654
00655
00656
00657
00658
00659
00660
00661
00662
00663
00664
00665
00666
00667
00668
00669 if (mtypes > 18) {
00670 goto L110;
00671 }
00672
00673 itype = ktype[jtype - 1];
00674 imode = kmode[jtype - 1];
00675
00676
00677
00678 switch (kmagn[jtype - 1]) {
00679 case 1: goto L40;
00680 case 2: goto L50;
00681 case 3: goto L60;
00682 }
00683
00684 L40:
00685 anorm = 1.;
00686 goto L70;
00687
00688 L50:
00689 anorm = rtovfl * ulp * aninv;
00690 goto L70;
00691
00692 L60:
00693 anorm = rtunfl * n * ulpinv;
00694 goto L70;
00695
00696 L70:
00697
00698 zlaset_("Full", lda, &n, &c_b1, &c_b1, &a[a_offset], lda);
00699 iinfo = 0;
00700 cond = ulpinv;
00701
00702
00703
00704
00705
00706 if (itype == 1) {
00707 iinfo = 0;
00708
00709 } else if (itype == 2) {
00710
00711
00712
00713 i__3 = n;
00714 for (jcol = 1; jcol <= i__3; ++jcol) {
00715 i__4 = jcol + jcol * a_dim1;
00716 a[i__4].r = anorm, a[i__4].i = 0.;
00717
00718 }
00719
00720 } else if (itype == 4) {
00721
00722
00723
00724 zlatms_(&n, &n, "S", &iseed[1], "H", &rwork[1], &imode, &cond,
00725 &anorm, &c__0, &c__0, "N", &a[a_offset], lda, &work[
00726 1], &iinfo);
00727
00728 } else if (itype == 5) {
00729
00730
00731
00732 zlatms_(&n, &n, "S", &iseed[1], "H", &rwork[1], &imode, &cond,
00733 &anorm, &n, &n, "N", &a[a_offset], lda, &work[1], &
00734 iinfo);
00735
00736 } else if (itype == 7) {
00737
00738
00739
00740 zlatmr_(&n, &n, "S", &iseed[1], "H", &work[1], &c__6, &c_b34,
00741 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b34, &work[(
00742 n << 1) + 1], &c__1, &c_b34, "N", idumma, &c__0, &
00743 c__0, &c_b44, &anorm, "NO", &a[a_offset], lda, &iwork[
00744 1], &iinfo);
00745
00746 } else if (itype == 8) {
00747
00748
00749
00750 zlatmr_(&n, &n, "S", &iseed[1], "H", &work[1], &c__6, &c_b34,
00751 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b34, &work[(
00752 n << 1) + 1], &c__1, &c_b34, "N", idumma, &n, &n, &
00753 c_b44, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00754 iinfo);
00755
00756 } else if (itype == 9) {
00757
00758
00759
00760 ihbw = (integer) ((n - 1) * dlarnd_(&c__1, iseed3));
00761 zlatms_(&n, &n, "S", &iseed[1], "H", &rwork[1], &imode, &cond,
00762 &anorm, &ihbw, &ihbw, "Z", &u[u_offset], ldu, &work[
00763 1], &iinfo);
00764
00765
00766
00767 zlaset_("Full", lda, &n, &c_b1, &c_b1, &a[a_offset], lda);
00768 i__3 = ihbw;
00769 for (idiag = -ihbw; idiag <= i__3; ++idiag) {
00770 irow = ihbw - idiag + 1;
00771
00772 i__4 = 1, i__5 = idiag + 1;
00773 j1 = max(i__4,i__5);
00774
00775 i__4 = n, i__5 = n + idiag;
00776 j2 = min(i__4,i__5);
00777 i__4 = j2;
00778 for (j = j1; j <= i__4; ++j) {
00779 i__ = j - idiag;
00780 i__5 = i__ + j * a_dim1;
00781 i__6 = irow + j * u_dim1;
00782 a[i__5].r = u[i__6].r, a[i__5].i = u[i__6].i;
00783
00784 }
00785
00786 }
00787 } else {
00788 iinfo = 1;
00789 }
00790
00791 if (iinfo != 0) {
00792 io___42.ciunit = *nounit;
00793 s_wsfe(&io___42);
00794 do_fio(&c__1, "Generator", (ftnlen)9);
00795 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00796 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00797 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00798 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00799 e_wsfe();
00800 *info = abs(iinfo);
00801 return 0;
00802 }
00803
00804 L110:
00805
00806 abstol = unfl + unfl;
00807 if (n <= 1) {
00808 il = 1;
00809 iu = n;
00810 } else {
00811 il = (integer) ((n - 1) * dlarnd_(&c__1, iseed2)) + 1;
00812 iu = (integer) ((n - 1) * dlarnd_(&c__1, iseed2)) + 1;
00813 if (il > iu) {
00814 itemp = il;
00815 il = iu;
00816 iu = itemp;
00817 }
00818 }
00819
00820
00821
00822
00823 for (iuplo = 0; iuplo <= 1; ++iuplo) {
00824 if (iuplo == 0) {
00825 *(unsigned char *)uplo = 'L';
00826 } else {
00827 *(unsigned char *)uplo = 'U';
00828 }
00829
00830
00831
00832 zlacpy_(" ", &n, &n, &a[a_offset], lda, &v[v_offset], ldu);
00833
00834 ++ntest;
00835 zheevd_("V", uplo, &n, &a[a_offset], ldu, &d1[1], &work[1], &
00836 lwedc, &rwork[1], &lrwedc, &iwork[1], &liwedc, &iinfo);
00837 if (iinfo != 0) {
00838 io___49.ciunit = *nounit;
00839 s_wsfe(&io___49);
00840
00841 i__7[0] = 9, a__1[0] = "ZHEEVD(V,";
00842 i__7[1] = 1, a__1[1] = uplo;
00843 i__7[2] = 1, a__1[2] = ")";
00844 s_cat(ch__1, a__1, i__7, &c__3, (ftnlen)11);
00845 do_fio(&c__1, ch__1, (ftnlen)11);
00846 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00847 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00848 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00849 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00850 ;
00851 e_wsfe();
00852 *info = abs(iinfo);
00853 if (iinfo < 0) {
00854 return 0;
00855 } else {
00856 result[ntest] = ulpinv;
00857 result[ntest + 1] = ulpinv;
00858 result[ntest + 2] = ulpinv;
00859 goto L130;
00860 }
00861 }
00862
00863
00864
00865 zhet21_(&c__1, uplo, &n, &c__0, &v[v_offset], ldu, &d1[1], &
00866 d2[1], &a[a_offset], ldu, &z__[z_offset], ldu, &tau[1]
00867 , &work[1], &rwork[1], &result[ntest]);
00868
00869 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
00870
00871 ntest += 2;
00872 zheevd_("N", uplo, &n, &a[a_offset], ldu, &d3[1], &work[1], &
00873 lwedc, &rwork[1], &lrwedc, &iwork[1], &liwedc, &iinfo);
00874 if (iinfo != 0) {
00875 io___50.ciunit = *nounit;
00876 s_wsfe(&io___50);
00877
00878 i__7[0] = 9, a__1[0] = "ZHEEVD(N,";
00879 i__7[1] = 1, a__1[1] = uplo;
00880 i__7[2] = 1, a__1[2] = ")";
00881 s_cat(ch__1, a__1, i__7, &c__3, (ftnlen)11);
00882 do_fio(&c__1, ch__1, (ftnlen)11);
00883 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00884 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00885 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00886 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00887 ;
00888 e_wsfe();
00889 *info = abs(iinfo);
00890 if (iinfo < 0) {
00891 return 0;
00892 } else {
00893 result[ntest] = ulpinv;
00894 goto L130;
00895 }
00896 }
00897
00898
00899
00900 temp1 = 0.;
00901 temp2 = 0.;
00902 i__3 = n;
00903 for (j = 1; j <= i__3; ++j) {
00904
00905 d__3 = temp1, d__4 = (d__1 = d1[j], abs(d__1)), d__3 =
00906 max(d__3,d__4), d__4 = (d__2 = d3[j], abs(d__2));
00907 temp1 = max(d__3,d__4);
00908
00909 d__2 = temp2, d__3 = (d__1 = d1[j] - d3[j], abs(d__1));
00910 temp2 = max(d__2,d__3);
00911
00912 }
00913
00914 d__1 = unfl, d__2 = ulp * max(temp1,temp2);
00915 result[ntest] = temp2 / max(d__1,d__2);
00916
00917 L130:
00918 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
00919
00920 ++ntest;
00921
00922 if (n > 0) {
00923
00924 d__2 = abs(d1[1]), d__3 = (d__1 = d1[n], abs(d__1));
00925 temp3 = max(d__2,d__3);
00926 if (il != 1) {
00927
00928 d__1 = (d1[il] - d1[il - 1]) * .5, d__2 = ulp * 10. *
00929 temp3, d__1 = max(d__1,d__2), d__2 = rtunfl *
00930 10.;
00931 vl = d1[il] - max(d__1,d__2);
00932 } else if (n > 0) {
00933
00934 d__1 = (d1[n] - d1[1]) * .5, d__2 = ulp * 10. * temp3,
00935 d__1 = max(d__1,d__2), d__2 = rtunfl * 10.;
00936 vl = d1[1] - max(d__1,d__2);
00937 }
00938 if (iu != n) {
00939
00940 d__1 = (d1[iu + 1] - d1[iu]) * .5, d__2 = ulp * 10. *
00941 temp3, d__1 = max(d__1,d__2), d__2 = rtunfl *
00942 10.;
00943 vu = d1[iu] + max(d__1,d__2);
00944 } else if (n > 0) {
00945
00946 d__1 = (d1[n] - d1[1]) * .5, d__2 = ulp * 10. * temp3,
00947 d__1 = max(d__1,d__2), d__2 = rtunfl * 10.;
00948 vu = d1[n] + max(d__1,d__2);
00949 }
00950 } else {
00951 temp3 = 0.;
00952 vl = 0.;
00953 vu = 1.;
00954 }
00955
00956 zheevx_("V", "A", uplo, &n, &a[a_offset], ldu, &vl, &vu, &il,
00957 &iu, &abstol, &m, &wa1[1], &z__[z_offset], ldu, &work[
00958 1], lwork, &rwork[1], &iwork[1], &iwork[n * 5 + 1], &
00959 iinfo);
00960 if (iinfo != 0) {
00961 io___57.ciunit = *nounit;
00962 s_wsfe(&io___57);
00963
00964 i__7[0] = 11, a__1[0] = "ZHEEVX(V,A,";
00965 i__7[1] = 1, a__1[1] = uplo;
00966 i__7[2] = 1, a__1[2] = ")";
00967 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
00968 do_fio(&c__1, ch__2, (ftnlen)13);
00969 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00970 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00971 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00972 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
00973 ;
00974 e_wsfe();
00975 *info = abs(iinfo);
00976 if (iinfo < 0) {
00977 return 0;
00978 } else {
00979 result[ntest] = ulpinv;
00980 result[ntest + 1] = ulpinv;
00981 result[ntest + 2] = ulpinv;
00982 goto L150;
00983 }
00984 }
00985
00986
00987
00988 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
00989
00990 zhet21_(&c__1, uplo, &n, &c__0, &a[a_offset], ldu, &wa1[1], &
00991 d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &tau[1]
00992 , &work[1], &rwork[1], &result[ntest]);
00993
00994 ntest += 2;
00995 zheevx_("N", "A", uplo, &n, &a[a_offset], ldu, &vl, &vu, &il,
00996 &iu, &abstol, &m2, &wa2[1], &z__[z_offset], ldu, &
00997 work[1], lwork, &rwork[1], &iwork[1], &iwork[n * 5 +
00998 1], &iinfo);
00999 if (iinfo != 0) {
01000 io___59.ciunit = *nounit;
01001 s_wsfe(&io___59);
01002
01003 i__7[0] = 11, a__1[0] = "ZHEEVX(N,A,";
01004 i__7[1] = 1, a__1[1] = uplo;
01005 i__7[2] = 1, a__1[2] = ")";
01006 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
01007 do_fio(&c__1, ch__2, (ftnlen)13);
01008 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01009 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01010 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01011 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01012 ;
01013 e_wsfe();
01014 *info = abs(iinfo);
01015 if (iinfo < 0) {
01016 return 0;
01017 } else {
01018 result[ntest] = ulpinv;
01019 goto L150;
01020 }
01021 }
01022
01023
01024
01025 temp1 = 0.;
01026 temp2 = 0.;
01027 i__3 = n;
01028 for (j = 1; j <= i__3; ++j) {
01029
01030 d__3 = temp1, d__4 = (d__1 = wa1[j], abs(d__1)), d__3 =
01031 max(d__3,d__4), d__4 = (d__2 = wa2[j], abs(d__2));
01032 temp1 = max(d__3,d__4);
01033
01034 d__2 = temp2, d__3 = (d__1 = wa1[j] - wa2[j], abs(d__1));
01035 temp2 = max(d__2,d__3);
01036
01037 }
01038
01039 d__1 = unfl, d__2 = ulp * max(temp1,temp2);
01040 result[ntest] = temp2 / max(d__1,d__2);
01041
01042 L150:
01043 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
01044
01045 ++ntest;
01046
01047 zheevx_("V", "I", uplo, &n, &a[a_offset], ldu, &vl, &vu, &il,
01048 &iu, &abstol, &m2, &wa2[1], &z__[z_offset], ldu, &
01049 work[1], lwork, &rwork[1], &iwork[1], &iwork[n * 5 +
01050 1], &iinfo);
01051 if (iinfo != 0) {
01052 io___60.ciunit = *nounit;
01053 s_wsfe(&io___60);
01054
01055 i__7[0] = 11, a__1[0] = "ZHEEVX(V,I,";
01056 i__7[1] = 1, a__1[1] = uplo;
01057 i__7[2] = 1, a__1[2] = ")";
01058 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
01059 do_fio(&c__1, ch__2, (ftnlen)13);
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 ;
01065 e_wsfe();
01066 *info = abs(iinfo);
01067 if (iinfo < 0) {
01068 return 0;
01069 } else {
01070 result[ntest] = ulpinv;
01071 goto L160;
01072 }
01073 }
01074
01075
01076
01077 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
01078
01079 zhet22_(&c__1, uplo, &n, &m2, &c__0, &a[a_offset], ldu, &wa2[
01080 1], &d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &
01081 tau[1], &work[1], &rwork[1], &result[ntest]);
01082
01083 ntest += 2;
01084
01085 zheevx_("N", "I", uplo, &n, &a[a_offset], ldu, &vl, &vu, &il,
01086 &iu, &abstol, &m3, &wa3[1], &z__[z_offset], ldu, &
01087 work[1], lwork, &rwork[1], &iwork[1], &iwork[n * 5 +
01088 1], &iinfo);
01089 if (iinfo != 0) {
01090 io___62.ciunit = *nounit;
01091 s_wsfe(&io___62);
01092
01093 i__7[0] = 11, a__1[0] = "ZHEEVX(N,I,";
01094 i__7[1] = 1, a__1[1] = uplo;
01095 i__7[2] = 1, a__1[2] = ")";
01096 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
01097 do_fio(&c__1, ch__2, (ftnlen)13);
01098 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01099 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01100 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01101 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01102 ;
01103 e_wsfe();
01104 *info = abs(iinfo);
01105 if (iinfo < 0) {
01106 return 0;
01107 } else {
01108 result[ntest] = ulpinv;
01109 goto L160;
01110 }
01111 }
01112
01113
01114
01115 temp1 = dsxt1_(&c__1, &wa2[1], &m2, &wa3[1], &m3, &abstol, &
01116 ulp, &unfl);
01117 temp2 = dsxt1_(&c__1, &wa3[1], &m3, &wa2[1], &m2, &abstol, &
01118 ulp, &unfl);
01119 if (n > 0) {
01120
01121 d__2 = abs(wa1[1]), d__3 = (d__1 = wa1[n], abs(d__1));
01122 temp3 = max(d__2,d__3);
01123 } else {
01124 temp3 = 0.;
01125 }
01126
01127 d__1 = unfl, d__2 = temp3 * ulp;
01128 result[ntest] = (temp1 + temp2) / max(d__1,d__2);
01129
01130 L160:
01131 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
01132
01133 ++ntest;
01134
01135 zheevx_("V", "V", uplo, &n, &a[a_offset], ldu, &vl, &vu, &il,
01136 &iu, &abstol, &m2, &wa2[1], &z__[z_offset], ldu, &
01137 work[1], lwork, &rwork[1], &iwork[1], &iwork[n * 5 +
01138 1], &iinfo);
01139 if (iinfo != 0) {
01140 io___63.ciunit = *nounit;
01141 s_wsfe(&io___63);
01142
01143 i__7[0] = 11, a__1[0] = "ZHEEVX(V,V,";
01144 i__7[1] = 1, a__1[1] = uplo;
01145 i__7[2] = 1, a__1[2] = ")";
01146 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
01147 do_fio(&c__1, ch__2, (ftnlen)13);
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 ;
01153 e_wsfe();
01154 *info = abs(iinfo);
01155 if (iinfo < 0) {
01156 return 0;
01157 } else {
01158 result[ntest] = ulpinv;
01159 goto L170;
01160 }
01161 }
01162
01163
01164
01165 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
01166
01167 zhet22_(&c__1, uplo, &n, &m2, &c__0, &a[a_offset], ldu, &wa2[
01168 1], &d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &
01169 tau[1], &work[1], &rwork[1], &result[ntest]);
01170
01171 ntest += 2;
01172
01173 zheevx_("N", "V", uplo, &n, &a[a_offset], ldu, &vl, &vu, &il,
01174 &iu, &abstol, &m3, &wa3[1], &z__[z_offset], ldu, &
01175 work[1], lwork, &rwork[1], &iwork[1], &iwork[n * 5 +
01176 1], &iinfo);
01177 if (iinfo != 0) {
01178 io___64.ciunit = *nounit;
01179 s_wsfe(&io___64);
01180
01181 i__7[0] = 11, a__1[0] = "ZHEEVX(N,V,";
01182 i__7[1] = 1, a__1[1] = uplo;
01183 i__7[2] = 1, a__1[2] = ")";
01184 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
01185 do_fio(&c__1, ch__2, (ftnlen)13);
01186 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01187 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01188 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01189 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01190 ;
01191 e_wsfe();
01192 *info = abs(iinfo);
01193 if (iinfo < 0) {
01194 return 0;
01195 } else {
01196 result[ntest] = ulpinv;
01197 goto L170;
01198 }
01199 }
01200
01201 if (m3 == 0 && n > 0) {
01202 result[ntest] = ulpinv;
01203 goto L170;
01204 }
01205
01206
01207
01208 temp1 = dsxt1_(&c__1, &wa2[1], &m2, &wa3[1], &m3, &abstol, &
01209 ulp, &unfl);
01210 temp2 = dsxt1_(&c__1, &wa3[1], &m3, &wa2[1], &m2, &abstol, &
01211 ulp, &unfl);
01212 if (n > 0) {
01213
01214 d__2 = abs(wa1[1]), d__3 = (d__1 = wa1[n], abs(d__1));
01215 temp3 = max(d__2,d__3);
01216 } else {
01217 temp3 = 0.;
01218 }
01219
01220 d__1 = unfl, d__2 = temp3 * ulp;
01221 result[ntest] = (temp1 + temp2) / max(d__1,d__2);
01222
01223 L170:
01224
01225
01226
01227 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
01228
01229
01230
01231
01232 if (iuplo == 1) {
01233 indx = 1;
01234 i__3 = n;
01235 for (j = 1; j <= i__3; ++j) {
01236 i__4 = j;
01237 for (i__ = 1; i__ <= i__4; ++i__) {
01238 i__5 = indx;
01239 i__6 = i__ + j * a_dim1;
01240 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01241 .i;
01242 ++indx;
01243
01244 }
01245
01246 }
01247 } else {
01248 indx = 1;
01249 i__3 = n;
01250 for (j = 1; j <= i__3; ++j) {
01251 i__4 = n;
01252 for (i__ = j; i__ <= i__4; ++i__) {
01253 i__5 = indx;
01254 i__6 = i__ + j * a_dim1;
01255 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01256 .i;
01257 ++indx;
01258
01259 }
01260
01261 }
01262 }
01263
01264 ++ntest;
01265 indwrk = n * (n + 1) / 2 + 1;
01266 zhpevd_("V", uplo, &n, &work[1], &d1[1], &z__[z_offset], ldu,
01267 &work[indwrk], &lwedc, &rwork[1], &lrwedc, &iwork[1],
01268 &liwedc, &iinfo);
01269 if (iinfo != 0) {
01270 io___67.ciunit = *nounit;
01271 s_wsfe(&io___67);
01272
01273 i__7[0] = 9, a__1[0] = "ZHPEVD(V,";
01274 i__7[1] = 1, a__1[1] = uplo;
01275 i__7[2] = 1, a__1[2] = ")";
01276 s_cat(ch__1, a__1, i__7, &c__3, (ftnlen)11);
01277 do_fio(&c__1, ch__1, (ftnlen)11);
01278 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
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 *info = abs(iinfo);
01285 if (iinfo < 0) {
01286 return 0;
01287 } else {
01288 result[ntest] = ulpinv;
01289 result[ntest + 1] = ulpinv;
01290 result[ntest + 2] = ulpinv;
01291 goto L270;
01292 }
01293 }
01294
01295
01296
01297 zhet21_(&c__1, uplo, &n, &c__0, &a[a_offset], lda, &d1[1], &
01298 d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &tau[1]
01299 , &work[1], &rwork[1], &result[ntest]);
01300
01301 if (iuplo == 1) {
01302 indx = 1;
01303 i__3 = n;
01304 for (j = 1; j <= i__3; ++j) {
01305 i__4 = j;
01306 for (i__ = 1; i__ <= i__4; ++i__) {
01307 i__5 = indx;
01308 i__6 = i__ + j * a_dim1;
01309 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01310 .i;
01311 ++indx;
01312
01313 }
01314
01315 }
01316 } else {
01317 indx = 1;
01318 i__3 = n;
01319 for (j = 1; j <= i__3; ++j) {
01320 i__4 = n;
01321 for (i__ = j; i__ <= i__4; ++i__) {
01322 i__5 = indx;
01323 i__6 = i__ + j * a_dim1;
01324 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01325 .i;
01326 ++indx;
01327
01328 }
01329
01330 }
01331 }
01332
01333 ntest += 2;
01334 indwrk = n * (n + 1) / 2 + 1;
01335 zhpevd_("N", uplo, &n, &work[1], &d3[1], &z__[z_offset], ldu,
01336 &work[indwrk], &lwedc, &rwork[1], &lrwedc, &iwork[1],
01337 &liwedc, &iinfo);
01338 if (iinfo != 0) {
01339 io___68.ciunit = *nounit;
01340 s_wsfe(&io___68);
01341
01342 i__7[0] = 9, a__1[0] = "ZHPEVD(N,";
01343 i__7[1] = 1, a__1[1] = uplo;
01344 i__7[2] = 1, a__1[2] = ")";
01345 s_cat(ch__1, a__1, i__7, &c__3, (ftnlen)11);
01346 do_fio(&c__1, ch__1, (ftnlen)11);
01347 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01348 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01349 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01350 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01351 ;
01352 e_wsfe();
01353 *info = abs(iinfo);
01354 if (iinfo < 0) {
01355 return 0;
01356 } else {
01357 result[ntest] = ulpinv;
01358 goto L270;
01359 }
01360 }
01361
01362
01363
01364 temp1 = 0.;
01365 temp2 = 0.;
01366 i__3 = n;
01367 for (j = 1; j <= i__3; ++j) {
01368
01369 d__3 = temp1, d__4 = (d__1 = d1[j], abs(d__1)), d__3 =
01370 max(d__3,d__4), d__4 = (d__2 = d3[j], abs(d__2));
01371 temp1 = max(d__3,d__4);
01372
01373 d__2 = temp2, d__3 = (d__1 = d1[j] - d3[j], abs(d__1));
01374 temp2 = max(d__2,d__3);
01375
01376 }
01377
01378 d__1 = unfl, d__2 = ulp * max(temp1,temp2);
01379 result[ntest] = temp2 / max(d__1,d__2);
01380
01381
01382
01383
01384 L270:
01385 if (iuplo == 1) {
01386 indx = 1;
01387 i__3 = n;
01388 for (j = 1; j <= i__3; ++j) {
01389 i__4 = j;
01390 for (i__ = 1; i__ <= i__4; ++i__) {
01391 i__5 = indx;
01392 i__6 = i__ + j * a_dim1;
01393 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01394 .i;
01395 ++indx;
01396
01397 }
01398
01399 }
01400 } else {
01401 indx = 1;
01402 i__3 = n;
01403 for (j = 1; j <= i__3; ++j) {
01404 i__4 = n;
01405 for (i__ = j; i__ <= i__4; ++i__) {
01406 i__5 = indx;
01407 i__6 = i__ + j * a_dim1;
01408 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01409 .i;
01410 ++indx;
01411
01412 }
01413
01414 }
01415 }
01416
01417 ++ntest;
01418
01419 if (n > 0) {
01420
01421 d__2 = abs(d1[1]), d__3 = (d__1 = d1[n], abs(d__1));
01422 temp3 = max(d__2,d__3);
01423 if (il != 1) {
01424
01425 d__1 = (d1[il] - d1[il - 1]) * .5, d__2 = ulp * 10. *
01426 temp3, d__1 = max(d__1,d__2), d__2 = rtunfl *
01427 10.;
01428 vl = d1[il] - max(d__1,d__2);
01429 } else if (n > 0) {
01430
01431 d__1 = (d1[n] - d1[1]) * .5, d__2 = ulp * 10. * temp3,
01432 d__1 = max(d__1,d__2), d__2 = rtunfl * 10.;
01433 vl = d1[1] - max(d__1,d__2);
01434 }
01435 if (iu != n) {
01436
01437 d__1 = (d1[iu + 1] - d1[iu]) * .5, d__2 = ulp * 10. *
01438 temp3, d__1 = max(d__1,d__2), d__2 = rtunfl *
01439 10.;
01440 vu = d1[iu] + max(d__1,d__2);
01441 } else if (n > 0) {
01442
01443 d__1 = (d1[n] - d1[1]) * .5, d__2 = ulp * 10. * temp3,
01444 d__1 = max(d__1,d__2), d__2 = rtunfl * 10.;
01445 vu = d1[n] + max(d__1,d__2);
01446 }
01447 } else {
01448 temp3 = 0.;
01449 vl = 0.;
01450 vu = 1.;
01451 }
01452
01453 zhpevx_("V", "A", uplo, &n, &work[1], &vl, &vu, &il, &iu, &
01454 abstol, &m, &wa1[1], &z__[z_offset], ldu, &v[v_offset]
01455 , &rwork[1], &iwork[1], &iwork[n * 5 + 1], &iinfo);
01456 if (iinfo != 0) {
01457 io___69.ciunit = *nounit;
01458 s_wsfe(&io___69);
01459
01460 i__7[0] = 11, a__1[0] = "ZHPEVX(V,A,";
01461 i__7[1] = 1, a__1[1] = uplo;
01462 i__7[2] = 1, a__1[2] = ")";
01463 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
01464 do_fio(&c__1, ch__2, (ftnlen)13);
01465 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01466 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01467 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01468 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01469 ;
01470 e_wsfe();
01471 *info = abs(iinfo);
01472 if (iinfo < 0) {
01473 return 0;
01474 } else {
01475 result[ntest] = ulpinv;
01476 result[ntest + 1] = ulpinv;
01477 result[ntest + 2] = ulpinv;
01478 goto L370;
01479 }
01480 }
01481
01482
01483
01484 zhet21_(&c__1, uplo, &n, &c__0, &a[a_offset], ldu, &wa1[1], &
01485 d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &tau[1]
01486 , &work[1], &rwork[1], &result[ntest]);
01487
01488 ntest += 2;
01489
01490 if (iuplo == 1) {
01491 indx = 1;
01492 i__3 = n;
01493 for (j = 1; j <= i__3; ++j) {
01494 i__4 = j;
01495 for (i__ = 1; i__ <= i__4; ++i__) {
01496 i__5 = indx;
01497 i__6 = i__ + j * a_dim1;
01498 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01499 .i;
01500 ++indx;
01501
01502 }
01503
01504 }
01505 } else {
01506 indx = 1;
01507 i__3 = n;
01508 for (j = 1; j <= i__3; ++j) {
01509 i__4 = n;
01510 for (i__ = j; i__ <= i__4; ++i__) {
01511 i__5 = indx;
01512 i__6 = i__ + j * a_dim1;
01513 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01514 .i;
01515 ++indx;
01516
01517 }
01518
01519 }
01520 }
01521
01522 zhpevx_("N", "A", uplo, &n, &work[1], &vl, &vu, &il, &iu, &
01523 abstol, &m2, &wa2[1], &z__[z_offset], ldu, &v[
01524 v_offset], &rwork[1], &iwork[1], &iwork[n * 5 + 1], &
01525 iinfo);
01526 if (iinfo != 0) {
01527 io___70.ciunit = *nounit;
01528 s_wsfe(&io___70);
01529
01530 i__7[0] = 11, a__1[0] = "ZHPEVX(N,A,";
01531 i__7[1] = 1, a__1[1] = uplo;
01532 i__7[2] = 1, a__1[2] = ")";
01533 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
01534 do_fio(&c__1, ch__2, (ftnlen)13);
01535 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01536 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01537 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01538 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01539 ;
01540 e_wsfe();
01541 *info = abs(iinfo);
01542 if (iinfo < 0) {
01543 return 0;
01544 } else {
01545 result[ntest] = ulpinv;
01546 goto L370;
01547 }
01548 }
01549
01550
01551
01552 temp1 = 0.;
01553 temp2 = 0.;
01554 i__3 = n;
01555 for (j = 1; j <= i__3; ++j) {
01556
01557 d__3 = temp1, d__4 = (d__1 = wa1[j], abs(d__1)), d__3 =
01558 max(d__3,d__4), d__4 = (d__2 = wa2[j], abs(d__2));
01559 temp1 = max(d__3,d__4);
01560
01561 d__2 = temp2, d__3 = (d__1 = wa1[j] - wa2[j], abs(d__1));
01562 temp2 = max(d__2,d__3);
01563
01564 }
01565
01566 d__1 = unfl, d__2 = ulp * max(temp1,temp2);
01567 result[ntest] = temp2 / max(d__1,d__2);
01568
01569 L370:
01570 ++ntest;
01571 if (iuplo == 1) {
01572 indx = 1;
01573 i__3 = n;
01574 for (j = 1; j <= i__3; ++j) {
01575 i__4 = j;
01576 for (i__ = 1; i__ <= i__4; ++i__) {
01577 i__5 = indx;
01578 i__6 = i__ + j * a_dim1;
01579 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01580 .i;
01581 ++indx;
01582
01583 }
01584
01585 }
01586 } else {
01587 indx = 1;
01588 i__3 = n;
01589 for (j = 1; j <= i__3; ++j) {
01590 i__4 = n;
01591 for (i__ = j; i__ <= i__4; ++i__) {
01592 i__5 = indx;
01593 i__6 = i__ + j * a_dim1;
01594 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01595 .i;
01596 ++indx;
01597
01598 }
01599
01600 }
01601 }
01602
01603 zhpevx_("V", "I", uplo, &n, &work[1], &vl, &vu, &il, &iu, &
01604 abstol, &m2, &wa2[1], &z__[z_offset], ldu, &v[
01605 v_offset], &rwork[1], &iwork[1], &iwork[n * 5 + 1], &
01606 iinfo);
01607 if (iinfo != 0) {
01608 io___71.ciunit = *nounit;
01609 s_wsfe(&io___71);
01610
01611 i__7[0] = 11, a__1[0] = "ZHPEVX(V,I,";
01612 i__7[1] = 1, a__1[1] = uplo;
01613 i__7[2] = 1, a__1[2] = ")";
01614 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
01615 do_fio(&c__1, ch__2, (ftnlen)13);
01616 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01617 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01618 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01619 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01620 ;
01621 e_wsfe();
01622 *info = abs(iinfo);
01623 if (iinfo < 0) {
01624 return 0;
01625 } else {
01626 result[ntest] = ulpinv;
01627 result[ntest + 1] = ulpinv;
01628 result[ntest + 2] = ulpinv;
01629 goto L460;
01630 }
01631 }
01632
01633
01634
01635 zhet22_(&c__1, uplo, &n, &m2, &c__0, &a[a_offset], ldu, &wa2[
01636 1], &d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &
01637 tau[1], &work[1], &rwork[1], &result[ntest]);
01638
01639 ntest += 2;
01640
01641 if (iuplo == 1) {
01642 indx = 1;
01643 i__3 = n;
01644 for (j = 1; j <= i__3; ++j) {
01645 i__4 = j;
01646 for (i__ = 1; i__ <= i__4; ++i__) {
01647 i__5 = indx;
01648 i__6 = i__ + j * a_dim1;
01649 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01650 .i;
01651 ++indx;
01652
01653 }
01654
01655 }
01656 } else {
01657 indx = 1;
01658 i__3 = n;
01659 for (j = 1; j <= i__3; ++j) {
01660 i__4 = n;
01661 for (i__ = j; i__ <= i__4; ++i__) {
01662 i__5 = indx;
01663 i__6 = i__ + j * a_dim1;
01664 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01665 .i;
01666 ++indx;
01667
01668 }
01669
01670 }
01671 }
01672
01673 zhpevx_("N", "I", uplo, &n, &work[1], &vl, &vu, &il, &iu, &
01674 abstol, &m3, &wa3[1], &z__[z_offset], ldu, &v[
01675 v_offset], &rwork[1], &iwork[1], &iwork[n * 5 + 1], &
01676 iinfo);
01677 if (iinfo != 0) {
01678 io___72.ciunit = *nounit;
01679 s_wsfe(&io___72);
01680
01681 i__7[0] = 11, a__1[0] = "ZHPEVX(N,I,";
01682 i__7[1] = 1, a__1[1] = uplo;
01683 i__7[2] = 1, a__1[2] = ")";
01684 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
01685 do_fio(&c__1, ch__2, (ftnlen)13);
01686 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01687 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01688 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01689 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01690 ;
01691 e_wsfe();
01692 *info = abs(iinfo);
01693 if (iinfo < 0) {
01694 return 0;
01695 } else {
01696 result[ntest] = ulpinv;
01697 goto L460;
01698 }
01699 }
01700
01701
01702
01703 temp1 = dsxt1_(&c__1, &wa2[1], &m2, &wa3[1], &m3, &abstol, &
01704 ulp, &unfl);
01705 temp2 = dsxt1_(&c__1, &wa3[1], &m3, &wa2[1], &m2, &abstol, &
01706 ulp, &unfl);
01707 if (n > 0) {
01708
01709 d__2 = abs(wa1[1]), d__3 = (d__1 = wa1[n], abs(d__1));
01710 temp3 = max(d__2,d__3);
01711 } else {
01712 temp3 = 0.;
01713 }
01714
01715 d__1 = unfl, d__2 = temp3 * ulp;
01716 result[ntest] = (temp1 + temp2) / max(d__1,d__2);
01717
01718 L460:
01719 ++ntest;
01720 if (iuplo == 1) {
01721 indx = 1;
01722 i__3 = n;
01723 for (j = 1; j <= i__3; ++j) {
01724 i__4 = j;
01725 for (i__ = 1; i__ <= i__4; ++i__) {
01726 i__5 = indx;
01727 i__6 = i__ + j * a_dim1;
01728 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01729 .i;
01730 ++indx;
01731
01732 }
01733
01734 }
01735 } else {
01736 indx = 1;
01737 i__3 = n;
01738 for (j = 1; j <= i__3; ++j) {
01739 i__4 = n;
01740 for (i__ = j; i__ <= i__4; ++i__) {
01741 i__5 = indx;
01742 i__6 = i__ + j * a_dim1;
01743 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01744 .i;
01745 ++indx;
01746
01747 }
01748
01749 }
01750 }
01751
01752 zhpevx_("V", "V", uplo, &n, &work[1], &vl, &vu, &il, &iu, &
01753 abstol, &m2, &wa2[1], &z__[z_offset], ldu, &v[
01754 v_offset], &rwork[1], &iwork[1], &iwork[n * 5 + 1], &
01755 iinfo);
01756 if (iinfo != 0) {
01757 io___73.ciunit = *nounit;
01758 s_wsfe(&io___73);
01759
01760 i__7[0] = 11, a__1[0] = "ZHPEVX(V,V,";
01761 i__7[1] = 1, a__1[1] = uplo;
01762 i__7[2] = 1, a__1[2] = ")";
01763 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
01764 do_fio(&c__1, ch__2, (ftnlen)13);
01765 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01766 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01767 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01768 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01769 ;
01770 e_wsfe();
01771 *info = abs(iinfo);
01772 if (iinfo < 0) {
01773 return 0;
01774 } else {
01775 result[ntest] = ulpinv;
01776 result[ntest + 1] = ulpinv;
01777 result[ntest + 2] = ulpinv;
01778 goto L550;
01779 }
01780 }
01781
01782
01783
01784 zhet22_(&c__1, uplo, &n, &m2, &c__0, &a[a_offset], ldu, &wa2[
01785 1], &d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &
01786 tau[1], &work[1], &rwork[1], &result[ntest]);
01787
01788 ntest += 2;
01789
01790 if (iuplo == 1) {
01791 indx = 1;
01792 i__3 = n;
01793 for (j = 1; j <= i__3; ++j) {
01794 i__4 = j;
01795 for (i__ = 1; i__ <= i__4; ++i__) {
01796 i__5 = indx;
01797 i__6 = i__ + j * a_dim1;
01798 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01799 .i;
01800 ++indx;
01801
01802 }
01803
01804 }
01805 } else {
01806 indx = 1;
01807 i__3 = n;
01808 for (j = 1; j <= i__3; ++j) {
01809 i__4 = n;
01810 for (i__ = j; i__ <= i__4; ++i__) {
01811 i__5 = indx;
01812 i__6 = i__ + j * a_dim1;
01813 work[i__5].r = a[i__6].r, work[i__5].i = a[i__6]
01814 .i;
01815 ++indx;
01816
01817 }
01818
01819 }
01820 }
01821
01822 zhpevx_("N", "V", uplo, &n, &work[1], &vl, &vu, &il, &iu, &
01823 abstol, &m3, &wa3[1], &z__[z_offset], ldu, &v[
01824 v_offset], &rwork[1], &iwork[1], &iwork[n * 5 + 1], &
01825 iinfo);
01826 if (iinfo != 0) {
01827 io___74.ciunit = *nounit;
01828 s_wsfe(&io___74);
01829
01830 i__7[0] = 11, a__1[0] = "ZHPEVX(N,V,";
01831 i__7[1] = 1, a__1[1] = uplo;
01832 i__7[2] = 1, a__1[2] = ")";
01833 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
01834 do_fio(&c__1, ch__2, (ftnlen)13);
01835 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01836 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01837 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01838 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01839 ;
01840 e_wsfe();
01841 *info = abs(iinfo);
01842 if (iinfo < 0) {
01843 return 0;
01844 } else {
01845 result[ntest] = ulpinv;
01846 goto L550;
01847 }
01848 }
01849
01850 if (m3 == 0 && n > 0) {
01851 result[ntest] = ulpinv;
01852 goto L550;
01853 }
01854
01855
01856
01857 temp1 = dsxt1_(&c__1, &wa2[1], &m2, &wa3[1], &m3, &abstol, &
01858 ulp, &unfl);
01859 temp2 = dsxt1_(&c__1, &wa3[1], &m3, &wa2[1], &m2, &abstol, &
01860 ulp, &unfl);
01861 if (n > 0) {
01862
01863 d__2 = abs(wa1[1]), d__3 = (d__1 = wa1[n], abs(d__1));
01864 temp3 = max(d__2,d__3);
01865 } else {
01866 temp3 = 0.;
01867 }
01868
01869 d__1 = unfl, d__2 = temp3 * ulp;
01870 result[ntest] = (temp1 + temp2) / max(d__1,d__2);
01871
01872 L550:
01873
01874
01875
01876 if (jtype <= 7) {
01877 kd = 0;
01878 } else if (jtype >= 8 && jtype <= 15) {
01879
01880 i__3 = n - 1;
01881 kd = max(i__3,0);
01882 } else {
01883 kd = ihbw;
01884 }
01885
01886
01887
01888
01889 if (iuplo == 1) {
01890 i__3 = n;
01891 for (j = 1; j <= i__3; ++j) {
01892
01893 i__4 = 1, i__5 = j - kd;
01894 i__6 = j;
01895 for (i__ = max(i__4,i__5); i__ <= i__6; ++i__) {
01896 i__4 = kd + 1 + i__ - j + j * v_dim1;
01897 i__5 = i__ + j * a_dim1;
01898 v[i__4].r = a[i__5].r, v[i__4].i = a[i__5].i;
01899
01900 }
01901
01902 }
01903 } else {
01904 i__3 = n;
01905 for (j = 1; j <= i__3; ++j) {
01906
01907 i__4 = n, i__5 = j + kd;
01908 i__6 = min(i__4,i__5);
01909 for (i__ = j; i__ <= i__6; ++i__) {
01910 i__4 = i__ + 1 - j + j * v_dim1;
01911 i__5 = i__ + j * a_dim1;
01912 v[i__4].r = a[i__5].r, v[i__4].i = a[i__5].i;
01913
01914 }
01915
01916 }
01917 }
01918
01919 ++ntest;
01920 zhbevd_("V", uplo, &n, &kd, &v[v_offset], ldu, &d1[1], &z__[
01921 z_offset], ldu, &work[1], &lwedc, &rwork[1], &lrwedc,
01922 &iwork[1], &liwedc, &iinfo);
01923 if (iinfo != 0) {
01924 io___76.ciunit = *nounit;
01925 s_wsfe(&io___76);
01926
01927 i__7[0] = 9, a__1[0] = "ZHBEVD(V,";
01928 i__7[1] = 1, a__1[1] = uplo;
01929 i__7[2] = 1, a__1[2] = ")";
01930 s_cat(ch__1, a__1, i__7, &c__3, (ftnlen)11);
01931 do_fio(&c__1, ch__1, (ftnlen)11);
01932 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01933 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01934 do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer));
01935 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
01936 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
01937 ;
01938 e_wsfe();
01939 *info = abs(iinfo);
01940 if (iinfo < 0) {
01941 return 0;
01942 } else {
01943 result[ntest] = ulpinv;
01944 result[ntest + 1] = ulpinv;
01945 result[ntest + 2] = ulpinv;
01946 goto L650;
01947 }
01948 }
01949
01950
01951
01952 zhet21_(&c__1, uplo, &n, &c__0, &a[a_offset], lda, &d1[1], &
01953 d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &tau[1]
01954 , &work[1], &rwork[1], &result[ntest]);
01955
01956 if (iuplo == 1) {
01957 i__3 = n;
01958 for (j = 1; j <= i__3; ++j) {
01959
01960 i__6 = 1, i__4 = j - kd;
01961 i__5 = j;
01962 for (i__ = max(i__6,i__4); i__ <= i__5; ++i__) {
01963 i__6 = kd + 1 + i__ - j + j * v_dim1;
01964 i__4 = i__ + j * a_dim1;
01965 v[i__6].r = a[i__4].r, v[i__6].i = a[i__4].i;
01966
01967 }
01968
01969 }
01970 } else {
01971 i__3 = n;
01972 for (j = 1; j <= i__3; ++j) {
01973
01974 i__6 = n, i__4 = j + kd;
01975 i__5 = min(i__6,i__4);
01976 for (i__ = j; i__ <= i__5; ++i__) {
01977 i__6 = i__ + 1 - j + j * v_dim1;
01978 i__4 = i__ + j * a_dim1;
01979 v[i__6].r = a[i__4].r, v[i__6].i = a[i__4].i;
01980
01981 }
01982
01983 }
01984 }
01985
01986 ntest += 2;
01987 zhbevd_("N", uplo, &n, &kd, &v[v_offset], ldu, &d3[1], &z__[
01988 z_offset], ldu, &work[1], &lwedc, &rwork[1], &lrwedc,
01989 &iwork[1], &liwedc, &iinfo);
01990 if (iinfo != 0) {
01991 io___77.ciunit = *nounit;
01992 s_wsfe(&io___77);
01993
01994 i__7[0] = 9, a__1[0] = "ZHBEVD(N,";
01995 i__7[1] = 1, a__1[1] = uplo;
01996 i__7[2] = 1, a__1[2] = ")";
01997 s_cat(ch__1, a__1, i__7, &c__3, (ftnlen)11);
01998 do_fio(&c__1, ch__1, (ftnlen)11);
01999 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02000 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02001 do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer));
02002 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02003 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02004 ;
02005 e_wsfe();
02006 *info = abs(iinfo);
02007 if (iinfo < 0) {
02008 return 0;
02009 } else {
02010 result[ntest] = ulpinv;
02011 goto L650;
02012 }
02013 }
02014
02015
02016
02017 temp1 = 0.;
02018 temp2 = 0.;
02019 i__3 = n;
02020 for (j = 1; j <= i__3; ++j) {
02021
02022 d__3 = temp1, d__4 = (d__1 = d1[j], abs(d__1)), d__3 =
02023 max(d__3,d__4), d__4 = (d__2 = d3[j], abs(d__2));
02024 temp1 = max(d__3,d__4);
02025
02026 d__2 = temp2, d__3 = (d__1 = d1[j] - d3[j], abs(d__1));
02027 temp2 = max(d__2,d__3);
02028
02029 }
02030
02031 d__1 = unfl, d__2 = ulp * max(temp1,temp2);
02032 result[ntest] = temp2 / max(d__1,d__2);
02033
02034
02035
02036
02037 L650:
02038 if (iuplo == 1) {
02039 i__3 = n;
02040 for (j = 1; j <= i__3; ++j) {
02041
02042 i__5 = 1, i__6 = j - kd;
02043 i__4 = j;
02044 for (i__ = max(i__5,i__6); i__ <= i__4; ++i__) {
02045 i__5 = kd + 1 + i__ - j + j * v_dim1;
02046 i__6 = i__ + j * a_dim1;
02047 v[i__5].r = a[i__6].r, v[i__5].i = a[i__6].i;
02048
02049 }
02050
02051 }
02052 } else {
02053 i__3 = n;
02054 for (j = 1; j <= i__3; ++j) {
02055
02056 i__5 = n, i__6 = j + kd;
02057 i__4 = min(i__5,i__6);
02058 for (i__ = j; i__ <= i__4; ++i__) {
02059 i__5 = i__ + 1 - j + j * v_dim1;
02060 i__6 = i__ + j * a_dim1;
02061 v[i__5].r = a[i__6].r, v[i__5].i = a[i__6].i;
02062
02063 }
02064
02065 }
02066 }
02067
02068 ++ntest;
02069 zhbevx_("V", "A", uplo, &n, &kd, &v[v_offset], ldu, &u[
02070 u_offset], ldu, &vl, &vu, &il, &iu, &abstol, &m, &wa1[
02071 1], &z__[z_offset], ldu, &work[1], &rwork[1], &iwork[
02072 1], &iwork[n * 5 + 1], &iinfo);
02073 if (iinfo != 0) {
02074 io___78.ciunit = *nounit;
02075 s_wsfe(&io___78);
02076
02077 i__7[0] = 11, a__1[0] = "ZHBEVX(V,A,";
02078 i__7[1] = 1, a__1[1] = uplo;
02079 i__7[2] = 1, a__1[2] = ")";
02080 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
02081 do_fio(&c__1, ch__2, (ftnlen)13);
02082 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02083 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02084 do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer));
02085 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02086 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02087 ;
02088 e_wsfe();
02089 *info = abs(iinfo);
02090 if (iinfo < 0) {
02091 return 0;
02092 } else {
02093 result[ntest] = ulpinv;
02094 result[ntest + 1] = ulpinv;
02095 result[ntest + 2] = ulpinv;
02096 goto L750;
02097 }
02098 }
02099
02100
02101
02102 zhet21_(&c__1, uplo, &n, &c__0, &a[a_offset], ldu, &wa1[1], &
02103 d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &tau[1]
02104 , &work[1], &rwork[1], &result[ntest]);
02105
02106 ntest += 2;
02107
02108 if (iuplo == 1) {
02109 i__3 = n;
02110 for (j = 1; j <= i__3; ++j) {
02111
02112 i__4 = 1, i__5 = j - kd;
02113 i__6 = j;
02114 for (i__ = max(i__4,i__5); i__ <= i__6; ++i__) {
02115 i__4 = kd + 1 + i__ - j + j * v_dim1;
02116 i__5 = i__ + j * a_dim1;
02117 v[i__4].r = a[i__5].r, v[i__4].i = a[i__5].i;
02118
02119 }
02120
02121 }
02122 } else {
02123 i__3 = n;
02124 for (j = 1; j <= i__3; ++j) {
02125
02126 i__4 = n, i__5 = j + kd;
02127 i__6 = min(i__4,i__5);
02128 for (i__ = j; i__ <= i__6; ++i__) {
02129 i__4 = i__ + 1 - j + j * v_dim1;
02130 i__5 = i__ + j * a_dim1;
02131 v[i__4].r = a[i__5].r, v[i__4].i = a[i__5].i;
02132
02133 }
02134
02135 }
02136 }
02137
02138 zhbevx_("N", "A", uplo, &n, &kd, &v[v_offset], ldu, &u[
02139 u_offset], ldu, &vl, &vu, &il, &iu, &abstol, &m2, &
02140 wa2[1], &z__[z_offset], ldu, &work[1], &rwork[1], &
02141 iwork[1], &iwork[n * 5 + 1], &iinfo);
02142 if (iinfo != 0) {
02143 io___79.ciunit = *nounit;
02144 s_wsfe(&io___79);
02145
02146 i__7[0] = 11, a__1[0] = "ZHBEVX(N,A,";
02147 i__7[1] = 1, a__1[1] = uplo;
02148 i__7[2] = 1, a__1[2] = ")";
02149 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
02150 do_fio(&c__1, ch__2, (ftnlen)13);
02151 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02152 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02153 do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer));
02154 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02155 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02156 ;
02157 e_wsfe();
02158 *info = abs(iinfo);
02159 if (iinfo < 0) {
02160 return 0;
02161 } else {
02162 result[ntest] = ulpinv;
02163 goto L750;
02164 }
02165 }
02166
02167
02168
02169 temp1 = 0.;
02170 temp2 = 0.;
02171 i__3 = n;
02172 for (j = 1; j <= i__3; ++j) {
02173
02174 d__3 = temp1, d__4 = (d__1 = wa1[j], abs(d__1)), d__3 =
02175 max(d__3,d__4), d__4 = (d__2 = wa2[j], abs(d__2));
02176 temp1 = max(d__3,d__4);
02177
02178 d__2 = temp2, d__3 = (d__1 = wa1[j] - wa2[j], abs(d__1));
02179 temp2 = max(d__2,d__3);
02180
02181 }
02182
02183 d__1 = unfl, d__2 = ulp * max(temp1,temp2);
02184 result[ntest] = temp2 / max(d__1,d__2);
02185
02186
02187
02188
02189 L750:
02190 ++ntest;
02191 if (iuplo == 1) {
02192 i__3 = n;
02193 for (j = 1; j <= i__3; ++j) {
02194
02195 i__6 = 1, i__4 = j - kd;
02196 i__5 = j;
02197 for (i__ = max(i__6,i__4); i__ <= i__5; ++i__) {
02198 i__6 = kd + 1 + i__ - j + j * v_dim1;
02199 i__4 = i__ + j * a_dim1;
02200 v[i__6].r = a[i__4].r, v[i__6].i = a[i__4].i;
02201
02202 }
02203
02204 }
02205 } else {
02206 i__3 = n;
02207 for (j = 1; j <= i__3; ++j) {
02208
02209 i__6 = n, i__4 = j + kd;
02210 i__5 = min(i__6,i__4);
02211 for (i__ = j; i__ <= i__5; ++i__) {
02212 i__6 = i__ + 1 - j + j * v_dim1;
02213 i__4 = i__ + j * a_dim1;
02214 v[i__6].r = a[i__4].r, v[i__6].i = a[i__4].i;
02215
02216 }
02217
02218 }
02219 }
02220
02221 zhbevx_("V", "I", uplo, &n, &kd, &v[v_offset], ldu, &u[
02222 u_offset], ldu, &vl, &vu, &il, &iu, &abstol, &m2, &
02223 wa2[1], &z__[z_offset], ldu, &work[1], &rwork[1], &
02224 iwork[1], &iwork[n * 5 + 1], &iinfo);
02225 if (iinfo != 0) {
02226 io___80.ciunit = *nounit;
02227 s_wsfe(&io___80);
02228
02229 i__7[0] = 11, a__1[0] = "ZHBEVX(V,I,";
02230 i__7[1] = 1, a__1[1] = uplo;
02231 i__7[2] = 1, a__1[2] = ")";
02232 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
02233 do_fio(&c__1, ch__2, (ftnlen)13);
02234 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02235 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02236 do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer));
02237 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02238 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02239 ;
02240 e_wsfe();
02241 *info = abs(iinfo);
02242 if (iinfo < 0) {
02243 return 0;
02244 } else {
02245 result[ntest] = ulpinv;
02246 result[ntest + 1] = ulpinv;
02247 result[ntest + 2] = ulpinv;
02248 goto L840;
02249 }
02250 }
02251
02252
02253
02254 zhet22_(&c__1, uplo, &n, &m2, &c__0, &a[a_offset], ldu, &wa2[
02255 1], &d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &
02256 tau[1], &work[1], &rwork[1], &result[ntest]);
02257
02258 ntest += 2;
02259
02260 if (iuplo == 1) {
02261 i__3 = n;
02262 for (j = 1; j <= i__3; ++j) {
02263
02264 i__5 = 1, i__6 = j - kd;
02265 i__4 = j;
02266 for (i__ = max(i__5,i__6); i__ <= i__4; ++i__) {
02267 i__5 = kd + 1 + i__ - j + j * v_dim1;
02268 i__6 = i__ + j * a_dim1;
02269 v[i__5].r = a[i__6].r, v[i__5].i = a[i__6].i;
02270
02271 }
02272
02273 }
02274 } else {
02275 i__3 = n;
02276 for (j = 1; j <= i__3; ++j) {
02277
02278 i__5 = n, i__6 = j + kd;
02279 i__4 = min(i__5,i__6);
02280 for (i__ = j; i__ <= i__4; ++i__) {
02281 i__5 = i__ + 1 - j + j * v_dim1;
02282 i__6 = i__ + j * a_dim1;
02283 v[i__5].r = a[i__6].r, v[i__5].i = a[i__6].i;
02284
02285 }
02286
02287 }
02288 }
02289 zhbevx_("N", "I", uplo, &n, &kd, &v[v_offset], ldu, &u[
02290 u_offset], ldu, &vl, &vu, &il, &iu, &abstol, &m3, &
02291 wa3[1], &z__[z_offset], ldu, &work[1], &rwork[1], &
02292 iwork[1], &iwork[n * 5 + 1], &iinfo);
02293 if (iinfo != 0) {
02294 io___81.ciunit = *nounit;
02295 s_wsfe(&io___81);
02296
02297 i__7[0] = 11, a__1[0] = "ZHBEVX(N,I,";
02298 i__7[1] = 1, a__1[1] = uplo;
02299 i__7[2] = 1, a__1[2] = ")";
02300 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
02301 do_fio(&c__1, ch__2, (ftnlen)13);
02302 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02303 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02304 do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer));
02305 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02306 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02307 ;
02308 e_wsfe();
02309 *info = abs(iinfo);
02310 if (iinfo < 0) {
02311 return 0;
02312 } else {
02313 result[ntest] = ulpinv;
02314 goto L840;
02315 }
02316 }
02317
02318
02319
02320 temp1 = dsxt1_(&c__1, &wa2[1], &m2, &wa3[1], &m3, &abstol, &
02321 ulp, &unfl);
02322 temp2 = dsxt1_(&c__1, &wa3[1], &m3, &wa2[1], &m2, &abstol, &
02323 ulp, &unfl);
02324 if (n > 0) {
02325
02326 d__2 = abs(wa1[1]), d__3 = (d__1 = wa1[n], abs(d__1));
02327 temp3 = max(d__2,d__3);
02328 } else {
02329 temp3 = 0.;
02330 }
02331
02332 d__1 = unfl, d__2 = temp3 * ulp;
02333 result[ntest] = (temp1 + temp2) / max(d__1,d__2);
02334
02335
02336
02337
02338 L840:
02339 ++ntest;
02340 if (iuplo == 1) {
02341 i__3 = n;
02342 for (j = 1; j <= i__3; ++j) {
02343
02344 i__4 = 1, i__5 = j - kd;
02345 i__6 = j;
02346 for (i__ = max(i__4,i__5); i__ <= i__6; ++i__) {
02347 i__4 = kd + 1 + i__ - j + j * v_dim1;
02348 i__5 = i__ + j * a_dim1;
02349 v[i__4].r = a[i__5].r, v[i__4].i = a[i__5].i;
02350
02351 }
02352
02353 }
02354 } else {
02355 i__3 = n;
02356 for (j = 1; j <= i__3; ++j) {
02357
02358 i__4 = n, i__5 = j + kd;
02359 i__6 = min(i__4,i__5);
02360 for (i__ = j; i__ <= i__6; ++i__) {
02361 i__4 = i__ + 1 - j + j * v_dim1;
02362 i__5 = i__ + j * a_dim1;
02363 v[i__4].r = a[i__5].r, v[i__4].i = a[i__5].i;
02364
02365 }
02366
02367 }
02368 }
02369 zhbevx_("V", "V", uplo, &n, &kd, &v[v_offset], ldu, &u[
02370 u_offset], ldu, &vl, &vu, &il, &iu, &abstol, &m2, &
02371 wa2[1], &z__[z_offset], ldu, &work[1], &rwork[1], &
02372 iwork[1], &iwork[n * 5 + 1], &iinfo);
02373 if (iinfo != 0) {
02374 io___82.ciunit = *nounit;
02375 s_wsfe(&io___82);
02376
02377 i__7[0] = 11, a__1[0] = "ZHBEVX(V,V,";
02378 i__7[1] = 1, a__1[1] = uplo;
02379 i__7[2] = 1, a__1[2] = ")";
02380 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
02381 do_fio(&c__1, ch__2, (ftnlen)13);
02382 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02383 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02384 do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer));
02385 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02386 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02387 ;
02388 e_wsfe();
02389 *info = abs(iinfo);
02390 if (iinfo < 0) {
02391 return 0;
02392 } else {
02393 result[ntest] = ulpinv;
02394 result[ntest + 1] = ulpinv;
02395 result[ntest + 2] = ulpinv;
02396 goto L930;
02397 }
02398 }
02399
02400
02401
02402 zhet22_(&c__1, uplo, &n, &m2, &c__0, &a[a_offset], ldu, &wa2[
02403 1], &d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &
02404 tau[1], &work[1], &rwork[1], &result[ntest]);
02405
02406 ntest += 2;
02407
02408 if (iuplo == 1) {
02409 i__3 = n;
02410 for (j = 1; j <= i__3; ++j) {
02411
02412 i__6 = 1, i__4 = j - kd;
02413 i__5 = j;
02414 for (i__ = max(i__6,i__4); i__ <= i__5; ++i__) {
02415 i__6 = kd + 1 + i__ - j + j * v_dim1;
02416 i__4 = i__ + j * a_dim1;
02417 v[i__6].r = a[i__4].r, v[i__6].i = a[i__4].i;
02418
02419 }
02420
02421 }
02422 } else {
02423 i__3 = n;
02424 for (j = 1; j <= i__3; ++j) {
02425
02426 i__6 = n, i__4 = j + kd;
02427 i__5 = min(i__6,i__4);
02428 for (i__ = j; i__ <= i__5; ++i__) {
02429 i__6 = i__ + 1 - j + j * v_dim1;
02430 i__4 = i__ + j * a_dim1;
02431 v[i__6].r = a[i__4].r, v[i__6].i = a[i__4].i;
02432
02433 }
02434
02435 }
02436 }
02437 zhbevx_("N", "V", uplo, &n, &kd, &v[v_offset], ldu, &u[
02438 u_offset], ldu, &vl, &vu, &il, &iu, &abstol, &m3, &
02439 wa3[1], &z__[z_offset], ldu, &work[1], &rwork[1], &
02440 iwork[1], &iwork[n * 5 + 1], &iinfo);
02441 if (iinfo != 0) {
02442 io___83.ciunit = *nounit;
02443 s_wsfe(&io___83);
02444
02445 i__7[0] = 11, a__1[0] = "ZHBEVX(N,V,";
02446 i__7[1] = 1, a__1[1] = uplo;
02447 i__7[2] = 1, a__1[2] = ")";
02448 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
02449 do_fio(&c__1, ch__2, (ftnlen)13);
02450 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02451 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02452 do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer));
02453 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02454 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02455 ;
02456 e_wsfe();
02457 *info = abs(iinfo);
02458 if (iinfo < 0) {
02459 return 0;
02460 } else {
02461 result[ntest] = ulpinv;
02462 goto L930;
02463 }
02464 }
02465
02466 if (m3 == 0 && n > 0) {
02467 result[ntest] = ulpinv;
02468 goto L930;
02469 }
02470
02471
02472
02473 temp1 = dsxt1_(&c__1, &wa2[1], &m2, &wa3[1], &m3, &abstol, &
02474 ulp, &unfl);
02475 temp2 = dsxt1_(&c__1, &wa3[1], &m3, &wa2[1], &m2, &abstol, &
02476 ulp, &unfl);
02477 if (n > 0) {
02478
02479 d__2 = abs(wa1[1]), d__3 = (d__1 = wa1[n], abs(d__1));
02480 temp3 = max(d__2,d__3);
02481 } else {
02482 temp3 = 0.;
02483 }
02484
02485 d__1 = unfl, d__2 = temp3 * ulp;
02486 result[ntest] = (temp1 + temp2) / max(d__1,d__2);
02487
02488 L930:
02489
02490
02491
02492 zlacpy_(" ", &n, &n, &a[a_offset], lda, &v[v_offset], ldu);
02493
02494 ++ntest;
02495 zheev_("V", uplo, &n, &a[a_offset], ldu, &d1[1], &work[1],
02496 lwork, &rwork[1], &iinfo);
02497 if (iinfo != 0) {
02498 io___84.ciunit = *nounit;
02499 s_wsfe(&io___84);
02500
02501 i__7[0] = 8, a__1[0] = "ZHEEV(V,";
02502 i__7[1] = 1, a__1[1] = uplo;
02503 i__7[2] = 1, a__1[2] = ")";
02504 s_cat(ch__3, a__1, i__7, &c__3, (ftnlen)10);
02505 do_fio(&c__1, ch__3, (ftnlen)10);
02506 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02507 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02508 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02509 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02510 ;
02511 e_wsfe();
02512 *info = abs(iinfo);
02513 if (iinfo < 0) {
02514 return 0;
02515 } else {
02516 result[ntest] = ulpinv;
02517 result[ntest + 1] = ulpinv;
02518 result[ntest + 2] = ulpinv;
02519 goto L950;
02520 }
02521 }
02522
02523
02524
02525 zhet21_(&c__1, uplo, &n, &c__0, &v[v_offset], ldu, &d1[1], &
02526 d2[1], &a[a_offset], ldu, &z__[z_offset], ldu, &tau[1]
02527 , &work[1], &rwork[1], &result[ntest]);
02528
02529 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
02530
02531 ntest += 2;
02532 zheev_("N", uplo, &n, &a[a_offset], ldu, &d3[1], &work[1],
02533 lwork, &rwork[1], &iinfo);
02534 if (iinfo != 0) {
02535 io___85.ciunit = *nounit;
02536 s_wsfe(&io___85);
02537
02538 i__7[0] = 8, a__1[0] = "ZHEEV(N,";
02539 i__7[1] = 1, a__1[1] = uplo;
02540 i__7[2] = 1, a__1[2] = ")";
02541 s_cat(ch__3, a__1, i__7, &c__3, (ftnlen)10);
02542 do_fio(&c__1, ch__3, (ftnlen)10);
02543 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02544 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02545 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02546 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02547 ;
02548 e_wsfe();
02549 *info = abs(iinfo);
02550 if (iinfo < 0) {
02551 return 0;
02552 } else {
02553 result[ntest] = ulpinv;
02554 goto L950;
02555 }
02556 }
02557
02558
02559
02560 temp1 = 0.;
02561 temp2 = 0.;
02562 i__3 = n;
02563 for (j = 1; j <= i__3; ++j) {
02564
02565 d__3 = temp1, d__4 = (d__1 = d1[j], abs(d__1)), d__3 =
02566 max(d__3,d__4), d__4 = (d__2 = d3[j], abs(d__2));
02567 temp1 = max(d__3,d__4);
02568
02569 d__2 = temp2, d__3 = (d__1 = d1[j] - d3[j], abs(d__1));
02570 temp2 = max(d__2,d__3);
02571
02572 }
02573
02574 d__1 = unfl, d__2 = ulp * max(temp1,temp2);
02575 result[ntest] = temp2 / max(d__1,d__2);
02576
02577 L950:
02578
02579 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
02580
02581
02582
02583
02584
02585
02586 if (iuplo == 1) {
02587 indx = 1;
02588 i__3 = n;
02589 for (j = 1; j <= i__3; ++j) {
02590 i__5 = j;
02591 for (i__ = 1; i__ <= i__5; ++i__) {
02592 i__6 = indx;
02593 i__4 = i__ + j * a_dim1;
02594 work[i__6].r = a[i__4].r, work[i__6].i = a[i__4]
02595 .i;
02596 ++indx;
02597
02598 }
02599
02600 }
02601 } else {
02602 indx = 1;
02603 i__3 = n;
02604 for (j = 1; j <= i__3; ++j) {
02605 i__5 = n;
02606 for (i__ = j; i__ <= i__5; ++i__) {
02607 i__6 = indx;
02608 i__4 = i__ + j * a_dim1;
02609 work[i__6].r = a[i__4].r, work[i__6].i = a[i__4]
02610 .i;
02611 ++indx;
02612
02613 }
02614
02615 }
02616 }
02617
02618 ++ntest;
02619 indwrk = n * (n + 1) / 2 + 1;
02620 zhpev_("V", uplo, &n, &work[1], &d1[1], &z__[z_offset], ldu, &
02621 work[indwrk], &rwork[1], &iinfo)
02622 ;
02623 if (iinfo != 0) {
02624 io___86.ciunit = *nounit;
02625 s_wsfe(&io___86);
02626
02627 i__7[0] = 8, a__1[0] = "ZHPEV(V,";
02628 i__7[1] = 1, a__1[1] = uplo;
02629 i__7[2] = 1, a__1[2] = ")";
02630 s_cat(ch__3, a__1, i__7, &c__3, (ftnlen)10);
02631 do_fio(&c__1, ch__3, (ftnlen)10);
02632 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02633 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02634 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02635 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02636 ;
02637 e_wsfe();
02638 *info = abs(iinfo);
02639 if (iinfo < 0) {
02640 return 0;
02641 } else {
02642 result[ntest] = ulpinv;
02643 result[ntest + 1] = ulpinv;
02644 result[ntest + 2] = ulpinv;
02645 goto L1050;
02646 }
02647 }
02648
02649
02650
02651 zhet21_(&c__1, uplo, &n, &c__0, &a[a_offset], lda, &d1[1], &
02652 d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &tau[1]
02653 , &work[1], &rwork[1], &result[ntest]);
02654
02655 if (iuplo == 1) {
02656 indx = 1;
02657 i__3 = n;
02658 for (j = 1; j <= i__3; ++j) {
02659 i__5 = j;
02660 for (i__ = 1; i__ <= i__5; ++i__) {
02661 i__6 = indx;
02662 i__4 = i__ + j * a_dim1;
02663 work[i__6].r = a[i__4].r, work[i__6].i = a[i__4]
02664 .i;
02665 ++indx;
02666
02667 }
02668
02669 }
02670 } else {
02671 indx = 1;
02672 i__3 = n;
02673 for (j = 1; j <= i__3; ++j) {
02674 i__5 = n;
02675 for (i__ = j; i__ <= i__5; ++i__) {
02676 i__6 = indx;
02677 i__4 = i__ + j * a_dim1;
02678 work[i__6].r = a[i__4].r, work[i__6].i = a[i__4]
02679 .i;
02680 ++indx;
02681
02682 }
02683
02684 }
02685 }
02686
02687 ntest += 2;
02688 indwrk = n * (n + 1) / 2 + 1;
02689 zhpev_("N", uplo, &n, &work[1], &d3[1], &z__[z_offset], ldu, &
02690 work[indwrk], &rwork[1], &iinfo)
02691 ;
02692 if (iinfo != 0) {
02693 io___87.ciunit = *nounit;
02694 s_wsfe(&io___87);
02695
02696 i__7[0] = 8, a__1[0] = "ZHPEV(N,";
02697 i__7[1] = 1, a__1[1] = uplo;
02698 i__7[2] = 1, a__1[2] = ")";
02699 s_cat(ch__3, a__1, i__7, &c__3, (ftnlen)10);
02700 do_fio(&c__1, ch__3, (ftnlen)10);
02701 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02702 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02703 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02704 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02705 ;
02706 e_wsfe();
02707 *info = abs(iinfo);
02708 if (iinfo < 0) {
02709 return 0;
02710 } else {
02711 result[ntest] = ulpinv;
02712 goto L1050;
02713 }
02714 }
02715
02716
02717
02718 temp1 = 0.;
02719 temp2 = 0.;
02720 i__3 = n;
02721 for (j = 1; j <= i__3; ++j) {
02722
02723 d__3 = temp1, d__4 = (d__1 = d1[j], abs(d__1)), d__3 =
02724 max(d__3,d__4), d__4 = (d__2 = d3[j], abs(d__2));
02725 temp1 = max(d__3,d__4);
02726
02727 d__2 = temp2, d__3 = (d__1 = d1[j] - d3[j], abs(d__1));
02728 temp2 = max(d__2,d__3);
02729
02730 }
02731
02732 d__1 = unfl, d__2 = ulp * max(temp1,temp2);
02733 result[ntest] = temp2 / max(d__1,d__2);
02734
02735 L1050:
02736
02737
02738
02739 if (jtype <= 7) {
02740 kd = 0;
02741 } else if (jtype >= 8 && jtype <= 15) {
02742
02743 i__3 = n - 1;
02744 kd = max(i__3,0);
02745 } else {
02746 kd = ihbw;
02747 }
02748
02749
02750
02751
02752 if (iuplo == 1) {
02753 i__3 = n;
02754 for (j = 1; j <= i__3; ++j) {
02755
02756 i__5 = 1, i__6 = j - kd;
02757 i__4 = j;
02758 for (i__ = max(i__5,i__6); i__ <= i__4; ++i__) {
02759 i__5 = kd + 1 + i__ - j + j * v_dim1;
02760 i__6 = i__ + j * a_dim1;
02761 v[i__5].r = a[i__6].r, v[i__5].i = a[i__6].i;
02762
02763 }
02764
02765 }
02766 } else {
02767 i__3 = n;
02768 for (j = 1; j <= i__3; ++j) {
02769
02770 i__5 = n, i__6 = j + kd;
02771 i__4 = min(i__5,i__6);
02772 for (i__ = j; i__ <= i__4; ++i__) {
02773 i__5 = i__ + 1 - j + j * v_dim1;
02774 i__6 = i__ + j * a_dim1;
02775 v[i__5].r = a[i__6].r, v[i__5].i = a[i__6].i;
02776
02777 }
02778
02779 }
02780 }
02781
02782 ++ntest;
02783 zhbev_("V", uplo, &n, &kd, &v[v_offset], ldu, &d1[1], &z__[
02784 z_offset], ldu, &work[1], &rwork[1], &iinfo);
02785 if (iinfo != 0) {
02786 io___88.ciunit = *nounit;
02787 s_wsfe(&io___88);
02788
02789 i__7[0] = 8, a__1[0] = "ZHBEV(V,";
02790 i__7[1] = 1, a__1[1] = uplo;
02791 i__7[2] = 1, a__1[2] = ")";
02792 s_cat(ch__3, a__1, i__7, &c__3, (ftnlen)10);
02793 do_fio(&c__1, ch__3, (ftnlen)10);
02794 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02795 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02796 do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer));
02797 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02798 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02799 ;
02800 e_wsfe();
02801 *info = abs(iinfo);
02802 if (iinfo < 0) {
02803 return 0;
02804 } else {
02805 result[ntest] = ulpinv;
02806 result[ntest + 1] = ulpinv;
02807 result[ntest + 2] = ulpinv;
02808 goto L1140;
02809 }
02810 }
02811
02812
02813
02814 zhet21_(&c__1, uplo, &n, &c__0, &a[a_offset], lda, &d1[1], &
02815 d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &tau[1]
02816 , &work[1], &rwork[1], &result[ntest]);
02817
02818 if (iuplo == 1) {
02819 i__3 = n;
02820 for (j = 1; j <= i__3; ++j) {
02821
02822 i__4 = 1, i__5 = j - kd;
02823 i__6 = j;
02824 for (i__ = max(i__4,i__5); i__ <= i__6; ++i__) {
02825 i__4 = kd + 1 + i__ - j + j * v_dim1;
02826 i__5 = i__ + j * a_dim1;
02827 v[i__4].r = a[i__5].r, v[i__4].i = a[i__5].i;
02828
02829 }
02830
02831 }
02832 } else {
02833 i__3 = n;
02834 for (j = 1; j <= i__3; ++j) {
02835
02836 i__4 = n, i__5 = j + kd;
02837 i__6 = min(i__4,i__5);
02838 for (i__ = j; i__ <= i__6; ++i__) {
02839 i__4 = i__ + 1 - j + j * v_dim1;
02840 i__5 = i__ + j * a_dim1;
02841 v[i__4].r = a[i__5].r, v[i__4].i = a[i__5].i;
02842
02843 }
02844
02845 }
02846 }
02847
02848 ntest += 2;
02849 zhbev_("N", uplo, &n, &kd, &v[v_offset], ldu, &d3[1], &z__[
02850 z_offset], ldu, &work[1], &rwork[1], &iinfo);
02851 if (iinfo != 0) {
02852 io___89.ciunit = *nounit;
02853 s_wsfe(&io___89);
02854
02855 i__7[0] = 8, a__1[0] = "ZHBEV(N,";
02856 i__7[1] = 1, a__1[1] = uplo;
02857 i__7[2] = 1, a__1[2] = ")";
02858 s_cat(ch__3, a__1, i__7, &c__3, (ftnlen)10);
02859 do_fio(&c__1, ch__3, (ftnlen)10);
02860 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02861 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02862 do_fio(&c__1, (char *)&kd, (ftnlen)sizeof(integer));
02863 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02864 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02865 ;
02866 e_wsfe();
02867 *info = abs(iinfo);
02868 if (iinfo < 0) {
02869 return 0;
02870 } else {
02871 result[ntest] = ulpinv;
02872 goto L1140;
02873 }
02874 }
02875
02876 L1140:
02877
02878
02879
02880 temp1 = 0.;
02881 temp2 = 0.;
02882 i__3 = n;
02883 for (j = 1; j <= i__3; ++j) {
02884
02885 d__3 = temp1, d__4 = (d__1 = d1[j], abs(d__1)), d__3 =
02886 max(d__3,d__4), d__4 = (d__2 = d3[j], abs(d__2));
02887 temp1 = max(d__3,d__4);
02888
02889 d__2 = temp2, d__3 = (d__1 = d1[j] - d3[j], abs(d__1));
02890 temp2 = max(d__2,d__3);
02891
02892 }
02893
02894 d__1 = unfl, d__2 = ulp * max(temp1,temp2);
02895 result[ntest] = temp2 / max(d__1,d__2);
02896
02897 zlacpy_(" ", &n, &n, &a[a_offset], lda, &v[v_offset], ldu);
02898 ++ntest;
02899 i__3 = *liwork - (n << 1);
02900 zheevr_("V", "A", uplo, &n, &a[a_offset], ldu, &vl, &vu, &il,
02901 &iu, &abstol, &m, &wa1[1], &z__[z_offset], ldu, &
02902 iwork[1], &work[1], lwork, &rwork[1], lrwork, &iwork[(
02903 n << 1) + 1], &i__3, &iinfo);
02904 if (iinfo != 0) {
02905 io___90.ciunit = *nounit;
02906 s_wsfe(&io___90);
02907
02908 i__7[0] = 11, a__1[0] = "ZHEEVR(V,A,";
02909 i__7[1] = 1, a__1[1] = uplo;
02910 i__7[2] = 1, a__1[2] = ")";
02911 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
02912 do_fio(&c__1, ch__2, (ftnlen)13);
02913 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02914 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02915 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02916 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02917 ;
02918 e_wsfe();
02919 *info = abs(iinfo);
02920 if (iinfo < 0) {
02921 return 0;
02922 } else {
02923 result[ntest] = ulpinv;
02924 result[ntest + 1] = ulpinv;
02925 result[ntest + 2] = ulpinv;
02926 goto L1170;
02927 }
02928 }
02929
02930
02931
02932 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
02933
02934 zhet21_(&c__1, uplo, &n, &c__0, &a[a_offset], ldu, &wa1[1], &
02935 d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &tau[1]
02936 , &work[1], &rwork[1], &result[ntest]);
02937
02938 ntest += 2;
02939 i__3 = *liwork - (n << 1);
02940 zheevr_("N", "A", uplo, &n, &a[a_offset], ldu, &vl, &vu, &il,
02941 &iu, &abstol, &m2, &wa2[1], &z__[z_offset], ldu, &
02942 iwork[1], &work[1], lwork, &rwork[1], lrwork, &iwork[(
02943 n << 1) + 1], &i__3, &iinfo);
02944 if (iinfo != 0) {
02945 io___91.ciunit = *nounit;
02946 s_wsfe(&io___91);
02947
02948 i__7[0] = 11, a__1[0] = "ZHEEVR(N,A,";
02949 i__7[1] = 1, a__1[1] = uplo;
02950 i__7[2] = 1, a__1[2] = ")";
02951 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
02952 do_fio(&c__1, ch__2, (ftnlen)13);
02953 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
02954 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
02955 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
02956 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
02957 ;
02958 e_wsfe();
02959 *info = abs(iinfo);
02960 if (iinfo < 0) {
02961 return 0;
02962 } else {
02963 result[ntest] = ulpinv;
02964 goto L1170;
02965 }
02966 }
02967
02968
02969
02970 temp1 = 0.;
02971 temp2 = 0.;
02972 i__3 = n;
02973 for (j = 1; j <= i__3; ++j) {
02974
02975 d__3 = temp1, d__4 = (d__1 = wa1[j], abs(d__1)), d__3 =
02976 max(d__3,d__4), d__4 = (d__2 = wa2[j], abs(d__2));
02977 temp1 = max(d__3,d__4);
02978
02979 d__2 = temp2, d__3 = (d__1 = wa1[j] - wa2[j], abs(d__1));
02980 temp2 = max(d__2,d__3);
02981
02982 }
02983
02984 d__1 = unfl, d__2 = ulp * max(temp1,temp2);
02985 result[ntest] = temp2 / max(d__1,d__2);
02986
02987 L1170:
02988
02989 ++ntest;
02990 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
02991 i__3 = *liwork - (n << 1);
02992 zheevr_("V", "I", uplo, &n, &a[a_offset], ldu, &vl, &vu, &il,
02993 &iu, &abstol, &m2, &wa2[1], &z__[z_offset], ldu, &
02994 iwork[1], &work[1], lwork, &rwork[1], lrwork, &iwork[(
02995 n << 1) + 1], &i__3, &iinfo);
02996 if (iinfo != 0) {
02997 io___92.ciunit = *nounit;
02998 s_wsfe(&io___92);
02999
03000 i__7[0] = 11, a__1[0] = "ZHEEVR(V,I,";
03001 i__7[1] = 1, a__1[1] = uplo;
03002 i__7[2] = 1, a__1[2] = ")";
03003 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
03004 do_fio(&c__1, ch__2, (ftnlen)13);
03005 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
03006 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
03007 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
03008 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
03009 ;
03010 e_wsfe();
03011 *info = abs(iinfo);
03012 if (iinfo < 0) {
03013 return 0;
03014 } else {
03015 result[ntest] = ulpinv;
03016 result[ntest + 1] = ulpinv;
03017 result[ntest + 2] = ulpinv;
03018 goto L1180;
03019 }
03020 }
03021
03022
03023
03024 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
03025
03026 zhet22_(&c__1, uplo, &n, &m2, &c__0, &a[a_offset], ldu, &wa2[
03027 1], &d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &
03028 tau[1], &work[1], &rwork[1], &result[ntest]);
03029
03030 ntest += 2;
03031 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
03032 i__3 = *liwork - (n << 1);
03033 zheevr_("N", "I", uplo, &n, &a[a_offset], ldu, &vl, &vu, &il,
03034 &iu, &abstol, &m3, &wa3[1], &z__[z_offset], ldu, &
03035 iwork[1], &work[1], lwork, &rwork[1], lrwork, &iwork[(
03036 n << 1) + 1], &i__3, &iinfo);
03037 if (iinfo != 0) {
03038 io___93.ciunit = *nounit;
03039 s_wsfe(&io___93);
03040
03041 i__7[0] = 11, a__1[0] = "ZHEEVR(N,I,";
03042 i__7[1] = 1, a__1[1] = uplo;
03043 i__7[2] = 1, a__1[2] = ")";
03044 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
03045 do_fio(&c__1, ch__2, (ftnlen)13);
03046 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
03047 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
03048 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
03049 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
03050 ;
03051 e_wsfe();
03052 *info = abs(iinfo);
03053 if (iinfo < 0) {
03054 return 0;
03055 } else {
03056 result[ntest] = ulpinv;
03057 goto L1180;
03058 }
03059 }
03060
03061
03062
03063 temp1 = dsxt1_(&c__1, &wa2[1], &m2, &wa3[1], &m3, &abstol, &
03064 ulp, &unfl);
03065 temp2 = dsxt1_(&c__1, &wa3[1], &m3, &wa2[1], &m2, &abstol, &
03066 ulp, &unfl);
03067
03068 d__1 = unfl, d__2 = ulp * temp3;
03069 result[ntest] = (temp1 + temp2) / max(d__1,d__2);
03070 L1180:
03071
03072 ++ntest;
03073 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
03074 i__3 = *liwork - (n << 1);
03075 zheevr_("V", "V", uplo, &n, &a[a_offset], ldu, &vl, &vu, &il,
03076 &iu, &abstol, &m2, &wa2[1], &z__[z_offset], ldu, &
03077 iwork[1], &work[1], lwork, &rwork[1], lrwork, &iwork[(
03078 n << 1) + 1], &i__3, &iinfo);
03079 if (iinfo != 0) {
03080 io___94.ciunit = *nounit;
03081 s_wsfe(&io___94);
03082
03083 i__7[0] = 11, a__1[0] = "ZHEEVR(V,V,";
03084 i__7[1] = 1, a__1[1] = uplo;
03085 i__7[2] = 1, a__1[2] = ")";
03086 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
03087 do_fio(&c__1, ch__2, (ftnlen)13);
03088 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
03089 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
03090 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
03091 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
03092 ;
03093 e_wsfe();
03094 *info = abs(iinfo);
03095 if (iinfo < 0) {
03096 return 0;
03097 } else {
03098 result[ntest] = ulpinv;
03099 result[ntest + 1] = ulpinv;
03100 result[ntest + 2] = ulpinv;
03101 goto L1190;
03102 }
03103 }
03104
03105
03106
03107 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
03108
03109 zhet22_(&c__1, uplo, &n, &m2, &c__0, &a[a_offset], ldu, &wa2[
03110 1], &d2[1], &z__[z_offset], ldu, &v[v_offset], ldu, &
03111 tau[1], &work[1], &rwork[1], &result[ntest]);
03112
03113 ntest += 2;
03114 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
03115 i__3 = *liwork - (n << 1);
03116 zheevr_("N", "V", uplo, &n, &a[a_offset], ldu, &vl, &vu, &il,
03117 &iu, &abstol, &m3, &wa3[1], &z__[z_offset], ldu, &
03118 iwork[1], &work[1], lwork, &rwork[1], lrwork, &iwork[(
03119 n << 1) + 1], &i__3, &iinfo);
03120 if (iinfo != 0) {
03121 io___95.ciunit = *nounit;
03122 s_wsfe(&io___95);
03123
03124 i__7[0] = 11, a__1[0] = "ZHEEVR(N,V,";
03125 i__7[1] = 1, a__1[1] = uplo;
03126 i__7[2] = 1, a__1[2] = ")";
03127 s_cat(ch__2, a__1, i__7, &c__3, (ftnlen)13);
03128 do_fio(&c__1, ch__2, (ftnlen)13);
03129 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
03130 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
03131 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
03132 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer))
03133 ;
03134 e_wsfe();
03135 *info = abs(iinfo);
03136 if (iinfo < 0) {
03137 return 0;
03138 } else {
03139 result[ntest] = ulpinv;
03140 goto L1190;
03141 }
03142 }
03143
03144 if (m3 == 0 && n > 0) {
03145 result[ntest] = ulpinv;
03146 goto L1190;
03147 }
03148
03149
03150
03151 temp1 = dsxt1_(&c__1, &wa2[1], &m2, &wa3[1], &m3, &abstol, &
03152 ulp, &unfl);
03153 temp2 = dsxt1_(&c__1, &wa3[1], &m3, &wa2[1], &m2, &abstol, &
03154 ulp, &unfl);
03155 if (n > 0) {
03156
03157 d__2 = abs(wa1[1]), d__3 = (d__1 = wa1[n], abs(d__1));
03158 temp3 = max(d__2,d__3);
03159 } else {
03160 temp3 = 0.;
03161 }
03162
03163 d__1 = unfl, d__2 = temp3 * ulp;
03164 result[ntest] = (temp1 + temp2) / max(d__1,d__2);
03165
03166 zlacpy_(" ", &n, &n, &v[v_offset], ldu, &a[a_offset], lda);
03167
03168
03169
03170
03171
03172
03173
03174 L1190:
03175
03176
03177 ;
03178 }
03179
03180
03181
03182 ntestt += ntest;
03183 dlafts_("ZST", &n, &n, &jtype, &ntest, &result[1], ioldsd, thresh,
03184 nounit, &nerrs);
03185
03186 L1210:
03187 ;
03188 }
03189
03190 }
03191
03192
03193
03194 alasvm_("ZST", nounit, &nerrs, &ntestt, &c__0);
03195
03196
03197 return 0;
03198
03199
03200
03201 }