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