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__0 = 0;
00021 static integer c__6 = 6;
00022 static real c_b33 = 1.f;
00023 static integer c__1 = 1;
00024 static real c_b43 = 0.f;
00025 static integer c__4 = 4;
00026 static integer c__5 = 5;
00027 static real c_b78 = 10.f;
00028 static integer c__3 = 3;
00029
00030 int cdrvsg_(integer *nsizes, integer *nn, integer *ntypes,
00031 logical *dotype, integer *iseed, real *thresh, integer *nounit,
00032 complex *a, integer *lda, complex *b, integer *ldb, real *d__,
00033 complex *z__, integer *ldz, complex *ab, complex *bb, complex *ap,
00034 complex *bp, complex *work, integer *nwork, real *rwork, integer *
00035 lrwork, integer *iwork, integer *liwork, real *result, integer *info)
00036 {
00037
00038
00039 static integer ktype[21] = { 1,2,4,4,4,4,4,5,5,5,5,5,8,8,8,9,9,9,9,9,9 };
00040 static integer kmagn[21] = { 1,1,1,1,1,2,3,1,1,1,2,3,1,2,3,1,1,1,1,1,1 };
00041 static integer kmode[21] = { 0,0,4,3,1,4,4,4,3,1,4,4,0,0,0,4,4,4,4,4,4 };
00042
00043
00044 static char fmt_9999[] = "(\002 CDRVSG: \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
00048
00049 address a__1[3];
00050 integer a_dim1, a_offset, ab_dim1, ab_offset, b_dim1, b_offset, bb_dim1,
00051 bb_offset, z_dim1, z_offset, i__1, i__2, i__3, i__4, i__5, i__6[3]
00052 , i__7;
00053 char ch__1[10], ch__2[11], ch__3[12], ch__4[13];
00054
00055
00056 double sqrt(doublereal);
00057 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00058 int s_cat(char *, char **, integer *, integer *, ftnlen);
00059
00060
00061 integer i__, j, m, n, ka, kb, ij, il, iu;
00062 real vl, vu;
00063 integer ka9, kb9;
00064 real ulp, cond;
00065 integer jcol, nmax;
00066 real unfl, ovfl;
00067 char uplo[1];
00068 logical badnn;
00069 extern int chbgv_(char *, char *, integer *, integer *,
00070 integer *, complex *, integer *, complex *, integer *, real *,
00071 complex *, integer *, complex *, real *, integer *), chegv_(integer *, char *, char *, integer *, complex *,
00072 integer *, complex *, integer *, real *, complex *, integer *,
00073 real *, integer *);
00074 integer imode;
00075 extern logical lsame_(char *, char *);
00076 extern int csgt01_(integer *, char *, integer *, integer
00077 *, complex *, integer *, complex *, integer *, complex *, integer
00078 *, real *, complex *, real *, real *);
00079 integer iinfo;
00080 extern int chpgv_(integer *, char *, char *, integer *,
00081 complex *, complex *, real *, complex *, integer *, complex *,
00082 real *, integer *);
00083 real aninv, anorm;
00084 integer itemp, nmats, jsize, nerrs, itype, jtype, ntest, iseed2[4];
00085 extern int slabad_(real *, real *), chbgvd_(char *, char
00086 *, integer *, integer *, integer *, complex *, integer *, complex
00087 *, integer *, real *, complex *, integer *, complex *, integer *,
00088 real *, integer *, integer *, integer *, integer *), chegvd_(integer *, char *, char *, integer *, complex *,
00089 integer *, complex *, integer *, real *, complex *, integer *,
00090 real *, integer *, integer *, integer *, integer *);
00091 extern doublereal slamch_(char *);
00092 extern int chpgvd_(integer *, char *, char *, integer *,
00093 complex *, complex *, real *, complex *, integer *, complex *,
00094 integer *, real *, integer *, integer *, integer *, integer *);
00095 integer idumma[1];
00096 extern int clacpy_(char *, integer *, integer *, complex
00097 *, integer *, complex *, integer *);
00098 integer ioldsd[4];
00099 extern int claset_(char *, integer *, integer *, complex
00100 *, complex *, complex *, integer *), xerbla_(char *,
00101 integer *), chbgvx_(char *, char *, char *, integer *,
00102 integer *, integer *, complex *, integer *, complex *, integer *,
00103 complex *, integer *, real *, real *, integer *, integer *, real *
00104 , integer *, real *, complex *, integer *, complex *, real *,
00105 integer *, integer *, integer *), clatmr_(
00106 integer *, integer *, char *, integer *, char *, complex *,
00107 integer *, real *, complex *, char *, char *, complex *, integer *
00108 , real *, complex *, integer *, real *, char *, integer *,
00109 integer *, integer *, real *, real *, char *, complex *, integer *
00110 , integer *, integer *);
00111 extern doublereal slarnd_(integer *, integer *);
00112 real abstol;
00113 extern int chegvx_(integer *, char *, char *, char *,
00114 integer *, complex *, integer *, complex *, integer *, real *,
00115 real *, integer *, integer *, real *, integer *, real *, complex *
00116 , integer *, complex *, integer *, real *, integer *, integer *,
00117 integer *), clatms_(integer *, integer *,
00118 char *, integer *, char *, real *, integer *, real *, real *,
00119 integer *, integer *, char *, complex *, integer *, complex *,
00120 integer *);
00121 integer ibuplo, ibtype;
00122 extern int slafts_(char *, integer *, integer *, integer
00123 *, integer *, real *, integer *, real *, integer *, integer *), chpgvx_(integer *, char *, char *, char *, integer *,
00124 complex *, complex *, real *, real *, integer *, integer *, real *
00125 , integer *, real *, complex *, integer *, complex *, real *,
00126 integer *, integer *, integer *), slasum_(
00127 char *, integer *, integer *, integer *);
00128 real rtunfl, rtovfl, ulpinv;
00129 integer mtypes, ntestt;
00130
00131
00132 static cilist io___36 = { 0, 0, 0, fmt_9999, 0 };
00133 static cilist io___44 = { 0, 0, 0, fmt_9999, 0 };
00134 static cilist io___45 = { 0, 0, 0, fmt_9999, 0 };
00135 static cilist io___49 = { 0, 0, 0, fmt_9999, 0 };
00136 static cilist io___50 = { 0, 0, 0, fmt_9999, 0 };
00137 static cilist io___51 = { 0, 0, 0, fmt_9999, 0 };
00138 static cilist io___53 = { 0, 0, 0, fmt_9999, 0 };
00139 static cilist io___54 = { 0, 0, 0, fmt_9999, 0 };
00140 static cilist io___55 = { 0, 0, 0, fmt_9999, 0 };
00141 static cilist io___56 = { 0, 0, 0, fmt_9999, 0 };
00142 static cilist io___57 = { 0, 0, 0, fmt_9999, 0 };
00143 static cilist io___58 = { 0, 0, 0, fmt_9999, 0 };
00144 static cilist io___59 = { 0, 0, 0, fmt_9999, 0 };
00145 static cilist io___60 = { 0, 0, 0, fmt_9999, 0 };
00146 static cilist io___61 = { 0, 0, 0, fmt_9999, 0 };
00147 static cilist io___62 = { 0, 0, 0, fmt_9999, 0 };
00148
00149
00150
00151
00152
00153
00154
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 --nn;
00505 --dotype;
00506 --iseed;
00507 ab_dim1 = *lda;
00508 ab_offset = 1 + ab_dim1;
00509 ab -= ab_offset;
00510 a_dim1 = *lda;
00511 a_offset = 1 + a_dim1;
00512 a -= a_offset;
00513 bb_dim1 = *ldb;
00514 bb_offset = 1 + bb_dim1;
00515 bb -= bb_offset;
00516 b_dim1 = *ldb;
00517 b_offset = 1 + b_dim1;
00518 b -= b_offset;
00519 --d__;
00520 z_dim1 = *ldz;
00521 z_offset = 1 + z_dim1;
00522 z__ -= z_offset;
00523 --ap;
00524 --bp;
00525 --work;
00526 --rwork;
00527 --iwork;
00528 --result;
00529
00530
00531
00532
00533
00534
00535
00536 ntestt = 0;
00537 *info = 0;
00538
00539 badnn = FALSE_;
00540 nmax = 0;
00541 i__1 = *nsizes;
00542 for (j = 1; j <= i__1; ++j) {
00543
00544 i__2 = nmax, i__3 = nn[j];
00545 nmax = max(i__2,i__3);
00546 if (nn[j] < 0) {
00547 badnn = TRUE_;
00548 }
00549
00550 }
00551
00552
00553
00554 if (*nsizes < 0) {
00555 *info = -1;
00556 } else if (badnn) {
00557 *info = -2;
00558 } else if (*ntypes < 0) {
00559 *info = -3;
00560 } else if (*lda <= 1 || *lda < nmax) {
00561 *info = -9;
00562 } else if (*ldz <= 1 || *ldz < nmax) {
00563 *info = -16;
00564 } else {
00565
00566 i__1 = max(nmax,2);
00567 if (i__1 * i__1 << 1 > *nwork) {
00568 *info = -21;
00569 } else {
00570
00571 i__1 = max(nmax,2);
00572 if (i__1 * i__1 << 1 > *lrwork) {
00573 *info = -23;
00574 } else {
00575
00576 i__1 = max(nmax,2);
00577 if (i__1 * i__1 << 1 > *liwork) {
00578 *info = -25;
00579 }
00580 }
00581 }
00582 }
00583
00584 if (*info != 0) {
00585 i__1 = -(*info);
00586 xerbla_("CDRVSG", &i__1);
00587 return 0;
00588 }
00589
00590
00591
00592 if (*nsizes == 0 || *ntypes == 0) {
00593 return 0;
00594 }
00595
00596
00597
00598 unfl = slamch_("Safe minimum");
00599 ovfl = slamch_("Overflow");
00600 slabad_(&unfl, &ovfl);
00601 ulp = slamch_("Epsilon") * slamch_("Base");
00602 ulpinv = 1.f / ulp;
00603 rtunfl = sqrt(unfl);
00604 rtovfl = sqrt(ovfl);
00605
00606 for (i__ = 1; i__ <= 4; ++i__) {
00607 iseed2[i__ - 1] = iseed[i__];
00608
00609 }
00610
00611
00612
00613 nerrs = 0;
00614 nmats = 0;
00615
00616 i__1 = *nsizes;
00617 for (jsize = 1; jsize <= i__1; ++jsize) {
00618 n = nn[jsize];
00619 aninv = 1.f / (real) max(1,n);
00620
00621 if (*nsizes != 1) {
00622 mtypes = min(21,*ntypes);
00623 } else {
00624 mtypes = min(22,*ntypes);
00625 }
00626
00627 ka9 = 0;
00628 kb9 = 0;
00629 i__2 = mtypes;
00630 for (jtype = 1; jtype <= i__2; ++jtype) {
00631 if (! dotype[jtype]) {
00632 goto L640;
00633 }
00634 ++nmats;
00635 ntest = 0;
00636
00637 for (j = 1; j <= 4; ++j) {
00638 ioldsd[j - 1] = iseed[j];
00639
00640 }
00641
00642
00643
00644
00645
00646
00647
00648
00649
00650
00651
00652
00653
00654
00655
00656
00657 if (mtypes > 21) {
00658 goto L90;
00659 }
00660
00661 itype = ktype[jtype - 1];
00662 imode = kmode[jtype - 1];
00663
00664
00665
00666 switch (kmagn[jtype - 1]) {
00667 case 1: goto L40;
00668 case 2: goto L50;
00669 case 3: goto L60;
00670 }
00671
00672 L40:
00673 anorm = 1.f;
00674 goto L70;
00675
00676 L50:
00677 anorm = rtovfl * ulp * aninv;
00678 goto L70;
00679
00680 L60:
00681 anorm = rtunfl * n * ulpinv;
00682 goto L70;
00683
00684 L70:
00685
00686 iinfo = 0;
00687 cond = ulpinv;
00688
00689
00690
00691 if (itype == 1) {
00692
00693
00694
00695 ka = 0;
00696 kb = 0;
00697 claset_("Full", lda, &n, &c_b1, &c_b1, &a[a_offset], lda);
00698
00699 } else if (itype == 2) {
00700
00701
00702
00703 ka = 0;
00704 kb = 0;
00705 claset_("Full", lda, &n, &c_b1, &c_b1, &a[a_offset], lda);
00706 i__3 = n;
00707 for (jcol = 1; jcol <= i__3; ++jcol) {
00708 i__4 = jcol + jcol * a_dim1;
00709 a[i__4].r = anorm, a[i__4].i = 0.f;
00710
00711 }
00712
00713 } else if (itype == 4) {
00714
00715
00716
00717 ka = 0;
00718 kb = 0;
00719 clatms_(&n, &n, "S", &iseed[1], "H", &rwork[1], &imode, &cond,
00720 &anorm, &c__0, &c__0, "N", &a[a_offset], lda, &work[
00721 1], &iinfo);
00722
00723 } else if (itype == 5) {
00724
00725
00726
00727
00728 i__3 = 0, i__4 = n - 1;
00729 ka = max(i__3,i__4);
00730 kb = ka;
00731 clatms_(&n, &n, "S", &iseed[1], "H", &rwork[1], &imode, &cond,
00732 &anorm, &n, &n, "N", &a[a_offset], lda, &work[1], &
00733 iinfo);
00734
00735 } else if (itype == 7) {
00736
00737
00738
00739 ka = 0;
00740 kb = 0;
00741 clatmr_(&n, &n, "S", &iseed[1], "H", &work[1], &c__6, &c_b33,
00742 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b33, &work[(
00743 n << 1) + 1], &c__1, &c_b33, "N", idumma, &c__0, &
00744 c__0, &c_b43, &anorm, "NO", &a[a_offset], lda, &iwork[
00745 1], &iinfo);
00746
00747 } else if (itype == 8) {
00748
00749
00750
00751
00752 i__3 = 0, i__4 = n - 1;
00753 ka = max(i__3,i__4);
00754 kb = ka;
00755 clatmr_(&n, &n, "S", &iseed[1], "H", &work[1], &c__6, &c_b33,
00756 &c_b2, "T", "N", &work[n + 1], &c__1, &c_b33, &work[(
00757 n << 1) + 1], &c__1, &c_b33, "N", idumma, &n, &n, &
00758 c_b43, &anorm, "NO", &a[a_offset], lda, &iwork[1], &
00759 iinfo);
00760
00761 } else if (itype == 9) {
00762
00763
00764
00765
00766
00767
00768
00769
00770
00771
00772
00773
00774 ++kb9;
00775 if (kb9 > ka9) {
00776 ++ka9;
00777 kb9 = 1;
00778 }
00779
00780
00781 i__5 = n - 1;
00782 i__3 = 0, i__4 = min(i__5,ka9);
00783 ka = max(i__3,i__4);
00784
00785
00786 i__5 = n - 1;
00787 i__3 = 0, i__4 = min(i__5,kb9);
00788 kb = max(i__3,i__4);
00789 clatms_(&n, &n, "S", &iseed[1], "H", &rwork[1], &imode, &cond,
00790 &anorm, &ka, &ka, "N", &a[a_offset], lda, &work[1], &
00791 iinfo);
00792
00793 } else {
00794
00795 iinfo = 1;
00796 }
00797
00798 if (iinfo != 0) {
00799 io___36.ciunit = *nounit;
00800 s_wsfe(&io___36);
00801 do_fio(&c__1, "Generator", (ftnlen)9);
00802 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00803 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00804 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer));
00805 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(integer));
00806 e_wsfe();
00807 *info = abs(iinfo);
00808 return 0;
00809 }
00810
00811 L90:
00812
00813 abstol = unfl + unfl;
00814 if (n <= 1) {
00815 il = 1;
00816 iu = n;
00817 } else {
00818 il = (n - 1) * slarnd_(&c__1, iseed2) + 1;
00819 iu = (n - 1) * slarnd_(&c__1, iseed2) + 1;
00820 if (il > iu) {
00821 itemp = il;
00822 il = iu;
00823 iu = itemp;
00824 }
00825 }
00826
00827
00828
00829
00830
00831
00832
00833
00834
00835 for (ibtype = 1; ibtype <= 3; ++ibtype) {
00836
00837
00838
00839 for (ibuplo = 1; ibuplo <= 2; ++ibuplo) {
00840 if (ibuplo == 1) {
00841 *(unsigned char *)uplo = 'U';
00842 }
00843 if (ibuplo == 2) {
00844 *(unsigned char *)uplo = 'L';
00845 }
00846
00847
00848
00849
00850 clatms_(&n, &n, "U", &iseed[1], "P", &rwork[1], &c__5, &
00851 c_b78, &c_b33, &kb, &kb, uplo, &b[b_offset], ldb,
00852 &work[n + 1], &iinfo);
00853
00854
00855
00856 ++ntest;
00857
00858 clacpy_(" ", &n, &n, &a[a_offset], lda, &z__[z_offset],
00859 ldz);
00860 clacpy_(uplo, &n, &n, &b[b_offset], ldb, &bb[bb_offset],
00861 ldb);
00862
00863 chegv_(&ibtype, "V", uplo, &n, &z__[z_offset], ldz, &bb[
00864 bb_offset], ldb, &d__[1], &work[1], nwork, &rwork[
00865 1], &iinfo);
00866 if (iinfo != 0) {
00867 io___44.ciunit = *nounit;
00868 s_wsfe(&io___44);
00869
00870 i__6[0] = 8, a__1[0] = "CHEGV(V,";
00871 i__6[1] = 1, a__1[1] = uplo;
00872 i__6[2] = 1, a__1[2] = ")";
00873 s_cat(ch__1, a__1, i__6, &c__3, (ftnlen)10);
00874 do_fio(&c__1, ch__1, (ftnlen)10);
00875 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00876 ;
00877 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00878 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
00879 ;
00880 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
00881 integer));
00882 e_wsfe();
00883 *info = abs(iinfo);
00884 if (iinfo < 0) {
00885 return 0;
00886 } else {
00887 result[ntest] = ulpinv;
00888 goto L100;
00889 }
00890 }
00891
00892
00893
00894 csgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
00895 b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
00896 work[1], &rwork[1], &result[ntest]);
00897
00898
00899
00900 ++ntest;
00901
00902 clacpy_(" ", &n, &n, &a[a_offset], lda, &z__[z_offset],
00903 ldz);
00904 clacpy_(uplo, &n, &n, &b[b_offset], ldb, &bb[bb_offset],
00905 ldb);
00906
00907 chegvd_(&ibtype, "V", uplo, &n, &z__[z_offset], ldz, &bb[
00908 bb_offset], ldb, &d__[1], &work[1], nwork, &rwork[
00909 1], lrwork, &iwork[1], liwork, &iinfo);
00910 if (iinfo != 0) {
00911 io___45.ciunit = *nounit;
00912 s_wsfe(&io___45);
00913
00914 i__6[0] = 9, a__1[0] = "CHEGVD(V,";
00915 i__6[1] = 1, a__1[1] = uplo;
00916 i__6[2] = 1, a__1[2] = ")";
00917 s_cat(ch__2, a__1, i__6, &c__3, (ftnlen)11);
00918 do_fio(&c__1, ch__2, (ftnlen)11);
00919 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00920 ;
00921 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00922 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
00923 ;
00924 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
00925 integer));
00926 e_wsfe();
00927 *info = abs(iinfo);
00928 if (iinfo < 0) {
00929 return 0;
00930 } else {
00931 result[ntest] = ulpinv;
00932 goto L100;
00933 }
00934 }
00935
00936
00937
00938 csgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
00939 b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
00940 work[1], &rwork[1], &result[ntest]);
00941
00942
00943
00944 ++ntest;
00945
00946 clacpy_(" ", &n, &n, &a[a_offset], lda, &ab[ab_offset],
00947 lda);
00948 clacpy_(uplo, &n, &n, &b[b_offset], ldb, &bb[bb_offset],
00949 ldb);
00950
00951 chegvx_(&ibtype, "V", "A", uplo, &n, &ab[ab_offset], lda,
00952 &bb[bb_offset], ldb, &vl, &vu, &il, &iu, &abstol,
00953 &m, &d__[1], &z__[z_offset], ldz, &work[1], nwork,
00954 &rwork[1], &iwork[n + 1], &iwork[1], &iinfo);
00955 if (iinfo != 0) {
00956 io___49.ciunit = *nounit;
00957 s_wsfe(&io___49);
00958
00959 i__6[0] = 10, a__1[0] = "CHEGVX(V,A";
00960 i__6[1] = 1, a__1[1] = uplo;
00961 i__6[2] = 1, a__1[2] = ")";
00962 s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
00963 do_fio(&c__1, ch__3, (ftnlen)12);
00964 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
00965 ;
00966 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00967 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
00968 ;
00969 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
00970 integer));
00971 e_wsfe();
00972 *info = abs(iinfo);
00973 if (iinfo < 0) {
00974 return 0;
00975 } else {
00976 result[ntest] = ulpinv;
00977 goto L100;
00978 }
00979 }
00980
00981
00982
00983 csgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
00984 b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
00985 work[1], &rwork[1], &result[ntest]);
00986
00987 ++ntest;
00988
00989 clacpy_(" ", &n, &n, &a[a_offset], lda, &ab[ab_offset],
00990 lda);
00991 clacpy_(uplo, &n, &n, &b[b_offset], ldb, &bb[bb_offset],
00992 ldb);
00993
00994
00995
00996
00997
00998
00999 vl = 0.f;
01000 vu = anorm;
01001 chegvx_(&ibtype, "V", "V", uplo, &n, &ab[ab_offset], lda,
01002 &bb[bb_offset], ldb, &vl, &vu, &il, &iu, &abstol,
01003 &m, &d__[1], &z__[z_offset], ldz, &work[1], nwork,
01004 &rwork[1], &iwork[n + 1], &iwork[1], &iinfo);
01005 if (iinfo != 0) {
01006 io___50.ciunit = *nounit;
01007 s_wsfe(&io___50);
01008
01009 i__6[0] = 11, a__1[0] = "CHEGVX(V,V,";
01010 i__6[1] = 1, a__1[1] = uplo;
01011 i__6[2] = 1, a__1[2] = ")";
01012 s_cat(ch__4, a__1, i__6, &c__3, (ftnlen)13);
01013 do_fio(&c__1, ch__4, (ftnlen)13);
01014 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01015 ;
01016 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01017 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01018 ;
01019 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01020 integer));
01021 e_wsfe();
01022 *info = abs(iinfo);
01023 if (iinfo < 0) {
01024 return 0;
01025 } else {
01026 result[ntest] = ulpinv;
01027 goto L100;
01028 }
01029 }
01030
01031
01032
01033 csgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01034 b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01035 work[1], &rwork[1], &result[ntest]);
01036
01037 ++ntest;
01038
01039 clacpy_(" ", &n, &n, &a[a_offset], lda, &ab[ab_offset],
01040 lda);
01041 clacpy_(uplo, &n, &n, &b[b_offset], ldb, &bb[bb_offset],
01042 ldb);
01043
01044 chegvx_(&ibtype, "V", "I", uplo, &n, &ab[ab_offset], lda,
01045 &bb[bb_offset], ldb, &vl, &vu, &il, &iu, &abstol,
01046 &m, &d__[1], &z__[z_offset], ldz, &work[1], nwork,
01047 &rwork[1], &iwork[n + 1], &iwork[1], &iinfo);
01048 if (iinfo != 0) {
01049 io___51.ciunit = *nounit;
01050 s_wsfe(&io___51);
01051
01052 i__6[0] = 11, a__1[0] = "CHEGVX(V,I,";
01053 i__6[1] = 1, a__1[1] = uplo;
01054 i__6[2] = 1, a__1[2] = ")";
01055 s_cat(ch__4, a__1, i__6, &c__3, (ftnlen)13);
01056 do_fio(&c__1, ch__4, (ftnlen)13);
01057 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01058 ;
01059 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01060 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01061 ;
01062 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01063 integer));
01064 e_wsfe();
01065 *info = abs(iinfo);
01066 if (iinfo < 0) {
01067 return 0;
01068 } else {
01069 result[ntest] = ulpinv;
01070 goto L100;
01071 }
01072 }
01073
01074
01075
01076 csgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01077 b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01078 work[1], &rwork[1], &result[ntest]);
01079
01080 L100:
01081
01082
01083
01084 ++ntest;
01085
01086
01087
01088 if (lsame_(uplo, "U")) {
01089 ij = 1;
01090 i__3 = n;
01091 for (j = 1; j <= i__3; ++j) {
01092 i__4 = j;
01093 for (i__ = 1; i__ <= i__4; ++i__) {
01094 i__5 = ij;
01095 i__7 = i__ + j * a_dim1;
01096 ap[i__5].r = a[i__7].r, ap[i__5].i = a[i__7]
01097 .i;
01098 i__5 = ij;
01099 i__7 = i__ + j * b_dim1;
01100 bp[i__5].r = b[i__7].r, bp[i__5].i = b[i__7]
01101 .i;
01102 ++ij;
01103
01104 }
01105
01106 }
01107 } else {
01108 ij = 1;
01109 i__3 = n;
01110 for (j = 1; j <= i__3; ++j) {
01111 i__4 = n;
01112 for (i__ = j; i__ <= i__4; ++i__) {
01113 i__5 = ij;
01114 i__7 = i__ + j * a_dim1;
01115 ap[i__5].r = a[i__7].r, ap[i__5].i = a[i__7]
01116 .i;
01117 i__5 = ij;
01118 i__7 = i__ + j * b_dim1;
01119 bp[i__5].r = b[i__7].r, bp[i__5].i = b[i__7]
01120 .i;
01121 ++ij;
01122
01123 }
01124
01125 }
01126 }
01127
01128 chpgv_(&ibtype, "V", uplo, &n, &ap[1], &bp[1], &d__[1], &
01129 z__[z_offset], ldz, &work[1], &rwork[1], &iinfo);
01130 if (iinfo != 0) {
01131 io___53.ciunit = *nounit;
01132 s_wsfe(&io___53);
01133
01134 i__6[0] = 8, a__1[0] = "CHPGV(V,";
01135 i__6[1] = 1, a__1[1] = uplo;
01136 i__6[2] = 1, a__1[2] = ")";
01137 s_cat(ch__1, a__1, i__6, &c__3, (ftnlen)10);
01138 do_fio(&c__1, ch__1, (ftnlen)10);
01139 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01140 ;
01141 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01142 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01143 ;
01144 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01145 integer));
01146 e_wsfe();
01147 *info = abs(iinfo);
01148 if (iinfo < 0) {
01149 return 0;
01150 } else {
01151 result[ntest] = ulpinv;
01152 goto L310;
01153 }
01154 }
01155
01156
01157
01158 csgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
01159 b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01160 work[1], &rwork[1], &result[ntest]);
01161
01162
01163
01164 ++ntest;
01165
01166
01167
01168 if (lsame_(uplo, "U")) {
01169 ij = 1;
01170 i__3 = n;
01171 for (j = 1; j <= i__3; ++j) {
01172 i__4 = j;
01173 for (i__ = 1; i__ <= i__4; ++i__) {
01174 i__5 = ij;
01175 i__7 = i__ + j * a_dim1;
01176 ap[i__5].r = a[i__7].r, ap[i__5].i = a[i__7]
01177 .i;
01178 i__5 = ij;
01179 i__7 = i__ + j * b_dim1;
01180 bp[i__5].r = b[i__7].r, bp[i__5].i = b[i__7]
01181 .i;
01182 ++ij;
01183
01184 }
01185
01186 }
01187 } else {
01188 ij = 1;
01189 i__3 = n;
01190 for (j = 1; j <= i__3; ++j) {
01191 i__4 = n;
01192 for (i__ = j; i__ <= i__4; ++i__) {
01193 i__5 = ij;
01194 i__7 = i__ + j * a_dim1;
01195 ap[i__5].r = a[i__7].r, ap[i__5].i = a[i__7]
01196 .i;
01197 i__5 = ij;
01198 i__7 = i__ + j * b_dim1;
01199 bp[i__5].r = b[i__7].r, bp[i__5].i = b[i__7]
01200 .i;
01201 ++ij;
01202
01203 }
01204
01205 }
01206 }
01207
01208 chpgvd_(&ibtype, "V", uplo, &n, &ap[1], &bp[1], &d__[1], &
01209 z__[z_offset], ldz, &work[1], nwork, &rwork[1],
01210 lrwork, &iwork[1], liwork, &iinfo);
01211 if (iinfo != 0) {
01212 io___54.ciunit = *nounit;
01213 s_wsfe(&io___54);
01214
01215 i__6[0] = 9, a__1[0] = "CHPGVD(V,";
01216 i__6[1] = 1, a__1[1] = uplo;
01217 i__6[2] = 1, a__1[2] = ")";
01218 s_cat(ch__2, a__1, i__6, &c__3, (ftnlen)11);
01219 do_fio(&c__1, ch__2, (ftnlen)11);
01220 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01221 ;
01222 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01223 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01224 ;
01225 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01226 integer));
01227 e_wsfe();
01228 *info = abs(iinfo);
01229 if (iinfo < 0) {
01230 return 0;
01231 } else {
01232 result[ntest] = ulpinv;
01233 goto L310;
01234 }
01235 }
01236
01237
01238
01239 csgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
01240 b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01241 work[1], &rwork[1], &result[ntest]);
01242
01243
01244
01245 ++ntest;
01246
01247
01248
01249 if (lsame_(uplo, "U")) {
01250 ij = 1;
01251 i__3 = n;
01252 for (j = 1; j <= i__3; ++j) {
01253 i__4 = j;
01254 for (i__ = 1; i__ <= i__4; ++i__) {
01255 i__5 = ij;
01256 i__7 = i__ + j * a_dim1;
01257 ap[i__5].r = a[i__7].r, ap[i__5].i = a[i__7]
01258 .i;
01259 i__5 = ij;
01260 i__7 = i__ + j * b_dim1;
01261 bp[i__5].r = b[i__7].r, bp[i__5].i = b[i__7]
01262 .i;
01263 ++ij;
01264
01265 }
01266
01267 }
01268 } else {
01269 ij = 1;
01270 i__3 = n;
01271 for (j = 1; j <= i__3; ++j) {
01272 i__4 = n;
01273 for (i__ = j; i__ <= i__4; ++i__) {
01274 i__5 = ij;
01275 i__7 = i__ + j * a_dim1;
01276 ap[i__5].r = a[i__7].r, ap[i__5].i = a[i__7]
01277 .i;
01278 i__5 = ij;
01279 i__7 = i__ + j * b_dim1;
01280 bp[i__5].r = b[i__7].r, bp[i__5].i = b[i__7]
01281 .i;
01282 ++ij;
01283
01284 }
01285
01286 }
01287 }
01288
01289 chpgvx_(&ibtype, "V", "A", uplo, &n, &ap[1], &bp[1], &vl,
01290 &vu, &il, &iu, &abstol, &m, &d__[1], &z__[
01291 z_offset], ldz, &work[1], &rwork[1], &iwork[n + 1]
01292 , &iwork[1], info);
01293 if (iinfo != 0) {
01294 io___55.ciunit = *nounit;
01295 s_wsfe(&io___55);
01296
01297 i__6[0] = 10, a__1[0] = "CHPGVX(V,A";
01298 i__6[1] = 1, a__1[1] = uplo;
01299 i__6[2] = 1, a__1[2] = ")";
01300 s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
01301 do_fio(&c__1, ch__3, (ftnlen)12);
01302 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01303 ;
01304 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01305 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01306 ;
01307 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01308 integer));
01309 e_wsfe();
01310 *info = abs(iinfo);
01311 if (iinfo < 0) {
01312 return 0;
01313 } else {
01314 result[ntest] = ulpinv;
01315 goto L310;
01316 }
01317 }
01318
01319
01320
01321 csgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
01322 b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01323 work[1], &rwork[1], &result[ntest]);
01324
01325 ++ntest;
01326
01327
01328
01329 if (lsame_(uplo, "U")) {
01330 ij = 1;
01331 i__3 = n;
01332 for (j = 1; j <= i__3; ++j) {
01333 i__4 = j;
01334 for (i__ = 1; i__ <= i__4; ++i__) {
01335 i__5 = ij;
01336 i__7 = i__ + j * a_dim1;
01337 ap[i__5].r = a[i__7].r, ap[i__5].i = a[i__7]
01338 .i;
01339 i__5 = ij;
01340 i__7 = i__ + j * b_dim1;
01341 bp[i__5].r = b[i__7].r, bp[i__5].i = b[i__7]
01342 .i;
01343 ++ij;
01344
01345 }
01346
01347 }
01348 } else {
01349 ij = 1;
01350 i__3 = n;
01351 for (j = 1; j <= i__3; ++j) {
01352 i__4 = n;
01353 for (i__ = j; i__ <= i__4; ++i__) {
01354 i__5 = ij;
01355 i__7 = i__ + j * a_dim1;
01356 ap[i__5].r = a[i__7].r, ap[i__5].i = a[i__7]
01357 .i;
01358 i__5 = ij;
01359 i__7 = i__ + j * b_dim1;
01360 bp[i__5].r = b[i__7].r, bp[i__5].i = b[i__7]
01361 .i;
01362 ++ij;
01363
01364 }
01365
01366 }
01367 }
01368
01369 vl = 0.f;
01370 vu = anorm;
01371 chpgvx_(&ibtype, "V", "V", uplo, &n, &ap[1], &bp[1], &vl,
01372 &vu, &il, &iu, &abstol, &m, &d__[1], &z__[
01373 z_offset], ldz, &work[1], &rwork[1], &iwork[n + 1]
01374 , &iwork[1], info);
01375 if (iinfo != 0) {
01376 io___56.ciunit = *nounit;
01377 s_wsfe(&io___56);
01378
01379 i__6[0] = 10, a__1[0] = "CHPGVX(V,V";
01380 i__6[1] = 1, a__1[1] = uplo;
01381 i__6[2] = 1, a__1[2] = ")";
01382 s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
01383 do_fio(&c__1, ch__3, (ftnlen)12);
01384 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01385 ;
01386 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01387 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01388 ;
01389 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01390 integer));
01391 e_wsfe();
01392 *info = abs(iinfo);
01393 if (iinfo < 0) {
01394 return 0;
01395 } else {
01396 result[ntest] = ulpinv;
01397 goto L310;
01398 }
01399 }
01400
01401
01402
01403 csgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01404 b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01405 work[1], &rwork[1], &result[ntest]);
01406
01407 ++ntest;
01408
01409
01410
01411 if (lsame_(uplo, "U")) {
01412 ij = 1;
01413 i__3 = n;
01414 for (j = 1; j <= i__3; ++j) {
01415 i__4 = j;
01416 for (i__ = 1; i__ <= i__4; ++i__) {
01417 i__5 = ij;
01418 i__7 = i__ + j * a_dim1;
01419 ap[i__5].r = a[i__7].r, ap[i__5].i = a[i__7]
01420 .i;
01421 i__5 = ij;
01422 i__7 = i__ + j * b_dim1;
01423 bp[i__5].r = b[i__7].r, bp[i__5].i = b[i__7]
01424 .i;
01425 ++ij;
01426
01427 }
01428
01429 }
01430 } else {
01431 ij = 1;
01432 i__3 = n;
01433 for (j = 1; j <= i__3; ++j) {
01434 i__4 = n;
01435 for (i__ = j; i__ <= i__4; ++i__) {
01436 i__5 = ij;
01437 i__7 = i__ + j * a_dim1;
01438 ap[i__5].r = a[i__7].r, ap[i__5].i = a[i__7]
01439 .i;
01440 i__5 = ij;
01441 i__7 = i__ + j * b_dim1;
01442 bp[i__5].r = b[i__7].r, bp[i__5].i = b[i__7]
01443 .i;
01444 ++ij;
01445
01446 }
01447
01448 }
01449 }
01450
01451 chpgvx_(&ibtype, "V", "I", uplo, &n, &ap[1], &bp[1], &vl,
01452 &vu, &il, &iu, &abstol, &m, &d__[1], &z__[
01453 z_offset], ldz, &work[1], &rwork[1], &iwork[n + 1]
01454 , &iwork[1], info);
01455 if (iinfo != 0) {
01456 io___57.ciunit = *nounit;
01457 s_wsfe(&io___57);
01458
01459 i__6[0] = 10, a__1[0] = "CHPGVX(V,I";
01460 i__6[1] = 1, a__1[1] = uplo;
01461 i__6[2] = 1, a__1[2] = ")";
01462 s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
01463 do_fio(&c__1, ch__3, (ftnlen)12);
01464 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer))
01465 ;
01466 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
01467 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(integer))
01468 ;
01469 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01470 integer));
01471 e_wsfe();
01472 *info = abs(iinfo);
01473 if (iinfo < 0) {
01474 return 0;
01475 } else {
01476 result[ntest] = ulpinv;
01477 goto L310;
01478 }
01479 }
01480
01481
01482
01483 csgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01484 b_offset], ldb, &z__[z_offset], ldz, &d__[1], &
01485 work[1], &rwork[1], &result[ntest]);
01486
01487 L310:
01488
01489 if (ibtype == 1) {
01490
01491
01492
01493 ++ntest;
01494
01495
01496
01497 if (lsame_(uplo, "U")) {
01498 i__3 = n;
01499 for (j = 1; j <= i__3; ++j) {
01500
01501 i__4 = 1, i__5 = j - ka;
01502 i__7 = j;
01503 for (i__ = max(i__4,i__5); i__ <= i__7; ++i__)
01504 {
01505 i__4 = ka + 1 + i__ - j + j * ab_dim1;
01506 i__5 = i__ + j * a_dim1;
01507 ab[i__4].r = a[i__5].r, ab[i__4].i = a[
01508 i__5].i;
01509
01510 }
01511
01512 i__7 = 1, i__4 = j - kb;
01513 i__5 = j;
01514 for (i__ = max(i__7,i__4); i__ <= i__5; ++i__)
01515 {
01516 i__7 = kb + 1 + i__ - j + j * bb_dim1;
01517 i__4 = i__ + j * b_dim1;
01518 bb[i__7].r = b[i__4].r, bb[i__7].i = b[
01519 i__4].i;
01520
01521 }
01522
01523 }
01524 } else {
01525 i__3 = n;
01526 for (j = 1; j <= i__3; ++j) {
01527
01528 i__7 = n, i__4 = j + ka;
01529 i__5 = min(i__7,i__4);
01530 for (i__ = j; i__ <= i__5; ++i__) {
01531 i__7 = i__ + 1 - j + j * ab_dim1;
01532 i__4 = i__ + j * a_dim1;
01533 ab[i__7].r = a[i__4].r, ab[i__7].i = a[
01534 i__4].i;
01535
01536 }
01537
01538 i__7 = n, i__4 = j + kb;
01539 i__5 = min(i__7,i__4);
01540 for (i__ = j; i__ <= i__5; ++i__) {
01541 i__7 = i__ + 1 - j + j * bb_dim1;
01542 i__4 = i__ + j * b_dim1;
01543 bb[i__7].r = b[i__4].r, bb[i__7].i = b[
01544 i__4].i;
01545
01546 }
01547
01548 }
01549 }
01550
01551 chbgv_("V", uplo, &n, &ka, &kb, &ab[ab_offset], lda, &
01552 bb[bb_offset], ldb, &d__[1], &z__[z_offset],
01553 ldz, &work[1], &rwork[1], &iinfo);
01554 if (iinfo != 0) {
01555 io___58.ciunit = *nounit;
01556 s_wsfe(&io___58);
01557
01558 i__6[0] = 8, a__1[0] = "CHBGV(V,";
01559 i__6[1] = 1, a__1[1] = uplo;
01560 i__6[2] = 1, a__1[2] = ")";
01561 s_cat(ch__1, a__1, i__6, &c__3, (ftnlen)10);
01562 do_fio(&c__1, ch__1, (ftnlen)10);
01563 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(
01564 integer));
01565 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
01566 ;
01567 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(
01568 integer));
01569 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01570 integer));
01571 e_wsfe();
01572 *info = abs(iinfo);
01573 if (iinfo < 0) {
01574 return 0;
01575 } else {
01576 result[ntest] = ulpinv;
01577 goto L620;
01578 }
01579 }
01580
01581
01582
01583 csgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
01584 b_offset], ldb, &z__[z_offset], ldz, &d__[1],
01585 &work[1], &rwork[1], &result[ntest]);
01586
01587
01588
01589 ++ntest;
01590
01591
01592
01593 if (lsame_(uplo, "U")) {
01594 i__3 = n;
01595 for (j = 1; j <= i__3; ++j) {
01596
01597 i__5 = 1, i__7 = j - ka;
01598 i__4 = j;
01599 for (i__ = max(i__5,i__7); i__ <= i__4; ++i__)
01600 {
01601 i__5 = ka + 1 + i__ - j + j * ab_dim1;
01602 i__7 = i__ + j * a_dim1;
01603 ab[i__5].r = a[i__7].r, ab[i__5].i = a[
01604 i__7].i;
01605
01606 }
01607
01608 i__4 = 1, i__5 = j - kb;
01609 i__7 = j;
01610 for (i__ = max(i__4,i__5); i__ <= i__7; ++i__)
01611 {
01612 i__4 = kb + 1 + i__ - j + j * bb_dim1;
01613 i__5 = i__ + j * b_dim1;
01614 bb[i__4].r = b[i__5].r, bb[i__4].i = b[
01615 i__5].i;
01616
01617 }
01618
01619 }
01620 } else {
01621 i__3 = n;
01622 for (j = 1; j <= i__3; ++j) {
01623
01624 i__4 = n, i__5 = j + ka;
01625 i__7 = min(i__4,i__5);
01626 for (i__ = j; i__ <= i__7; ++i__) {
01627 i__4 = i__ + 1 - j + j * ab_dim1;
01628 i__5 = i__ + j * a_dim1;
01629 ab[i__4].r = a[i__5].r, ab[i__4].i = a[
01630 i__5].i;
01631
01632 }
01633
01634 i__4 = n, i__5 = j + kb;
01635 i__7 = min(i__4,i__5);
01636 for (i__ = j; i__ <= i__7; ++i__) {
01637 i__4 = i__ + 1 - j + j * bb_dim1;
01638 i__5 = i__ + j * b_dim1;
01639 bb[i__4].r = b[i__5].r, bb[i__4].i = b[
01640 i__5].i;
01641
01642 }
01643
01644 }
01645 }
01646
01647 chbgvd_("V", uplo, &n, &ka, &kb, &ab[ab_offset], lda,
01648 &bb[bb_offset], ldb, &d__[1], &z__[z_offset],
01649 ldz, &work[1], nwork, &rwork[1], lrwork, &
01650 iwork[1], liwork, &iinfo);
01651 if (iinfo != 0) {
01652 io___59.ciunit = *nounit;
01653 s_wsfe(&io___59);
01654
01655 i__6[0] = 9, a__1[0] = "CHBGVD(V,";
01656 i__6[1] = 1, a__1[1] = uplo;
01657 i__6[2] = 1, a__1[2] = ")";
01658 s_cat(ch__2, a__1, i__6, &c__3, (ftnlen)11);
01659 do_fio(&c__1, ch__2, (ftnlen)11);
01660 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(
01661 integer));
01662 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
01663 ;
01664 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(
01665 integer));
01666 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01667 integer));
01668 e_wsfe();
01669 *info = abs(iinfo);
01670 if (iinfo < 0) {
01671 return 0;
01672 } else {
01673 result[ntest] = ulpinv;
01674 goto L620;
01675 }
01676 }
01677
01678
01679
01680 csgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
01681 b_offset], ldb, &z__[z_offset], ldz, &d__[1],
01682 &work[1], &rwork[1], &result[ntest]);
01683
01684
01685
01686 ++ntest;
01687
01688
01689
01690 if (lsame_(uplo, "U")) {
01691 i__3 = n;
01692 for (j = 1; j <= i__3; ++j) {
01693
01694 i__7 = 1, i__4 = j - ka;
01695 i__5 = j;
01696 for (i__ = max(i__7,i__4); i__ <= i__5; ++i__)
01697 {
01698 i__7 = ka + 1 + i__ - j + j * ab_dim1;
01699 i__4 = i__ + j * a_dim1;
01700 ab[i__7].r = a[i__4].r, ab[i__7].i = a[
01701 i__4].i;
01702
01703 }
01704
01705 i__5 = 1, i__7 = j - kb;
01706 i__4 = j;
01707 for (i__ = max(i__5,i__7); i__ <= i__4; ++i__)
01708 {
01709 i__5 = kb + 1 + i__ - j + j * bb_dim1;
01710 i__7 = i__ + j * b_dim1;
01711 bb[i__5].r = b[i__7].r, bb[i__5].i = b[
01712 i__7].i;
01713
01714 }
01715
01716 }
01717 } else {
01718 i__3 = n;
01719 for (j = 1; j <= i__3; ++j) {
01720
01721 i__5 = n, i__7 = j + ka;
01722 i__4 = min(i__5,i__7);
01723 for (i__ = j; i__ <= i__4; ++i__) {
01724 i__5 = i__ + 1 - j + j * ab_dim1;
01725 i__7 = i__ + j * a_dim1;
01726 ab[i__5].r = a[i__7].r, ab[i__5].i = a[
01727 i__7].i;
01728
01729 }
01730
01731 i__5 = n, i__7 = j + kb;
01732 i__4 = min(i__5,i__7);
01733 for (i__ = j; i__ <= i__4; ++i__) {
01734 i__5 = i__ + 1 - j + j * bb_dim1;
01735 i__7 = i__ + j * b_dim1;
01736 bb[i__5].r = b[i__7].r, bb[i__5].i = b[
01737 i__7].i;
01738
01739 }
01740
01741 }
01742 }
01743
01744 i__3 = max(1,n);
01745 chbgvx_("V", "A", uplo, &n, &ka, &kb, &ab[ab_offset],
01746 lda, &bb[bb_offset], ldb, &bp[1], &i__3, &vl,
01747 &vu, &il, &iu, &abstol, &m, &d__[1], &z__[
01748 z_offset], ldz, &work[1], &rwork[1], &iwork[n
01749 + 1], &iwork[1], &iinfo);
01750 if (iinfo != 0) {
01751 io___60.ciunit = *nounit;
01752 s_wsfe(&io___60);
01753
01754 i__6[0] = 10, a__1[0] = "CHBGVX(V,A";
01755 i__6[1] = 1, a__1[1] = uplo;
01756 i__6[2] = 1, a__1[2] = ")";
01757 s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
01758 do_fio(&c__1, ch__3, (ftnlen)12);
01759 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(
01760 integer));
01761 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
01762 ;
01763 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(
01764 integer));
01765 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01766 integer));
01767 e_wsfe();
01768 *info = abs(iinfo);
01769 if (iinfo < 0) {
01770 return 0;
01771 } else {
01772 result[ntest] = ulpinv;
01773 goto L620;
01774 }
01775 }
01776
01777
01778
01779 csgt01_(&ibtype, uplo, &n, &n, &a[a_offset], lda, &b[
01780 b_offset], ldb, &z__[z_offset], ldz, &d__[1],
01781 &work[1], &rwork[1], &result[ntest]);
01782
01783 ++ntest;
01784
01785
01786
01787 if (lsame_(uplo, "U")) {
01788 i__3 = n;
01789 for (j = 1; j <= i__3; ++j) {
01790
01791 i__4 = 1, i__5 = j - ka;
01792 i__7 = j;
01793 for (i__ = max(i__4,i__5); i__ <= i__7; ++i__)
01794 {
01795 i__4 = ka + 1 + i__ - j + j * ab_dim1;
01796 i__5 = i__ + j * a_dim1;
01797 ab[i__4].r = a[i__5].r, ab[i__4].i = a[
01798 i__5].i;
01799
01800 }
01801
01802 i__7 = 1, i__4 = j - kb;
01803 i__5 = j;
01804 for (i__ = max(i__7,i__4); i__ <= i__5; ++i__)
01805 {
01806 i__7 = kb + 1 + i__ - j + j * bb_dim1;
01807 i__4 = i__ + j * b_dim1;
01808 bb[i__7].r = b[i__4].r, bb[i__7].i = b[
01809 i__4].i;
01810
01811 }
01812
01813 }
01814 } else {
01815 i__3 = n;
01816 for (j = 1; j <= i__3; ++j) {
01817
01818 i__7 = n, i__4 = j + ka;
01819 i__5 = min(i__7,i__4);
01820 for (i__ = j; i__ <= i__5; ++i__) {
01821 i__7 = i__ + 1 - j + j * ab_dim1;
01822 i__4 = i__ + j * a_dim1;
01823 ab[i__7].r = a[i__4].r, ab[i__7].i = a[
01824 i__4].i;
01825
01826 }
01827
01828 i__7 = n, i__4 = j + kb;
01829 i__5 = min(i__7,i__4);
01830 for (i__ = j; i__ <= i__5; ++i__) {
01831 i__7 = i__ + 1 - j + j * bb_dim1;
01832 i__4 = i__ + j * b_dim1;
01833 bb[i__7].r = b[i__4].r, bb[i__7].i = b[
01834 i__4].i;
01835
01836 }
01837
01838 }
01839 }
01840
01841 vl = 0.f;
01842 vu = anorm;
01843 i__3 = max(1,n);
01844 chbgvx_("V", "V", uplo, &n, &ka, &kb, &ab[ab_offset],
01845 lda, &bb[bb_offset], ldb, &bp[1], &i__3, &vl,
01846 &vu, &il, &iu, &abstol, &m, &d__[1], &z__[
01847 z_offset], ldz, &work[1], &rwork[1], &iwork[n
01848 + 1], &iwork[1], &iinfo);
01849 if (iinfo != 0) {
01850 io___61.ciunit = *nounit;
01851 s_wsfe(&io___61);
01852
01853 i__6[0] = 10, a__1[0] = "CHBGVX(V,V";
01854 i__6[1] = 1, a__1[1] = uplo;
01855 i__6[2] = 1, a__1[2] = ")";
01856 s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
01857 do_fio(&c__1, ch__3, (ftnlen)12);
01858 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(
01859 integer));
01860 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
01861 ;
01862 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(
01863 integer));
01864 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01865 integer));
01866 e_wsfe();
01867 *info = abs(iinfo);
01868 if (iinfo < 0) {
01869 return 0;
01870 } else {
01871 result[ntest] = ulpinv;
01872 goto L620;
01873 }
01874 }
01875
01876
01877
01878 csgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01879 b_offset], ldb, &z__[z_offset], ldz, &d__[1],
01880 &work[1], &rwork[1], &result[ntest]);
01881
01882 ++ntest;
01883
01884
01885
01886 if (lsame_(uplo, "U")) {
01887 i__3 = n;
01888 for (j = 1; j <= i__3; ++j) {
01889
01890 i__5 = 1, i__7 = j - ka;
01891 i__4 = j;
01892 for (i__ = max(i__5,i__7); i__ <= i__4; ++i__)
01893 {
01894 i__5 = ka + 1 + i__ - j + j * ab_dim1;
01895 i__7 = i__ + j * a_dim1;
01896 ab[i__5].r = a[i__7].r, ab[i__5].i = a[
01897 i__7].i;
01898
01899 }
01900
01901 i__4 = 1, i__5 = j - kb;
01902 i__7 = j;
01903 for (i__ = max(i__4,i__5); i__ <= i__7; ++i__)
01904 {
01905 i__4 = kb + 1 + i__ - j + j * bb_dim1;
01906 i__5 = i__ + j * b_dim1;
01907 bb[i__4].r = b[i__5].r, bb[i__4].i = b[
01908 i__5].i;
01909
01910 }
01911
01912 }
01913 } else {
01914 i__3 = n;
01915 for (j = 1; j <= i__3; ++j) {
01916
01917 i__4 = n, i__5 = j + ka;
01918 i__7 = min(i__4,i__5);
01919 for (i__ = j; i__ <= i__7; ++i__) {
01920 i__4 = i__ + 1 - j + j * ab_dim1;
01921 i__5 = i__ + j * a_dim1;
01922 ab[i__4].r = a[i__5].r, ab[i__4].i = a[
01923 i__5].i;
01924
01925 }
01926
01927 i__4 = n, i__5 = j + kb;
01928 i__7 = min(i__4,i__5);
01929 for (i__ = j; i__ <= i__7; ++i__) {
01930 i__4 = i__ + 1 - j + j * bb_dim1;
01931 i__5 = i__ + j * b_dim1;
01932 bb[i__4].r = b[i__5].r, bb[i__4].i = b[
01933 i__5].i;
01934
01935 }
01936
01937 }
01938 }
01939
01940 i__3 = max(1,n);
01941 chbgvx_("V", "I", uplo, &n, &ka, &kb, &ab[ab_offset],
01942 lda, &bb[bb_offset], ldb, &bp[1], &i__3, &vl,
01943 &vu, &il, &iu, &abstol, &m, &d__[1], &z__[
01944 z_offset], ldz, &work[1], &rwork[1], &iwork[n
01945 + 1], &iwork[1], &iinfo);
01946 if (iinfo != 0) {
01947 io___62.ciunit = *nounit;
01948 s_wsfe(&io___62);
01949
01950 i__6[0] = 10, a__1[0] = "CHBGVX(V,I";
01951 i__6[1] = 1, a__1[1] = uplo;
01952 i__6[2] = 1, a__1[2] = ")";
01953 s_cat(ch__3, a__1, i__6, &c__3, (ftnlen)12);
01954 do_fio(&c__1, ch__3, (ftnlen)12);
01955 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(
01956 integer));
01957 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
01958 ;
01959 do_fio(&c__1, (char *)&jtype, (ftnlen)sizeof(
01960 integer));
01961 do_fio(&c__4, (char *)&ioldsd[0], (ftnlen)sizeof(
01962 integer));
01963 e_wsfe();
01964 *info = abs(iinfo);
01965 if (iinfo < 0) {
01966 return 0;
01967 } else {
01968 result[ntest] = ulpinv;
01969 goto L620;
01970 }
01971 }
01972
01973
01974
01975 csgt01_(&ibtype, uplo, &n, &m, &a[a_offset], lda, &b[
01976 b_offset], ldb, &z__[z_offset], ldz, &d__[1],
01977 &work[1], &rwork[1], &result[ntest]);
01978
01979 }
01980
01981 L620:
01982 ;
01983 }
01984
01985 }
01986
01987
01988
01989 ntestt += ntest;
01990 slafts_("CSG", &n, &n, &jtype, &ntest, &result[1], ioldsd, thresh,
01991 nounit, &nerrs);
01992 L640:
01993 ;
01994 }
01995
01996 }
01997
01998
01999
02000 slasum_("CSG", nounit, &nerrs, &ntestt);
02001
02002 return 0;
02003
02004
02005
02006
02007 }