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