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__4 = 4;
00020
00021 int zget23_(logical *comp, integer *isrt, char *balanc,
00022 integer *jtype, doublereal *thresh, integer *iseed, integer *nounit,
00023 integer *n, doublecomplex *a, integer *lda, doublecomplex *h__,
00024 doublecomplex *w, doublecomplex *w1, doublecomplex *vl, integer *ldvl,
00025 doublecomplex *vr, integer *ldvr, doublecomplex *lre, integer *ldlre,
00026 doublereal *rcondv, doublereal *rcndv1, doublereal *rcdvin,
00027 doublereal *rconde, doublereal *rcnde1, doublereal *rcdein,
00028 doublereal *scale, doublereal *scale1, doublereal *result,
00029 doublecomplex *work, integer *lwork, doublereal *rwork, integer *info)
00030 {
00031
00032
00033 static char sens[1*2] = "N" "V";
00034
00035
00036 static char fmt_9998[] = "(\002 ZGET23: \002,a,\002 returned INFO=\002,i"
00037 "6,\002.\002,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, BALANC = "
00038 "\002,a,\002, ISEED=(\002,3(i5,\002,\002),i5,\002)\002)";
00039 static char fmt_9999[] = "(\002 ZGET23: \002,a,\002 returned INFO=\002,i"
00040 "6,\002.\002,/9x,\002N=\002,i6,\002, INPUT EXAMPLE NUMBER = \002,"
00041 "i4)";
00042
00043
00044 integer a_dim1, a_offset, h_dim1, h_offset, lre_dim1, lre_offset, vl_dim1,
00045 vl_offset, vr_dim1, vr_offset, i__1, i__2, i__3, i__4, i__5;
00046 doublereal d__1, d__2, d__3, d__4, d__5;
00047
00048
00049 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00050 double z_abs(doublecomplex *), d_imag(doublecomplex *);
00051
00052
00053 integer i__, j;
00054 doublereal v;
00055 integer jj, ihi, ilo;
00056 doublereal eps, res[2], tol, ulp, vmx;
00057 integer ihi1, ilo1;
00058 doublecomplex cdum[1];
00059 integer kmin;
00060 doublecomplex ctmp;
00061 doublereal vmax, tnrm, vrmx, vtst;
00062 logical balok, nobal;
00063 doublereal abnrm;
00064 extern logical lsame_(char *, char *);
00065 integer iinfo;
00066 char sense[1];
00067 extern int zget22_(char *, char *, char *, integer *,
00068 doublecomplex *, integer *, doublecomplex *, integer *,
00069 doublecomplex *, doublecomplex *, doublereal *, doublereal *);
00070 integer isens;
00071 doublereal tolin, abnrm1;
00072 extern doublereal dznrm2_(integer *, doublecomplex *, integer *), dlamch_(
00073 char *);
00074 extern int xerbla_(char *, integer *);
00075 integer isensm;
00076 doublereal vricmp;
00077 extern int zlacpy_(char *, integer *, integer *,
00078 doublecomplex *, integer *, doublecomplex *, integer *);
00079 doublereal vrimin;
00080 extern int zgeevx_(char *, char *, char *, char *,
00081 integer *, doublecomplex *, integer *, doublecomplex *,
00082 doublecomplex *, integer *, doublecomplex *, integer *, integer *,
00083 integer *, doublereal *, doublereal *, doublereal *, doublereal *
00084 , doublecomplex *, integer *, doublereal *, integer *);
00085 doublereal smlnum, ulpinv;
00086
00087
00088 static cilist io___14 = { 0, 0, 0, fmt_9998, 0 };
00089 static cilist io___15 = { 0, 0, 0, fmt_9999, 0 };
00090 static cilist io___28 = { 0, 0, 0, fmt_9998, 0 };
00091 static cilist io___29 = { 0, 0, 0, fmt_9999, 0 };
00092 static cilist io___30 = { 0, 0, 0, fmt_9998, 0 };
00093 static cilist io___31 = { 0, 0, 0, fmt_9999, 0 };
00094 static cilist io___32 = { 0, 0, 0, fmt_9998, 0 };
00095 static cilist io___33 = { 0, 0, 0, fmt_9999, 0 };
00096 static cilist io___34 = { 0, 0, 0, fmt_9999, 0 };
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139
00140
00141
00142
00143
00144
00145
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
00338
00339
00340
00341
00342 --iseed;
00343 h_dim1 = *lda;
00344 h_offset = 1 + h_dim1;
00345 h__ -= h_offset;
00346 a_dim1 = *lda;
00347 a_offset = 1 + a_dim1;
00348 a -= a_offset;
00349 --w;
00350 --w1;
00351 vl_dim1 = *ldvl;
00352 vl_offset = 1 + vl_dim1;
00353 vl -= vl_offset;
00354 vr_dim1 = *ldvr;
00355 vr_offset = 1 + vr_dim1;
00356 vr -= vr_offset;
00357 lre_dim1 = *ldlre;
00358 lre_offset = 1 + lre_dim1;
00359 lre -= lre_offset;
00360 --rcondv;
00361 --rcndv1;
00362 --rcdvin;
00363 --rconde;
00364 --rcnde1;
00365 --rcdein;
00366 --scale;
00367 --scale1;
00368 --result;
00369 --work;
00370 --rwork;
00371
00372
00373
00374
00375
00376
00377
00378 nobal = lsame_(balanc, "N");
00379 balok = nobal || lsame_(balanc, "P") || lsame_(
00380 balanc, "S") || lsame_(balanc, "B");
00381 *info = 0;
00382 if (*isrt != 0 && *isrt != 1) {
00383 *info = -2;
00384 } else if (! balok) {
00385 *info = -3;
00386 } else if (*thresh < 0.) {
00387 *info = -5;
00388 } else if (*nounit <= 0) {
00389 *info = -7;
00390 } else if (*n < 0) {
00391 *info = -8;
00392 } else if (*lda < 1 || *lda < *n) {
00393 *info = -10;
00394 } else if (*ldvl < 1 || *ldvl < *n) {
00395 *info = -15;
00396 } else if (*ldvr < 1 || *ldvr < *n) {
00397 *info = -17;
00398 } else if (*ldlre < 1 || *ldlre < *n) {
00399 *info = -19;
00400 } else if (*lwork < *n << 1 || *comp && *lwork < (*n << 1) + *n * *n) {
00401 *info = -30;
00402 }
00403
00404 if (*info != 0) {
00405 i__1 = -(*info);
00406 xerbla_("ZGET23", &i__1);
00407 return 0;
00408 }
00409
00410
00411
00412 for (i__ = 1; i__ <= 11; ++i__) {
00413 result[i__] = -1.;
00414
00415 }
00416
00417 if (*n == 0) {
00418 return 0;
00419 }
00420
00421
00422
00423 ulp = dlamch_("Precision");
00424 smlnum = dlamch_("S");
00425 ulpinv = 1. / ulp;
00426
00427
00428
00429 if (*lwork >= (*n << 1) + *n * *n) {
00430 *(unsigned char *)sense = 'B';
00431 isensm = 2;
00432 } else {
00433 *(unsigned char *)sense = 'E';
00434 isensm = 1;
00435 }
00436 zlacpy_("F", n, n, &a[a_offset], lda, &h__[h_offset], lda);
00437 zgeevx_(balanc, "V", "V", sense, n, &h__[h_offset], lda, &w[1], &vl[
00438 vl_offset], ldvl, &vr[vr_offset], ldvr, &ilo, &ihi, &scale[1], &
00439 abnrm, &rconde[1], &rcondv[1], &work[1], lwork, &rwork[1], &iinfo);
00440 if (iinfo != 0) {
00441 result[1] = ulpinv;
00442 if (*jtype != 22) {
00443 io___14.ciunit = *nounit;
00444 s_wsfe(&io___14);
00445 do_fio(&c__1, "ZGEEVX1", (ftnlen)7);
00446 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00447 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00448 do_fio(&c__1, (char *)&(*jtype), (ftnlen)sizeof(integer));
00449 do_fio(&c__1, balanc, (ftnlen)1);
00450 do_fio(&c__4, (char *)&iseed[1], (ftnlen)sizeof(integer));
00451 e_wsfe();
00452 } else {
00453 io___15.ciunit = *nounit;
00454 s_wsfe(&io___15);
00455 do_fio(&c__1, "ZGEEVX1", (ftnlen)7);
00456 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00457 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00458 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
00459 e_wsfe();
00460 }
00461 *info = abs(iinfo);
00462 return 0;
00463 }
00464
00465
00466
00467 zget22_("N", "N", "N", n, &a[a_offset], lda, &vr[vr_offset], ldvr, &w[1],
00468 &work[1], &rwork[1], res);
00469 result[1] = res[0];
00470
00471
00472
00473 zget22_("C", "N", "C", n, &a[a_offset], lda, &vl[vl_offset], ldvl, &w[1],
00474 &work[1], &rwork[1], res);
00475 result[2] = res[0];
00476
00477
00478
00479 i__1 = *n;
00480 for (j = 1; j <= i__1; ++j) {
00481 tnrm = dznrm2_(n, &vr[j * vr_dim1 + 1], &c__1);
00482
00483
00484 d__4 = ulpinv, d__5 = (d__1 = tnrm - 1., abs(d__1)) / ulp;
00485 d__2 = result[3], d__3 = min(d__4,d__5);
00486 result[3] = max(d__2,d__3);
00487 vmx = 0.;
00488 vrmx = 0.;
00489 i__2 = *n;
00490 for (jj = 1; jj <= i__2; ++jj) {
00491 vtst = z_abs(&vr[jj + j * vr_dim1]);
00492 if (vtst > vmx) {
00493 vmx = vtst;
00494 }
00495 i__3 = jj + j * vr_dim1;
00496 if (d_imag(&vr[jj + j * vr_dim1]) == 0. && (d__1 = vr[i__3].r,
00497 abs(d__1)) > vrmx) {
00498 i__4 = jj + j * vr_dim1;
00499 vrmx = (d__2 = vr[i__4].r, abs(d__2));
00500 }
00501
00502 }
00503 if (vrmx / vmx < 1. - ulp * 2.) {
00504 result[3] = ulpinv;
00505 }
00506
00507 }
00508
00509
00510
00511 i__1 = *n;
00512 for (j = 1; j <= i__1; ++j) {
00513 tnrm = dznrm2_(n, &vl[j * vl_dim1 + 1], &c__1);
00514
00515
00516 d__4 = ulpinv, d__5 = (d__1 = tnrm - 1., abs(d__1)) / ulp;
00517 d__2 = result[4], d__3 = min(d__4,d__5);
00518 result[4] = max(d__2,d__3);
00519 vmx = 0.;
00520 vrmx = 0.;
00521 i__2 = *n;
00522 for (jj = 1; jj <= i__2; ++jj) {
00523 vtst = z_abs(&vl[jj + j * vl_dim1]);
00524 if (vtst > vmx) {
00525 vmx = vtst;
00526 }
00527 i__3 = jj + j * vl_dim1;
00528 if (d_imag(&vl[jj + j * vl_dim1]) == 0. && (d__1 = vl[i__3].r,
00529 abs(d__1)) > vrmx) {
00530 i__4 = jj + j * vl_dim1;
00531 vrmx = (d__2 = vl[i__4].r, abs(d__2));
00532 }
00533
00534 }
00535 if (vrmx / vmx < 1. - ulp * 2.) {
00536 result[4] = ulpinv;
00537 }
00538
00539 }
00540
00541
00542
00543 i__1 = isensm;
00544 for (isens = 1; isens <= i__1; ++isens) {
00545
00546 *(unsigned char *)sense = *(unsigned char *)&sens[isens - 1];
00547
00548
00549
00550 zlacpy_("F", n, n, &a[a_offset], lda, &h__[h_offset], lda);
00551 zgeevx_(balanc, "N", "N", sense, n, &h__[h_offset], lda, &w1[1], cdum,
00552 &c__1, cdum, &c__1, &ilo1, &ihi1, &scale1[1], &abnrm1, &
00553 rcnde1[1], &rcndv1[1], &work[1], lwork, &rwork[1], &iinfo);
00554 if (iinfo != 0) {
00555 result[1] = ulpinv;
00556 if (*jtype != 22) {
00557 io___28.ciunit = *nounit;
00558 s_wsfe(&io___28);
00559 do_fio(&c__1, "ZGEEVX2", (ftnlen)7);
00560 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00561 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00562 do_fio(&c__1, (char *)&(*jtype), (ftnlen)sizeof(integer));
00563 do_fio(&c__1, balanc, (ftnlen)1);
00564 do_fio(&c__4, (char *)&iseed[1], (ftnlen)sizeof(integer));
00565 e_wsfe();
00566 } else {
00567 io___29.ciunit = *nounit;
00568 s_wsfe(&io___29);
00569 do_fio(&c__1, "ZGEEVX2", (ftnlen)7);
00570 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00571 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00572 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
00573 e_wsfe();
00574 }
00575 *info = abs(iinfo);
00576 goto L190;
00577 }
00578
00579
00580
00581 i__2 = *n;
00582 for (j = 1; j <= i__2; ++j) {
00583 i__3 = j;
00584 i__4 = j;
00585 if (w[i__3].r != w1[i__4].r || w[i__3].i != w1[i__4].i) {
00586 result[5] = ulpinv;
00587 }
00588
00589 }
00590
00591
00592
00593 if (! nobal) {
00594 i__2 = *n;
00595 for (j = 1; j <= i__2; ++j) {
00596 if (scale[j] != scale1[j]) {
00597 result[8] = ulpinv;
00598 }
00599
00600 }
00601 if (ilo != ilo1) {
00602 result[8] = ulpinv;
00603 }
00604 if (ihi != ihi1) {
00605 result[8] = ulpinv;
00606 }
00607 if (abnrm != abnrm1) {
00608 result[8] = ulpinv;
00609 }
00610 }
00611
00612
00613
00614 if (isens == 2 && *n > 1) {
00615 i__2 = *n;
00616 for (j = 1; j <= i__2; ++j) {
00617 if (rcondv[j] != rcndv1[j]) {
00618 result[9] = ulpinv;
00619 }
00620
00621 }
00622 }
00623
00624
00625
00626 zlacpy_("F", n, n, &a[a_offset], lda, &h__[h_offset], lda);
00627 zgeevx_(balanc, "N", "V", sense, n, &h__[h_offset], lda, &w1[1], cdum,
00628 &c__1, &lre[lre_offset], ldlre, &ilo1, &ihi1, &scale1[1], &
00629 abnrm1, &rcnde1[1], &rcndv1[1], &work[1], lwork, &rwork[1], &
00630 iinfo);
00631 if (iinfo != 0) {
00632 result[1] = ulpinv;
00633 if (*jtype != 22) {
00634 io___30.ciunit = *nounit;
00635 s_wsfe(&io___30);
00636 do_fio(&c__1, "ZGEEVX3", (ftnlen)7);
00637 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00638 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00639 do_fio(&c__1, (char *)&(*jtype), (ftnlen)sizeof(integer));
00640 do_fio(&c__1, balanc, (ftnlen)1);
00641 do_fio(&c__4, (char *)&iseed[1], (ftnlen)sizeof(integer));
00642 e_wsfe();
00643 } else {
00644 io___31.ciunit = *nounit;
00645 s_wsfe(&io___31);
00646 do_fio(&c__1, "ZGEEVX3", (ftnlen)7);
00647 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00648 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00649 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
00650 e_wsfe();
00651 }
00652 *info = abs(iinfo);
00653 goto L190;
00654 }
00655
00656
00657
00658 i__2 = *n;
00659 for (j = 1; j <= i__2; ++j) {
00660 i__3 = j;
00661 i__4 = j;
00662 if (w[i__3].r != w1[i__4].r || w[i__3].i != w1[i__4].i) {
00663 result[5] = ulpinv;
00664 }
00665
00666 }
00667
00668
00669
00670 i__2 = *n;
00671 for (j = 1; j <= i__2; ++j) {
00672 i__3 = *n;
00673 for (jj = 1; jj <= i__3; ++jj) {
00674 i__4 = j + jj * vr_dim1;
00675 i__5 = j + jj * lre_dim1;
00676 if (vr[i__4].r != lre[i__5].r || vr[i__4].i != lre[i__5].i) {
00677 result[6] = ulpinv;
00678 }
00679
00680 }
00681
00682 }
00683
00684
00685
00686 if (! nobal) {
00687 i__2 = *n;
00688 for (j = 1; j <= i__2; ++j) {
00689 if (scale[j] != scale1[j]) {
00690 result[8] = ulpinv;
00691 }
00692
00693 }
00694 if (ilo != ilo1) {
00695 result[8] = ulpinv;
00696 }
00697 if (ihi != ihi1) {
00698 result[8] = ulpinv;
00699 }
00700 if (abnrm != abnrm1) {
00701 result[8] = ulpinv;
00702 }
00703 }
00704
00705
00706
00707 if (isens == 2 && *n > 1) {
00708 i__2 = *n;
00709 for (j = 1; j <= i__2; ++j) {
00710 if (rcondv[j] != rcndv1[j]) {
00711 result[9] = ulpinv;
00712 }
00713
00714 }
00715 }
00716
00717
00718
00719 zlacpy_("F", n, n, &a[a_offset], lda, &h__[h_offset], lda);
00720 zgeevx_(balanc, "V", "N", sense, n, &h__[h_offset], lda, &w1[1], &lre[
00721 lre_offset], ldlre, cdum, &c__1, &ilo1, &ihi1, &scale1[1], &
00722 abnrm1, &rcnde1[1], &rcndv1[1], &work[1], lwork, &rwork[1], &
00723 iinfo);
00724 if (iinfo != 0) {
00725 result[1] = ulpinv;
00726 if (*jtype != 22) {
00727 io___32.ciunit = *nounit;
00728 s_wsfe(&io___32);
00729 do_fio(&c__1, "ZGEEVX4", (ftnlen)7);
00730 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00731 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00732 do_fio(&c__1, (char *)&(*jtype), (ftnlen)sizeof(integer));
00733 do_fio(&c__1, balanc, (ftnlen)1);
00734 do_fio(&c__4, (char *)&iseed[1], (ftnlen)sizeof(integer));
00735 e_wsfe();
00736 } else {
00737 io___33.ciunit = *nounit;
00738 s_wsfe(&io___33);
00739 do_fio(&c__1, "ZGEEVX4", (ftnlen)7);
00740 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00741 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00742 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
00743 e_wsfe();
00744 }
00745 *info = abs(iinfo);
00746 goto L190;
00747 }
00748
00749
00750
00751 i__2 = *n;
00752 for (j = 1; j <= i__2; ++j) {
00753 i__3 = j;
00754 i__4 = j;
00755 if (w[i__3].r != w1[i__4].r || w[i__3].i != w1[i__4].i) {
00756 result[5] = ulpinv;
00757 }
00758
00759 }
00760
00761
00762
00763 i__2 = *n;
00764 for (j = 1; j <= i__2; ++j) {
00765 i__3 = *n;
00766 for (jj = 1; jj <= i__3; ++jj) {
00767 i__4 = j + jj * vl_dim1;
00768 i__5 = j + jj * lre_dim1;
00769 if (vl[i__4].r != lre[i__5].r || vl[i__4].i != lre[i__5].i) {
00770 result[7] = ulpinv;
00771 }
00772
00773 }
00774
00775 }
00776
00777
00778
00779 if (! nobal) {
00780 i__2 = *n;
00781 for (j = 1; j <= i__2; ++j) {
00782 if (scale[j] != scale1[j]) {
00783 result[8] = ulpinv;
00784 }
00785
00786 }
00787 if (ilo != ilo1) {
00788 result[8] = ulpinv;
00789 }
00790 if (ihi != ihi1) {
00791 result[8] = ulpinv;
00792 }
00793 if (abnrm != abnrm1) {
00794 result[8] = ulpinv;
00795 }
00796 }
00797
00798
00799
00800 if (isens == 2 && *n > 1) {
00801 i__2 = *n;
00802 for (j = 1; j <= i__2; ++j) {
00803 if (rcondv[j] != rcndv1[j]) {
00804 result[9] = ulpinv;
00805 }
00806
00807 }
00808 }
00809
00810 L190:
00811
00812
00813 ;
00814 }
00815
00816
00817
00818 if (*comp) {
00819 zlacpy_("F", n, n, &a[a_offset], lda, &h__[h_offset], lda);
00820 zgeevx_("N", "V", "V", "B", n, &h__[h_offset], lda, &w[1], &vl[
00821 vl_offset], ldvl, &vr[vr_offset], ldvr, &ilo, &ihi, &scale[1],
00822 &abnrm, &rconde[1], &rcondv[1], &work[1], lwork, &rwork[1], &
00823 iinfo);
00824 if (iinfo != 0) {
00825 result[1] = ulpinv;
00826 io___34.ciunit = *nounit;
00827 s_wsfe(&io___34);
00828 do_fio(&c__1, "ZGEEVX5", (ftnlen)7);
00829 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00830 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00831 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
00832 e_wsfe();
00833 *info = abs(iinfo);
00834 goto L250;
00835 }
00836
00837
00838
00839
00840 i__1 = *n - 1;
00841 for (i__ = 1; i__ <= i__1; ++i__) {
00842 kmin = i__;
00843 if (*isrt == 0) {
00844 i__2 = i__;
00845 vrimin = w[i__2].r;
00846 } else {
00847 vrimin = d_imag(&w[i__]);
00848 }
00849 i__2 = *n;
00850 for (j = i__ + 1; j <= i__2; ++j) {
00851 if (*isrt == 0) {
00852 i__3 = j;
00853 vricmp = w[i__3].r;
00854 } else {
00855 vricmp = d_imag(&w[j]);
00856 }
00857 if (vricmp < vrimin) {
00858 kmin = j;
00859 vrimin = vricmp;
00860 }
00861
00862 }
00863 i__2 = kmin;
00864 ctmp.r = w[i__2].r, ctmp.i = w[i__2].i;
00865 i__2 = kmin;
00866 i__3 = i__;
00867 w[i__2].r = w[i__3].r, w[i__2].i = w[i__3].i;
00868 i__2 = i__;
00869 w[i__2].r = ctmp.r, w[i__2].i = ctmp.i;
00870 vrimin = rconde[kmin];
00871 rconde[kmin] = rconde[i__];
00872 rconde[i__] = vrimin;
00873 vrimin = rcondv[kmin];
00874 rcondv[kmin] = rcondv[i__];
00875 rcondv[i__] = vrimin;
00876
00877 }
00878
00879
00880
00881
00882 result[10] = 0.;
00883 eps = max(5.9605e-8,ulp);
00884
00885 d__1 = (doublereal) (*n) * eps * abnrm;
00886 v = max(d__1,smlnum);
00887 if (abnrm == 0.) {
00888 v = 1.;
00889 }
00890 i__1 = *n;
00891 for (i__ = 1; i__ <= i__1; ++i__) {
00892 if (v > rcondv[i__] * rconde[i__]) {
00893 tol = rcondv[i__];
00894 } else {
00895 tol = v / rconde[i__];
00896 }
00897 if (v > rcdvin[i__] * rcdein[i__]) {
00898 tolin = rcdvin[i__];
00899 } else {
00900 tolin = v / rcdein[i__];
00901 }
00902
00903 d__1 = tol, d__2 = smlnum / eps;
00904 tol = max(d__1,d__2);
00905
00906 d__1 = tolin, d__2 = smlnum / eps;
00907 tolin = max(d__1,d__2);
00908 if (eps * (rcdvin[i__] - tolin) > rcondv[i__] + tol) {
00909 vmax = 1. / eps;
00910 } else if (rcdvin[i__] - tolin > rcondv[i__] + tol) {
00911 vmax = (rcdvin[i__] - tolin) / (rcondv[i__] + tol);
00912 } else if (rcdvin[i__] + tolin < eps * (rcondv[i__] - tol)) {
00913 vmax = 1. / eps;
00914 } else if (rcdvin[i__] + tolin < rcondv[i__] - tol) {
00915 vmax = (rcondv[i__] - tol) / (rcdvin[i__] + tolin);
00916 } else {
00917 vmax = 1.;
00918 }
00919 result[10] = max(result[10],vmax);
00920
00921 }
00922
00923
00924
00925
00926 result[11] = 0.;
00927 i__1 = *n;
00928 for (i__ = 1; i__ <= i__1; ++i__) {
00929 if (v > rcondv[i__]) {
00930 tol = 1.;
00931 } else {
00932 tol = v / rcondv[i__];
00933 }
00934 if (v > rcdvin[i__]) {
00935 tolin = 1.;
00936 } else {
00937 tolin = v / rcdvin[i__];
00938 }
00939
00940 d__1 = tol, d__2 = smlnum / eps;
00941 tol = max(d__1,d__2);
00942
00943 d__1 = tolin, d__2 = smlnum / eps;
00944 tolin = max(d__1,d__2);
00945 if (eps * (rcdein[i__] - tolin) > rconde[i__] + tol) {
00946 vmax = 1. / eps;
00947 } else if (rcdein[i__] - tolin > rconde[i__] + tol) {
00948 vmax = (rcdein[i__] - tolin) / (rconde[i__] + tol);
00949 } else if (rcdein[i__] + tolin < eps * (rconde[i__] - tol)) {
00950 vmax = 1. / eps;
00951 } else if (rcdein[i__] + tolin < rconde[i__] - tol) {
00952 vmax = (rconde[i__] - tol) / (rcdein[i__] + tolin);
00953 } else {
00954 vmax = 1.;
00955 }
00956 result[11] = max(result[11],vmax);
00957
00958 }
00959 L250:
00960
00961 ;
00962 }
00963
00964
00965 return 0;
00966
00967
00968
00969 }