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 integer c__1 = 1;
00019 static integer c__0 = 0;
00020 static doublecomplex c_b11 = {1.,0.};
00021 static integer c__5 = 5;
00022 static logical c_true = TRUE_;
00023 static logical c_false = FALSE_;
00024 static integer c__3 = 3;
00025 static integer c__7 = 7;
00026
00027 int zdrgvx_(integer *nsize, doublereal *thresh, integer *nin,
00028 integer *nout, doublecomplex *a, integer *lda, doublecomplex *b,
00029 doublecomplex *ai, doublecomplex *bi, doublecomplex *alpha,
00030 doublecomplex *beta, doublecomplex *vl, doublecomplex *vr, integer *
00031 ilo, integer *ihi, doublereal *lscale, doublereal *rscale, doublereal
00032 *s, doublereal *dtru, doublereal *dif, doublereal *diftru,
00033 doublecomplex *work, integer *lwork, doublereal *rwork, integer *
00034 iwork, integer *liwork, doublereal *result, logical *bwork, integer *
00035 info)
00036 {
00037
00038 static char fmt_9999[] = "(\002 ZDRGVX: \002,a,\002 returned INFO=\002,i"
00039 "6,\002.\002,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002)\002)";
00040 static char fmt_9998[] = "(\002 ZDRGVX: \002,a,\002 Eigenvectors from"
00041 " \002,a,\002 incorrectly \002,\002normalized.\002,/\002 Bits of "
00042 "error=\002,0p,g10.3,\002,\002,9x,\002N=\002,i6,\002, JTYPE=\002,"
00043 "i6,\002, IWA=\002,i5,\002, IWB=\002,i5,\002, IWX=\002,i5,\002, I"
00044 "WY=\002,i5)";
00045 static char fmt_9997[] = "(/1x,a3,\002 -- Complex Expert Eigenvalue/vect"
00046 "or\002,\002 problem driver\002)";
00047 static char fmt_9995[] = "(\002 Matrix types: \002,/)";
00048 static char fmt_9994[] = "(\002 TYPE 1: Da is diagonal, Db is identity,"
00049 " \002,/\002 A = Y^(-H) Da X^(-1), B = Y^(-H) Db X^(-1) \002,/"
00050 "\002 YH and X are left and right eigenvectors. \002,/)";
00051 static char fmt_9993[] = "(\002 TYPE 2: Da is quasi-diagonal, Db is iden"
00052 "tity, \002,/\002 A = Y^(-H) Da X^(-1), B = Y^(-H) Db X^(-1)"
00053 " \002,/\002 YH and X are left and right eigenvectors. \002,/)"
00054 ;
00055 static char fmt_9992[] = "(/\002 Tests performed: \002,/4x,\002 a is al"
00056 "pha, b is beta, l is a left eigenvector, \002,/4x,\002 r is a ri"
00057 "ght eigenvector and \002,a,\002 means \002,a,\002.\002,/\002 1 ="
00058 " max | ( b A - a B )\002,a,\002 l | / const.\002,/\002 2 = max |"
00059 " ( b A - a B ) r | / const.\002,/\002 3 = max ( Sest/Stru, Stru/"
00060 "Sest ) \002,\002 over all eigenvalues\002,/\002 4 = max( DIFest/"
00061 "DIFtru, DIFtru/DIFest ) \002,\002 over the 1st and 5th eigenvect"
00062 "ors\002,/)";
00063 static char fmt_9991[] = "(\002 Type=\002,i2,\002,\002,\002 IWA=\002,i2"
00064 ",\002, IWB=\002,i2,\002, IWX=\002,i2,\002, IWY=\002,i2,\002, res"
00065 "ult \002,i2,\002 is\002,0p,f8.2)";
00066 static char fmt_9990[] = "(\002 Type=\002,i2,\002,\002,\002 IWA=\002,i2"
00067 ",\002, IWB=\002,i2,\002, IWX=\002,i2,\002, IWY=\002,i2,\002, res"
00068 "ult \002,i2,\002 is\002,1p,d10.3)";
00069 static char fmt_9987[] = "(\002 ZDRGVX: \002,a,\002 returned INFO=\002,i"
00070 "6,\002.\002,/9x,\002N=\002,i6,\002, Input example #\002,i2,\002"
00071 ")\002)";
00072 static char fmt_9986[] = "(\002 ZDRGVX: \002,a,\002 Eigenvectors from"
00073 " \002,a,\002 incorrectly \002,\002normalized.\002,/\002 Bits of "
00074 "error=\002,0p,g10.3,\002,\002,9x,\002N=\002,i6,\002, Input Examp"
00075 "le #\002,i2,\002)\002)";
00076 static char fmt_9996[] = "(\002Input Example\002)";
00077 static char fmt_9989[] = "(\002 Input example #\002,i2,\002, matrix orde"
00078 "r=\002,i4,\002,\002,\002 result \002,i2,\002 is\002,0p,f8.2)";
00079 static char fmt_9988[] = "(\002 Input example #\002,i2,\002, matrix orde"
00080 "r=\002,i4,\002,\002,\002 result \002,i2,\002 is\002,1p,d10.3)";
00081
00082
00083 integer a_dim1, a_offset, ai_dim1, ai_offset, b_dim1, b_offset, bi_dim1,
00084 bi_offset, vl_dim1, vl_offset, vr_dim1, vr_offset, i__1, i__2;
00085 doublereal d__1, d__2, d__3, d__4;
00086 doublecomplex z__1;
00087
00088
00089 double sqrt(doublereal);
00090 void z_div(doublecomplex *, doublecomplex *, doublecomplex *);
00091 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void),
00092 s_rsle(cilist *), do_lio(integer *, integer *, char *, ftnlen),
00093 e_rsle(void);
00094
00095
00096 integer i__, j, n, iwa, iwb;
00097 doublereal ulp;
00098 integer iwx, iwy, nmax, linfo;
00099 doublereal anorm, bnorm;
00100 extern int zget52_(logical *, integer *, doublecomplex *,
00101 integer *, doublecomplex *, integer *, doublecomplex *, integer *
00102 , doublecomplex *, doublecomplex *, doublecomplex *, doublereal *,
00103 doublereal *);
00104 integer nerrs;
00105 doublereal ratio1, ratio2, thrsh2;
00106 extern int zlatm6_(integer *, integer *, doublecomplex *,
00107 integer *, doublecomplex *, doublecomplex *, integer *,
00108 doublecomplex *, integer *, doublecomplex *, doublecomplex *,
00109 doublecomplex *, doublecomplex *, doublereal *, doublereal *);
00110 extern doublereal dlamch_(char *);
00111 extern int xerbla_(char *, integer *);
00112 doublereal abnorm;
00113 extern integer ilaenv_(integer *, char *, char *, integer *, integer *,
00114 integer *, integer *);
00115 extern doublereal zlange_(char *, integer *, integer *, doublecomplex *,
00116 integer *, doublereal *);
00117 extern int alasvm_(char *, integer *, integer *, integer
00118 *, integer *);
00119 doublecomplex weight[5];
00120 extern int zlacpy_(char *, integer *, integer *,
00121 doublecomplex *, integer *, doublecomplex *, integer *);
00122 integer minwrk, maxwrk, iptype;
00123 extern int zggevx_(char *, char *, char *, char *,
00124 integer *, doublecomplex *, integer *, doublecomplex *, integer *,
00125 doublecomplex *, doublecomplex *, doublecomplex *, integer *,
00126 doublecomplex *, integer *, integer *, integer *, doublereal *,
00127 doublereal *, doublereal *, doublereal *, doublereal *,
00128 doublereal *, doublecomplex *, integer *, doublereal *, integer *,
00129 logical *, integer *);
00130 doublereal ulpinv;
00131 integer nptknt, ntestt;
00132
00133
00134 static cilist io___20 = { 0, 0, 0, fmt_9999, 0 };
00135 static cilist io___22 = { 0, 0, 0, fmt_9998, 0 };
00136 static cilist io___23 = { 0, 0, 0, fmt_9998, 0 };
00137 static cilist io___28 = { 0, 0, 0, fmt_9997, 0 };
00138 static cilist io___29 = { 0, 0, 0, fmt_9995, 0 };
00139 static cilist io___30 = { 0, 0, 0, fmt_9994, 0 };
00140 static cilist io___31 = { 0, 0, 0, fmt_9993, 0 };
00141 static cilist io___32 = { 0, 0, 0, fmt_9992, 0 };
00142 static cilist io___33 = { 0, 0, 0, fmt_9991, 0 };
00143 static cilist io___34 = { 0, 0, 0, fmt_9990, 0 };
00144 static cilist io___35 = { 0, 0, 1, 0, 0 };
00145 static cilist io___36 = { 0, 0, 0, 0, 0 };
00146 static cilist io___37 = { 0, 0, 0, 0, 0 };
00147 static cilist io___38 = { 0, 0, 0, 0, 0 };
00148 static cilist io___39 = { 0, 0, 0, 0, 0 };
00149 static cilist io___40 = { 0, 0, 0, fmt_9987, 0 };
00150 static cilist io___41 = { 0, 0, 0, fmt_9986, 0 };
00151 static cilist io___42 = { 0, 0, 0, fmt_9986, 0 };
00152 static cilist io___43 = { 0, 0, 0, fmt_9997, 0 };
00153 static cilist io___44 = { 0, 0, 0, fmt_9996, 0 };
00154 static cilist io___45 = { 0, 0, 0, fmt_9992, 0 };
00155 static cilist io___46 = { 0, 0, 0, fmt_9989, 0 };
00156 static cilist io___47 = { 0, 0, 0, fmt_9988, 0 };
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 vr_dim1 = *lda;
00347 vr_offset = 1 + vr_dim1;
00348 vr -= vr_offset;
00349 vl_dim1 = *lda;
00350 vl_offset = 1 + vl_dim1;
00351 vl -= vl_offset;
00352 bi_dim1 = *lda;
00353 bi_offset = 1 + bi_dim1;
00354 bi -= bi_offset;
00355 ai_dim1 = *lda;
00356 ai_offset = 1 + ai_dim1;
00357 ai -= ai_offset;
00358 b_dim1 = *lda;
00359 b_offset = 1 + b_dim1;
00360 b -= b_offset;
00361 a_dim1 = *lda;
00362 a_offset = 1 + a_dim1;
00363 a -= a_offset;
00364 --alpha;
00365 --beta;
00366 --lscale;
00367 --rscale;
00368 --s;
00369 --dtru;
00370 --dif;
00371 --diftru;
00372 --work;
00373 --rwork;
00374 --iwork;
00375 --result;
00376 --bwork;
00377
00378
00379 *info = 0;
00380
00381 nmax = 5;
00382
00383 if (*nsize < 0) {
00384 *info = -1;
00385 } else if (*thresh < 0.) {
00386 *info = -2;
00387 } else if (*nin <= 0) {
00388 *info = -3;
00389 } else if (*nout <= 0) {
00390 *info = -4;
00391 } else if (*lda < 1 || *lda < nmax) {
00392 *info = -6;
00393 } else if (*liwork < nmax + 2) {
00394 *info = -26;
00395 }
00396
00397
00398
00399
00400
00401
00402
00403
00404 minwrk = 1;
00405 if (*info == 0 && *lwork >= 1) {
00406 minwrk = (nmax << 1) * (nmax + 1);
00407 maxwrk = nmax * (ilaenv_(&c__1, "ZGEQRF", " ", &nmax, &c__1, &nmax, &
00408 c__0) + 1);
00409
00410 i__1 = maxwrk, i__2 = (nmax << 1) * (nmax + 1);
00411 maxwrk = max(i__1,i__2);
00412 work[1].r = (doublereal) maxwrk, work[1].i = 0.;
00413 }
00414
00415 if (*lwork < minwrk) {
00416 *info = -23;
00417 }
00418
00419 if (*info != 0) {
00420 i__1 = -(*info);
00421 xerbla_("ZDRGVX", &i__1);
00422 return 0;
00423 }
00424
00425 n = 5;
00426 ulp = dlamch_("P");
00427 ulpinv = 1. / ulp;
00428 thrsh2 = *thresh * 10.;
00429 nerrs = 0;
00430 nptknt = 0;
00431 ntestt = 0;
00432
00433 if (*nsize == 0) {
00434 goto L90;
00435 }
00436
00437
00438
00439 d__1 = sqrt(sqrt(ulp));
00440 z__1.r = d__1, z__1.i = 0.;
00441 weight[0].r = z__1.r, weight[0].i = z__1.i;
00442 weight[1].r = .1, weight[1].i = 0.;
00443 weight[2].r = 1., weight[2].i = 0.;
00444 z_div(&z__1, &c_b11, &weight[1]);
00445 weight[3].r = z__1.r, weight[3].i = z__1.i;
00446 z_div(&z__1, &c_b11, weight);
00447 weight[4].r = z__1.r, weight[4].i = z__1.i;
00448
00449 for (iptype = 1; iptype <= 2; ++iptype) {
00450 for (iwa = 1; iwa <= 5; ++iwa) {
00451 for (iwb = 1; iwb <= 5; ++iwb) {
00452 for (iwx = 1; iwx <= 5; ++iwx) {
00453 for (iwy = 1; iwy <= 5; ++iwy) {
00454
00455
00456
00457 zlatm6_(&iptype, &c__5, &a[a_offset], lda, &b[
00458 b_offset], &vr[vr_offset], lda, &vl[vl_offset]
00459 , lda, &weight[iwa - 1], &weight[iwb - 1], &
00460 weight[iwx - 1], &weight[iwy - 1], &dtru[1], &
00461 diftru[1]);
00462
00463
00464
00465
00466
00467 zlacpy_("F", &n, &n, &a[a_offset], lda, &ai[ai_offset]
00468 , lda);
00469 zlacpy_("F", &n, &n, &b[b_offset], lda, &bi[bi_offset]
00470 , lda);
00471
00472 zggevx_("N", "V", "V", "B", &n, &ai[ai_offset], lda, &
00473 bi[bi_offset], lda, &alpha[1], &beta[1], &vl[
00474 vl_offset], lda, &vr[vr_offset], lda, ilo,
00475 ihi, &lscale[1], &rscale[1], &anorm, &bnorm, &
00476 s[1], &dif[1], &work[1], lwork, &rwork[1], &
00477 iwork[1], &bwork[1], &linfo);
00478 if (linfo != 0) {
00479 io___20.ciunit = *nout;
00480 s_wsfe(&io___20);
00481 do_fio(&c__1, "ZGGEVX", (ftnlen)6);
00482 do_fio(&c__1, (char *)&linfo, (ftnlen)sizeof(
00483 integer));
00484 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00485 ;
00486 do_fio(&c__1, (char *)&iptype, (ftnlen)sizeof(
00487 integer));
00488 do_fio(&c__1, (char *)&iwa, (ftnlen)sizeof(
00489 integer));
00490 do_fio(&c__1, (char *)&iwb, (ftnlen)sizeof(
00491 integer));
00492 do_fio(&c__1, (char *)&iwx, (ftnlen)sizeof(
00493 integer));
00494 do_fio(&c__1, (char *)&iwy, (ftnlen)sizeof(
00495 integer));
00496 e_wsfe();
00497 goto L30;
00498 }
00499
00500
00501
00502 zlacpy_("Full", &n, &n, &ai[ai_offset], lda, &work[1],
00503 &n);
00504 zlacpy_("Full", &n, &n, &bi[bi_offset], lda, &work[n *
00505 n + 1], &n);
00506 i__1 = n << 1;
00507 abnorm = zlange_("Fro", &n, &i__1, &work[1], &n, &
00508 rwork[1]);
00509
00510
00511
00512 result[1] = 0.;
00513 zget52_(&c_true, &n, &a[a_offset], lda, &b[b_offset],
00514 lda, &vl[vl_offset], lda, &alpha[1], &beta[1],
00515 &work[1], &rwork[1], &result[1]);
00516 if (result[2] > *thresh) {
00517 io___22.ciunit = *nout;
00518 s_wsfe(&io___22);
00519 do_fio(&c__1, "Left", (ftnlen)4);
00520 do_fio(&c__1, "ZGGEVX", (ftnlen)6);
00521 do_fio(&c__1, (char *)&result[2], (ftnlen)sizeof(
00522 doublereal));
00523 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00524 ;
00525 do_fio(&c__1, (char *)&iptype, (ftnlen)sizeof(
00526 integer));
00527 do_fio(&c__1, (char *)&iwa, (ftnlen)sizeof(
00528 integer));
00529 do_fio(&c__1, (char *)&iwb, (ftnlen)sizeof(
00530 integer));
00531 do_fio(&c__1, (char *)&iwx, (ftnlen)sizeof(
00532 integer));
00533 do_fio(&c__1, (char *)&iwy, (ftnlen)sizeof(
00534 integer));
00535 e_wsfe();
00536 }
00537
00538 result[2] = 0.;
00539 zget52_(&c_false, &n, &a[a_offset], lda, &b[b_offset],
00540 lda, &vr[vr_offset], lda, &alpha[1], &beta[1]
00541 , &work[1], &rwork[1], &result[2]);
00542 if (result[3] > *thresh) {
00543 io___23.ciunit = *nout;
00544 s_wsfe(&io___23);
00545 do_fio(&c__1, "Right", (ftnlen)5);
00546 do_fio(&c__1, "ZGGEVX", (ftnlen)6);
00547 do_fio(&c__1, (char *)&result[3], (ftnlen)sizeof(
00548 doublereal));
00549 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer))
00550 ;
00551 do_fio(&c__1, (char *)&iptype, (ftnlen)sizeof(
00552 integer));
00553 do_fio(&c__1, (char *)&iwa, (ftnlen)sizeof(
00554 integer));
00555 do_fio(&c__1, (char *)&iwb, (ftnlen)sizeof(
00556 integer));
00557 do_fio(&c__1, (char *)&iwx, (ftnlen)sizeof(
00558 integer));
00559 do_fio(&c__1, (char *)&iwy, (ftnlen)sizeof(
00560 integer));
00561 e_wsfe();
00562 }
00563
00564
00565
00566 result[3] = 0.;
00567 i__1 = n;
00568 for (i__ = 1; i__ <= i__1; ++i__) {
00569 if (s[i__] == 0.) {
00570 if (dtru[i__] > abnorm * ulp) {
00571 result[3] = ulpinv;
00572 }
00573 } else if (dtru[i__] == 0.) {
00574 if (s[i__] > abnorm * ulp) {
00575 result[3] = ulpinv;
00576 }
00577 } else {
00578
00579 d__3 = (d__1 = dtru[i__] / s[i__], abs(d__1)),
00580 d__4 = (d__2 = s[i__] / dtru[i__],
00581 abs(d__2));
00582 rwork[i__] = max(d__3,d__4);
00583
00584 d__1 = result[3], d__2 = rwork[i__];
00585 result[3] = max(d__1,d__2);
00586 }
00587
00588 }
00589
00590
00591
00592 result[4] = 0.;
00593 if (dif[1] == 0.) {
00594 if (diftru[1] > abnorm * ulp) {
00595 result[4] = ulpinv;
00596 }
00597 } else if (diftru[1] == 0.) {
00598 if (dif[1] > abnorm * ulp) {
00599 result[4] = ulpinv;
00600 }
00601 } else if (dif[5] == 0.) {
00602 if (diftru[5] > abnorm * ulp) {
00603 result[4] = ulpinv;
00604 }
00605 } else if (diftru[5] == 0.) {
00606 if (dif[5] > abnorm * ulp) {
00607 result[4] = ulpinv;
00608 }
00609 } else {
00610
00611 d__3 = (d__1 = diftru[1] / dif[1], abs(d__1)),
00612 d__4 = (d__2 = dif[1] / diftru[1], abs(
00613 d__2));
00614 ratio1 = max(d__3,d__4);
00615
00616 d__3 = (d__1 = diftru[5] / dif[5], abs(d__1)),
00617 d__4 = (d__2 = dif[5] / diftru[5], abs(
00618 d__2));
00619 ratio2 = max(d__3,d__4);
00620 result[4] = max(ratio1,ratio2);
00621 }
00622
00623 ntestt += 4;
00624
00625
00626
00627 for (j = 1; j <= 4; ++j) {
00628 if (result[j] >= thrsh2 && j >= 4 || result[j] >=
00629 *thresh && j <= 3) {
00630
00631
00632
00633
00634 if (nerrs == 0) {
00635 io___28.ciunit = *nout;
00636 s_wsfe(&io___28);
00637 do_fio(&c__1, "ZXV", (ftnlen)3);
00638 e_wsfe();
00639
00640
00641
00642
00643
00644 io___29.ciunit = *nout;
00645 s_wsfe(&io___29);
00646 e_wsfe();
00647 io___30.ciunit = *nout;
00648 s_wsfe(&io___30);
00649 e_wsfe();
00650 io___31.ciunit = *nout;
00651 s_wsfe(&io___31);
00652 e_wsfe();
00653
00654
00655
00656 io___32.ciunit = *nout;
00657 s_wsfe(&io___32);
00658 do_fio(&c__1, "'", (ftnlen)1);
00659 do_fio(&c__1, "transpose", (ftnlen)9);
00660 do_fio(&c__1, "'", (ftnlen)1);
00661 e_wsfe();
00662
00663 }
00664 ++nerrs;
00665 if (result[j] < 1e4) {
00666 io___33.ciunit = *nout;
00667 s_wsfe(&io___33);
00668 do_fio(&c__1, (char *)&iptype, (ftnlen)
00669 sizeof(integer));
00670 do_fio(&c__1, (char *)&iwa, (ftnlen)
00671 sizeof(integer));
00672 do_fio(&c__1, (char *)&iwb, (ftnlen)
00673 sizeof(integer));
00674 do_fio(&c__1, (char *)&iwx, (ftnlen)
00675 sizeof(integer));
00676 do_fio(&c__1, (char *)&iwy, (ftnlen)
00677 sizeof(integer));
00678 do_fio(&c__1, (char *)&j, (ftnlen)sizeof(
00679 integer));
00680 do_fio(&c__1, (char *)&result[j], (ftnlen)
00681 sizeof(doublereal));
00682 e_wsfe();
00683 } else {
00684 io___34.ciunit = *nout;
00685 s_wsfe(&io___34);
00686 do_fio(&c__1, (char *)&iptype, (ftnlen)
00687 sizeof(integer));
00688 do_fio(&c__1, (char *)&iwa, (ftnlen)
00689 sizeof(integer));
00690 do_fio(&c__1, (char *)&iwb, (ftnlen)
00691 sizeof(integer));
00692 do_fio(&c__1, (char *)&iwx, (ftnlen)
00693 sizeof(integer));
00694 do_fio(&c__1, (char *)&iwy, (ftnlen)
00695 sizeof(integer));
00696 do_fio(&c__1, (char *)&j, (ftnlen)sizeof(
00697 integer));
00698 do_fio(&c__1, (char *)&result[j], (ftnlen)
00699 sizeof(doublereal));
00700 e_wsfe();
00701 }
00702 }
00703
00704 }
00705
00706 L30:
00707
00708
00709 ;
00710 }
00711
00712 }
00713
00714 }
00715
00716 }
00717
00718 }
00719
00720 goto L150;
00721
00722 L90:
00723
00724
00725
00726
00727 io___35.ciunit = *nin;
00728 i__1 = s_rsle(&io___35);
00729 if (i__1 != 0) {
00730 goto L150;
00731 }
00732 i__1 = do_lio(&c__3, &c__1, (char *)&n, (ftnlen)sizeof(integer));
00733 if (i__1 != 0) {
00734 goto L150;
00735 }
00736 i__1 = e_rsle();
00737 if (i__1 != 0) {
00738 goto L150;
00739 }
00740 if (n == 0) {
00741 goto L150;
00742 }
00743 i__1 = n;
00744 for (i__ = 1; i__ <= i__1; ++i__) {
00745 io___36.ciunit = *nin;
00746 s_rsle(&io___36);
00747 i__2 = n;
00748 for (j = 1; j <= i__2; ++j) {
00749 do_lio(&c__7, &c__1, (char *)&a[i__ + j * a_dim1], (ftnlen)sizeof(
00750 doublecomplex));
00751 }
00752 e_rsle();
00753
00754 }
00755 i__1 = n;
00756 for (i__ = 1; i__ <= i__1; ++i__) {
00757 io___37.ciunit = *nin;
00758 s_rsle(&io___37);
00759 i__2 = n;
00760 for (j = 1; j <= i__2; ++j) {
00761 do_lio(&c__7, &c__1, (char *)&b[i__ + j * b_dim1], (ftnlen)sizeof(
00762 doublecomplex));
00763 }
00764 e_rsle();
00765
00766 }
00767 io___38.ciunit = *nin;
00768 s_rsle(&io___38);
00769 i__1 = n;
00770 for (i__ = 1; i__ <= i__1; ++i__) {
00771 do_lio(&c__5, &c__1, (char *)&dtru[i__], (ftnlen)sizeof(doublereal));
00772 }
00773 e_rsle();
00774 io___39.ciunit = *nin;
00775 s_rsle(&io___39);
00776 i__1 = n;
00777 for (i__ = 1; i__ <= i__1; ++i__) {
00778 do_lio(&c__5, &c__1, (char *)&diftru[i__], (ftnlen)sizeof(doublereal))
00779 ;
00780 }
00781 e_rsle();
00782
00783 ++nptknt;
00784
00785
00786
00787
00788
00789 zlacpy_("F", &n, &n, &a[a_offset], lda, &ai[ai_offset], lda);
00790 zlacpy_("F", &n, &n, &b[b_offset], lda, &bi[bi_offset], lda);
00791
00792 zggevx_("N", "V", "V", "B", &n, &ai[ai_offset], lda, &bi[bi_offset], lda,
00793 &alpha[1], &beta[1], &vl[vl_offset], lda, &vr[vr_offset], lda,
00794 ilo, ihi, &lscale[1], &rscale[1], &anorm, &bnorm, &s[1], &dif[1],
00795 &work[1], lwork, &rwork[1], &iwork[1], &bwork[1], &linfo);
00796
00797 if (linfo != 0) {
00798 io___40.ciunit = *nout;
00799 s_wsfe(&io___40);
00800 do_fio(&c__1, "ZGGEVX", (ftnlen)6);
00801 do_fio(&c__1, (char *)&linfo, (ftnlen)sizeof(integer));
00802 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00803 do_fio(&c__1, (char *)&nptknt, (ftnlen)sizeof(integer));
00804 e_wsfe();
00805 goto L140;
00806 }
00807
00808
00809
00810 zlacpy_("Full", &n, &n, &ai[ai_offset], lda, &work[1], &n);
00811 zlacpy_("Full", &n, &n, &bi[bi_offset], lda, &work[n * n + 1], &n);
00812 i__1 = n << 1;
00813 abnorm = zlange_("Fro", &n, &i__1, &work[1], &n, &rwork[1]);
00814
00815
00816
00817 result[1] = 0.;
00818 zget52_(&c_true, &n, &a[a_offset], lda, &b[b_offset], lda, &vl[vl_offset],
00819 lda, &alpha[1], &beta[1], &work[1], &rwork[1], &result[1]);
00820 if (result[2] > *thresh) {
00821 io___41.ciunit = *nout;
00822 s_wsfe(&io___41);
00823 do_fio(&c__1, "Left", (ftnlen)4);
00824 do_fio(&c__1, "ZGGEVX", (ftnlen)6);
00825 do_fio(&c__1, (char *)&result[2], (ftnlen)sizeof(doublereal));
00826 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00827 do_fio(&c__1, (char *)&nptknt, (ftnlen)sizeof(integer));
00828 e_wsfe();
00829 }
00830
00831 result[2] = 0.;
00832 zget52_(&c_false, &n, &a[a_offset], lda, &b[b_offset], lda, &vr[vr_offset]
00833 , lda, &alpha[1], &beta[1], &work[1], &rwork[1], &result[2]);
00834 if (result[3] > *thresh) {
00835 io___42.ciunit = *nout;
00836 s_wsfe(&io___42);
00837 do_fio(&c__1, "Right", (ftnlen)5);
00838 do_fio(&c__1, "ZGGEVX", (ftnlen)6);
00839 do_fio(&c__1, (char *)&result[3], (ftnlen)sizeof(doublereal));
00840 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00841 do_fio(&c__1, (char *)&nptknt, (ftnlen)sizeof(integer));
00842 e_wsfe();
00843 }
00844
00845
00846
00847 result[3] = 0.;
00848 i__1 = n;
00849 for (i__ = 1; i__ <= i__1; ++i__) {
00850 if (s[i__] == 0.) {
00851 if (dtru[i__] > abnorm * ulp) {
00852 result[3] = ulpinv;
00853 }
00854 } else if (dtru[i__] == 0.) {
00855 if (s[i__] > abnorm * ulp) {
00856 result[3] = ulpinv;
00857 }
00858 } else {
00859
00860 d__3 = (d__1 = dtru[i__] / s[i__], abs(d__1)), d__4 = (d__2 = s[
00861 i__] / dtru[i__], abs(d__2));
00862 rwork[i__] = max(d__3,d__4);
00863
00864 d__1 = result[3], d__2 = rwork[i__];
00865 result[3] = max(d__1,d__2);
00866 }
00867
00868 }
00869
00870
00871
00872 result[4] = 0.;
00873 if (dif[1] == 0.) {
00874 if (diftru[1] > abnorm * ulp) {
00875 result[4] = ulpinv;
00876 }
00877 } else if (diftru[1] == 0.) {
00878 if (dif[1] > abnorm * ulp) {
00879 result[4] = ulpinv;
00880 }
00881 } else if (dif[5] == 0.) {
00882 if (diftru[5] > abnorm * ulp) {
00883 result[4] = ulpinv;
00884 }
00885 } else if (diftru[5] == 0.) {
00886 if (dif[5] > abnorm * ulp) {
00887 result[4] = ulpinv;
00888 }
00889 } else {
00890
00891 d__3 = (d__1 = diftru[1] / dif[1], abs(d__1)), d__4 = (d__2 = dif[1] /
00892 diftru[1], abs(d__2));
00893 ratio1 = max(d__3,d__4);
00894
00895 d__3 = (d__1 = diftru[5] / dif[5], abs(d__1)), d__4 = (d__2 = dif[5] /
00896 diftru[5], abs(d__2));
00897 ratio2 = max(d__3,d__4);
00898 result[4] = max(ratio1,ratio2);
00899 }
00900
00901 ntestt += 4;
00902
00903
00904
00905 for (j = 1; j <= 4; ++j) {
00906 if (result[j] >= thrsh2) {
00907
00908
00909
00910
00911 if (nerrs == 0) {
00912 io___43.ciunit = *nout;
00913 s_wsfe(&io___43);
00914 do_fio(&c__1, "ZXV", (ftnlen)3);
00915 e_wsfe();
00916
00917
00918
00919
00920
00921 io___44.ciunit = *nout;
00922 s_wsfe(&io___44);
00923 e_wsfe();
00924
00925
00926
00927 io___45.ciunit = *nout;
00928 s_wsfe(&io___45);
00929 do_fio(&c__1, "'", (ftnlen)1);
00930 do_fio(&c__1, "transpose", (ftnlen)9);
00931 do_fio(&c__1, "'", (ftnlen)1);
00932 e_wsfe();
00933
00934 }
00935 ++nerrs;
00936 if (result[j] < 1e4) {
00937 io___46.ciunit = *nout;
00938 s_wsfe(&io___46);
00939 do_fio(&c__1, (char *)&nptknt, (ftnlen)sizeof(integer));
00940 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00941 do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer));
00942 do_fio(&c__1, (char *)&result[j], (ftnlen)sizeof(doublereal));
00943 e_wsfe();
00944 } else {
00945 io___47.ciunit = *nout;
00946 s_wsfe(&io___47);
00947 do_fio(&c__1, (char *)&nptknt, (ftnlen)sizeof(integer));
00948 do_fio(&c__1, (char *)&n, (ftnlen)sizeof(integer));
00949 do_fio(&c__1, (char *)&j, (ftnlen)sizeof(integer));
00950 do_fio(&c__1, (char *)&result[j], (ftnlen)sizeof(doublereal));
00951 e_wsfe();
00952 }
00953 }
00954
00955 }
00956
00957 L140:
00958
00959 goto L90;
00960 L150:
00961
00962
00963
00964 alasvm_("ZXV", nout, &nerrs, &ntestt, &c__0);
00965
00966 work[1].r = (doublereal) maxwrk, work[1].i = 0.;
00967
00968 return 0;
00969
00970
00971
00972
00973
00974
00975
00976
00977
00978
00979
00980
00981
00982
00983
00984
00985
00986 }