00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015
00016
00017
00018 struct {
00019 integer selopt, seldim;
00020 logical selval[20];
00021 real selwr[20], selwi[20];
00022 } sslct_;
00023
00024 #define sslct_1 sslct_
00025
00026
00027
00028 static complex c_b1 = {0.f,0.f};
00029 static complex c_b2 = {1.f,0.f};
00030 static integer c__1 = 1;
00031 static integer c__4 = 4;
00032
00033 int cget24_(logical *comp, integer *jtype, real *thresh,
00034 integer *iseed, integer *nounit, integer *n, complex *a, integer *lda,
00035 complex *h__, complex *ht, complex *w, complex *wt, complex *wtmp,
00036 complex *vs, integer *ldvs, complex *vs1, real *rcdein, real *rcdvin,
00037 integer *nslct, integer *islct, integer *isrt, real *result, complex *
00038 work, integer *lwork, real *rwork, logical *bwork, integer *info)
00039 {
00040
00041 static char fmt_9998[] = "(\002 CGET24: \002,a,\002 returned INFO=\002,i"
00042 "6,\002.\002,/9x,\002N=\002,i6,\002, JTYPE=\002,i6,\002, ISEED="
00043 "(\002,3(i5,\002,\002),i5,\002)\002)";
00044 static char fmt_9999[] = "(\002 CGET24: \002,a,\002 returned INFO=\002,i"
00045 "6,\002.\002,/9x,\002N=\002,i6,\002, INPUT EXAMPLE NUMBER = \002,"
00046 "i4)";
00047
00048
00049 integer a_dim1, a_offset, h_dim1, h_offset, ht_dim1, ht_offset, vs_dim1,
00050 vs_offset, vs1_dim1, vs1_offset, i__1, i__2, i__3, i__4;
00051 real r__1, r__2;
00052 complex q__1;
00053
00054
00055 integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00056 double r_imag(complex *);
00057
00058
00059 integer i__, j;
00060 real v, eps, tol, ulp;
00061 integer sdim, kmin;
00062 complex ctmp;
00063 integer itmp, ipnt[20], rsub;
00064 char sort[1];
00065 integer sdim1;
00066 extern int cgemm_(char *, char *, integer *, integer *,
00067 integer *, complex *, complex *, integer *, complex *, integer *,
00068 complex *, complex *, integer *);
00069 integer iinfo;
00070 extern int cunt01_(char *, integer *, integer *, complex
00071 *, integer *, complex *, integer *, real *, real *);
00072 real anorm;
00073 extern int ccopy_(integer *, complex *, integer *,
00074 complex *, integer *);
00075 real tolin;
00076 integer isort;
00077 real wnorm, rcnde1, rcndv1;
00078 extern doublereal clange_(char *, integer *, integer *, complex *,
00079 integer *, real *), slamch_(char *);
00080 real rconde;
00081 extern int clacpy_(char *, integer *, integer *, complex
00082 *, integer *, complex *, integer *);
00083 extern logical cslect_(complex *);
00084 extern int cgeesx_(char *, char *, L_fp, char *, integer
00085 *, complex *, integer *, integer *, complex *, complex *, integer
00086 *, real *, real *, complex *, integer *, real *, logical *,
00087 integer *), xerbla_(char *, integer *);
00088 integer knteig;
00089 real rcondv, vricmp, vrimin, smlnum, ulpinv;
00090
00091
00092 static cilist io___12 = { 0, 0, 0, fmt_9998, 0 };
00093 static cilist io___13 = { 0, 0, 0, fmt_9999, 0 };
00094 static cilist io___17 = { 0, 0, 0, fmt_9998, 0 };
00095 static cilist io___18 = { 0, 0, 0, fmt_9999, 0 };
00096 static cilist io___21 = { 0, 0, 0, fmt_9998, 0 };
00097 static cilist io___22 = { 0, 0, 0, fmt_9999, 0 };
00098 static cilist io___25 = { 0, 0, 0, fmt_9998, 0 };
00099 static cilist io___26 = { 0, 0, 0, fmt_9999, 0 };
00100 static cilist io___27 = { 0, 0, 0, fmt_9998, 0 };
00101 static cilist io___28 = { 0, 0, 0, fmt_9999, 0 };
00102 static cilist io___29 = { 0, 0, 0, fmt_9998, 0 };
00103 static cilist io___30 = { 0, 0, 0, fmt_9999, 0 };
00104 static cilist io___31 = { 0, 0, 0, fmt_9998, 0 };
00105 static cilist io___32 = { 0, 0, 0, fmt_9999, 0 };
00106 static cilist io___33 = { 0, 0, 0, fmt_9998, 0 };
00107 static cilist io___34 = { 0, 0, 0, fmt_9999, 0 };
00108 static cilist io___42 = { 0, 0, 0, fmt_9999, 0 };
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
00343
00344
00345
00346
00347
00348
00349
00350 --iseed;
00351 ht_dim1 = *lda;
00352 ht_offset = 1 + ht_dim1;
00353 ht -= ht_offset;
00354 h_dim1 = *lda;
00355 h_offset = 1 + h_dim1;
00356 h__ -= h_offset;
00357 a_dim1 = *lda;
00358 a_offset = 1 + a_dim1;
00359 a -= a_offset;
00360 --w;
00361 --wt;
00362 --wtmp;
00363 vs1_dim1 = *ldvs;
00364 vs1_offset = 1 + vs1_dim1;
00365 vs1 -= vs1_offset;
00366 vs_dim1 = *ldvs;
00367 vs_offset = 1 + vs_dim1;
00368 vs -= vs_offset;
00369 --islct;
00370 --result;
00371 --work;
00372 --rwork;
00373 --bwork;
00374
00375
00376 *info = 0;
00377 if (*thresh < 0.f) {
00378 *info = -3;
00379 } else if (*nounit <= 0) {
00380 *info = -5;
00381 } else if (*n < 0) {
00382 *info = -6;
00383 } else if (*lda < 1 || *lda < *n) {
00384 *info = -8;
00385 } else if (*ldvs < 1 || *ldvs < *n) {
00386 *info = -15;
00387 } else if (*lwork < *n << 1) {
00388 *info = -24;
00389 }
00390
00391 if (*info != 0) {
00392 i__1 = -(*info);
00393 xerbla_("CGET24", &i__1);
00394 return 0;
00395 }
00396
00397
00398
00399 for (i__ = 1; i__ <= 17; ++i__) {
00400 result[i__] = -1.f;
00401
00402 }
00403
00404 if (*n == 0) {
00405 return 0;
00406 }
00407
00408
00409
00410 smlnum = slamch_("Safe minimum");
00411 ulp = slamch_("Precision");
00412 ulpinv = 1.f / ulp;
00413
00414
00415
00416 sslct_1.selopt = 0;
00417 for (isort = 0; isort <= 1; ++isort) {
00418 if (isort == 0) {
00419 *(unsigned char *)sort = 'N';
00420 rsub = 0;
00421 } else {
00422 *(unsigned char *)sort = 'S';
00423 rsub = 6;
00424 }
00425
00426
00427
00428 clacpy_("F", n, n, &a[a_offset], lda, &h__[h_offset], lda);
00429 cgeesx_("V", sort, (L_fp)cslect_, "N", n, &h__[h_offset], lda, &sdim,
00430 &w[1], &vs[vs_offset], ldvs, &rconde, &rcondv, &work[1],
00431 lwork, &rwork[1], &bwork[1], &iinfo);
00432 if (iinfo != 0) {
00433 result[rsub + 1] = ulpinv;
00434 if (*jtype != 22) {
00435 io___12.ciunit = *nounit;
00436 s_wsfe(&io___12);
00437 do_fio(&c__1, "CGEESX1", (ftnlen)7);
00438 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00439 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00440 do_fio(&c__1, (char *)&(*jtype), (ftnlen)sizeof(integer));
00441 do_fio(&c__4, (char *)&iseed[1], (ftnlen)sizeof(integer));
00442 e_wsfe();
00443 } else {
00444 io___13.ciunit = *nounit;
00445 s_wsfe(&io___13);
00446 do_fio(&c__1, "CGEESX1", (ftnlen)7);
00447 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00448 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00449 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
00450 e_wsfe();
00451 }
00452 *info = abs(iinfo);
00453 return 0;
00454 }
00455 if (isort == 0) {
00456 ccopy_(n, &w[1], &c__1, &wtmp[1], &c__1);
00457 }
00458
00459
00460
00461 result[rsub + 1] = 0.f;
00462 i__1 = *n - 1;
00463 for (j = 1; j <= i__1; ++j) {
00464 i__2 = *n;
00465 for (i__ = j + 1; i__ <= i__2; ++i__) {
00466 i__3 = i__ + j * h_dim1;
00467 if (h__[i__3].r != 0.f || h__[i__3].i != 0.f) {
00468 result[rsub + 1] = ulpinv;
00469 }
00470
00471 }
00472
00473 }
00474
00475
00476
00477
00478
00479 clacpy_(" ", n, n, &a[a_offset], lda, &vs1[vs1_offset], ldvs);
00480
00481
00482
00483 cgemm_("No transpose", "No transpose", n, n, n, &c_b2, &vs[vs_offset],
00484 ldvs, &h__[h_offset], lda, &c_b1, &ht[ht_offset], lda);
00485
00486
00487
00488 q__1.r = -1.f, q__1.i = -0.f;
00489 cgemm_("No transpose", "Conjugate transpose", n, n, n, &q__1, &ht[
00490 ht_offset], lda, &vs[vs_offset], ldvs, &c_b2, &vs1[vs1_offset]
00491 , ldvs);
00492
00493
00494 r__1 = clange_("1", n, n, &a[a_offset], lda, &rwork[1]);
00495 anorm = dmax(r__1,smlnum);
00496 wnorm = clange_("1", n, n, &vs1[vs1_offset], ldvs, &rwork[1]);
00497
00498 if (anorm > wnorm) {
00499 result[rsub + 2] = wnorm / anorm / (*n * ulp);
00500 } else {
00501 if (anorm < 1.f) {
00502
00503 r__1 = wnorm, r__2 = *n * anorm;
00504 result[rsub + 2] = dmin(r__1,r__2) / anorm / (*n * ulp);
00505 } else {
00506
00507 r__1 = wnorm / anorm, r__2 = (real) (*n);
00508 result[rsub + 2] = dmin(r__1,r__2) / (*n * ulp);
00509 }
00510 }
00511
00512
00513
00514 cunt01_("Columns", n, n, &vs[vs_offset], ldvs, &work[1], lwork, &
00515 rwork[1], &result[rsub + 3]);
00516
00517
00518
00519 result[rsub + 4] = 0.f;
00520 i__1 = *n;
00521 for (i__ = 1; i__ <= i__1; ++i__) {
00522 i__2 = i__ + i__ * h_dim1;
00523 i__3 = i__;
00524 if (h__[i__2].r != w[i__3].r || h__[i__2].i != w[i__3].i) {
00525 result[rsub + 4] = ulpinv;
00526 }
00527
00528 }
00529
00530
00531
00532 clacpy_("F", n, n, &a[a_offset], lda, &ht[ht_offset], lda);
00533 cgeesx_("N", sort, (L_fp)cslect_, "N", n, &ht[ht_offset], lda, &sdim,
00534 &wt[1], &vs[vs_offset], ldvs, &rconde, &rcondv, &work[1],
00535 lwork, &rwork[1], &bwork[1], &iinfo);
00536 if (iinfo != 0) {
00537 result[rsub + 5] = ulpinv;
00538 if (*jtype != 22) {
00539 io___17.ciunit = *nounit;
00540 s_wsfe(&io___17);
00541 do_fio(&c__1, "CGEESX2", (ftnlen)7);
00542 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00543 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00544 do_fio(&c__1, (char *)&(*jtype), (ftnlen)sizeof(integer));
00545 do_fio(&c__4, (char *)&iseed[1], (ftnlen)sizeof(integer));
00546 e_wsfe();
00547 } else {
00548 io___18.ciunit = *nounit;
00549 s_wsfe(&io___18);
00550 do_fio(&c__1, "CGEESX2", (ftnlen)7);
00551 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00552 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00553 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
00554 e_wsfe();
00555 }
00556 *info = abs(iinfo);
00557 goto L220;
00558 }
00559
00560 result[rsub + 5] = 0.f;
00561 i__1 = *n;
00562 for (j = 1; j <= i__1; ++j) {
00563 i__2 = *n;
00564 for (i__ = 1; i__ <= i__2; ++i__) {
00565 i__3 = i__ + j * h_dim1;
00566 i__4 = i__ + j * ht_dim1;
00567 if (h__[i__3].r != ht[i__4].r || h__[i__3].i != ht[i__4].i) {
00568 result[rsub + 5] = ulpinv;
00569 }
00570
00571 }
00572
00573 }
00574
00575
00576
00577 result[rsub + 6] = 0.f;
00578 i__1 = *n;
00579 for (i__ = 1; i__ <= i__1; ++i__) {
00580 i__2 = i__;
00581 i__3 = i__;
00582 if (w[i__2].r != wt[i__3].r || w[i__2].i != wt[i__3].i) {
00583 result[rsub + 6] = ulpinv;
00584 }
00585
00586 }
00587
00588
00589
00590 if (isort == 1) {
00591 result[13] = 0.f;
00592 knteig = 0;
00593 i__1 = *n;
00594 for (i__ = 1; i__ <= i__1; ++i__) {
00595 if (cslect_(&w[i__])) {
00596 ++knteig;
00597 }
00598 if (i__ < *n) {
00599 if (cslect_(&w[i__ + 1]) && ! cslect_(&w[i__])) {
00600 result[13] = ulpinv;
00601 }
00602 }
00603
00604 }
00605 if (sdim != knteig) {
00606 result[13] = ulpinv;
00607 }
00608 }
00609
00610
00611 }
00612
00613
00614
00615
00616 if (*lwork >= *n * (*n + 1) / 2) {
00617
00618
00619
00620 *(unsigned char *)sort = 'S';
00621 result[14] = 0.f;
00622 result[15] = 0.f;
00623 clacpy_("F", n, n, &a[a_offset], lda, &ht[ht_offset], lda);
00624 cgeesx_("V", sort, (L_fp)cslect_, "B", n, &ht[ht_offset], lda, &sdim1,
00625 &wt[1], &vs1[vs1_offset], ldvs, &rconde, &rcondv, &work[1],
00626 lwork, &rwork[1], &bwork[1], &iinfo);
00627 if (iinfo != 0) {
00628 result[14] = ulpinv;
00629 result[15] = ulpinv;
00630 if (*jtype != 22) {
00631 io___21.ciunit = *nounit;
00632 s_wsfe(&io___21);
00633 do_fio(&c__1, "CGEESX3", (ftnlen)7);
00634 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00635 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00636 do_fio(&c__1, (char *)&(*jtype), (ftnlen)sizeof(integer));
00637 do_fio(&c__4, (char *)&iseed[1], (ftnlen)sizeof(integer));
00638 e_wsfe();
00639 } else {
00640 io___22.ciunit = *nounit;
00641 s_wsfe(&io___22);
00642 do_fio(&c__1, "CGEESX3", (ftnlen)7);
00643 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00644 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00645 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
00646 e_wsfe();
00647 }
00648 *info = abs(iinfo);
00649 goto L220;
00650 }
00651
00652
00653
00654 i__1 = *n;
00655 for (i__ = 1; i__ <= i__1; ++i__) {
00656 i__2 = i__;
00657 i__3 = i__;
00658 if (w[i__2].r != wt[i__3].r || w[i__2].i != wt[i__3].i) {
00659 result[10] = ulpinv;
00660 }
00661 i__2 = *n;
00662 for (j = 1; j <= i__2; ++j) {
00663 i__3 = i__ + j * h_dim1;
00664 i__4 = i__ + j * ht_dim1;
00665 if (h__[i__3].r != ht[i__4].r || h__[i__3].i != ht[i__4].i) {
00666 result[11] = ulpinv;
00667 }
00668 i__3 = i__ + j * vs_dim1;
00669 i__4 = i__ + j * vs1_dim1;
00670 if (vs[i__3].r != vs1[i__4].r || vs[i__3].i != vs1[i__4].i) {
00671 result[12] = ulpinv;
00672 }
00673
00674 }
00675
00676 }
00677 if (sdim != sdim1) {
00678 result[13] = ulpinv;
00679 }
00680
00681
00682
00683 clacpy_("F", n, n, &a[a_offset], lda, &ht[ht_offset], lda);
00684 cgeesx_("N", sort, (L_fp)cslect_, "B", n, &ht[ht_offset], lda, &sdim1,
00685 &wt[1], &vs1[vs1_offset], ldvs, &rcnde1, &rcndv1, &work[1],
00686 lwork, &rwork[1], &bwork[1], &iinfo);
00687 if (iinfo != 0) {
00688 result[14] = ulpinv;
00689 result[15] = ulpinv;
00690 if (*jtype != 22) {
00691 io___25.ciunit = *nounit;
00692 s_wsfe(&io___25);
00693 do_fio(&c__1, "CGEESX4", (ftnlen)7);
00694 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00695 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00696 do_fio(&c__1, (char *)&(*jtype), (ftnlen)sizeof(integer));
00697 do_fio(&c__4, (char *)&iseed[1], (ftnlen)sizeof(integer));
00698 e_wsfe();
00699 } else {
00700 io___26.ciunit = *nounit;
00701 s_wsfe(&io___26);
00702 do_fio(&c__1, "CGEESX4", (ftnlen)7);
00703 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00704 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00705 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
00706 e_wsfe();
00707 }
00708 *info = abs(iinfo);
00709 goto L220;
00710 }
00711
00712
00713
00714 if (rcnde1 != rconde) {
00715 result[14] = ulpinv;
00716 }
00717 if (rcndv1 != rcondv) {
00718 result[15] = ulpinv;
00719 }
00720
00721
00722
00723 i__1 = *n;
00724 for (i__ = 1; i__ <= i__1; ++i__) {
00725 i__2 = i__;
00726 i__3 = i__;
00727 if (w[i__2].r != wt[i__3].r || w[i__2].i != wt[i__3].i) {
00728 result[10] = ulpinv;
00729 }
00730 i__2 = *n;
00731 for (j = 1; j <= i__2; ++j) {
00732 i__3 = i__ + j * h_dim1;
00733 i__4 = i__ + j * ht_dim1;
00734 if (h__[i__3].r != ht[i__4].r || h__[i__3].i != ht[i__4].i) {
00735 result[11] = ulpinv;
00736 }
00737 i__3 = i__ + j * vs_dim1;
00738 i__4 = i__ + j * vs1_dim1;
00739 if (vs[i__3].r != vs1[i__4].r || vs[i__3].i != vs1[i__4].i) {
00740 result[12] = ulpinv;
00741 }
00742
00743 }
00744
00745 }
00746 if (sdim != sdim1) {
00747 result[13] = ulpinv;
00748 }
00749
00750
00751
00752 clacpy_("F", n, n, &a[a_offset], lda, &ht[ht_offset], lda);
00753 cgeesx_("V", sort, (L_fp)cslect_, "E", n, &ht[ht_offset], lda, &sdim1,
00754 &wt[1], &vs1[vs1_offset], ldvs, &rcnde1, &rcndv1, &work[1],
00755 lwork, &rwork[1], &bwork[1], &iinfo);
00756 if (iinfo != 0) {
00757 result[14] = ulpinv;
00758 if (*jtype != 22) {
00759 io___27.ciunit = *nounit;
00760 s_wsfe(&io___27);
00761 do_fio(&c__1, "CGEESX5", (ftnlen)7);
00762 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00763 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00764 do_fio(&c__1, (char *)&(*jtype), (ftnlen)sizeof(integer));
00765 do_fio(&c__4, (char *)&iseed[1], (ftnlen)sizeof(integer));
00766 e_wsfe();
00767 } else {
00768 io___28.ciunit = *nounit;
00769 s_wsfe(&io___28);
00770 do_fio(&c__1, "CGEESX5", (ftnlen)7);
00771 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00772 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00773 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
00774 e_wsfe();
00775 }
00776 *info = abs(iinfo);
00777 goto L220;
00778 }
00779
00780
00781
00782 if (rcnde1 != rconde) {
00783 result[14] = ulpinv;
00784 }
00785
00786
00787
00788 i__1 = *n;
00789 for (i__ = 1; i__ <= i__1; ++i__) {
00790 i__2 = i__;
00791 i__3 = i__;
00792 if (w[i__2].r != wt[i__3].r || w[i__2].i != wt[i__3].i) {
00793 result[10] = ulpinv;
00794 }
00795 i__2 = *n;
00796 for (j = 1; j <= i__2; ++j) {
00797 i__3 = i__ + j * h_dim1;
00798 i__4 = i__ + j * ht_dim1;
00799 if (h__[i__3].r != ht[i__4].r || h__[i__3].i != ht[i__4].i) {
00800 result[11] = ulpinv;
00801 }
00802 i__3 = i__ + j * vs_dim1;
00803 i__4 = i__ + j * vs1_dim1;
00804 if (vs[i__3].r != vs1[i__4].r || vs[i__3].i != vs1[i__4].i) {
00805 result[12] = ulpinv;
00806 }
00807
00808 }
00809
00810 }
00811 if (sdim != sdim1) {
00812 result[13] = ulpinv;
00813 }
00814
00815
00816
00817 clacpy_("F", n, n, &a[a_offset], lda, &ht[ht_offset], lda);
00818 cgeesx_("N", sort, (L_fp)cslect_, "E", n, &ht[ht_offset], lda, &sdim1,
00819 &wt[1], &vs1[vs1_offset], ldvs, &rcnde1, &rcndv1, &work[1],
00820 lwork, &rwork[1], &bwork[1], &iinfo);
00821 if (iinfo != 0) {
00822 result[14] = ulpinv;
00823 if (*jtype != 22) {
00824 io___29.ciunit = *nounit;
00825 s_wsfe(&io___29);
00826 do_fio(&c__1, "CGEESX6", (ftnlen)7);
00827 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00828 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00829 do_fio(&c__1, (char *)&(*jtype), (ftnlen)sizeof(integer));
00830 do_fio(&c__4, (char *)&iseed[1], (ftnlen)sizeof(integer));
00831 e_wsfe();
00832 } else {
00833 io___30.ciunit = *nounit;
00834 s_wsfe(&io___30);
00835 do_fio(&c__1, "CGEESX6", (ftnlen)7);
00836 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00837 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00838 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
00839 e_wsfe();
00840 }
00841 *info = abs(iinfo);
00842 goto L220;
00843 }
00844
00845
00846
00847 if (rcnde1 != rconde) {
00848 result[14] = ulpinv;
00849 }
00850
00851
00852
00853 i__1 = *n;
00854 for (i__ = 1; i__ <= i__1; ++i__) {
00855 i__2 = i__;
00856 i__3 = i__;
00857 if (w[i__2].r != wt[i__3].r || w[i__2].i != wt[i__3].i) {
00858 result[10] = ulpinv;
00859 }
00860 i__2 = *n;
00861 for (j = 1; j <= i__2; ++j) {
00862 i__3 = i__ + j * h_dim1;
00863 i__4 = i__ + j * ht_dim1;
00864 if (h__[i__3].r != ht[i__4].r || h__[i__3].i != ht[i__4].i) {
00865 result[11] = ulpinv;
00866 }
00867 i__3 = i__ + j * vs_dim1;
00868 i__4 = i__ + j * vs1_dim1;
00869 if (vs[i__3].r != vs1[i__4].r || vs[i__3].i != vs1[i__4].i) {
00870 result[12] = ulpinv;
00871 }
00872
00873 }
00874
00875 }
00876 if (sdim != sdim1) {
00877 result[13] = ulpinv;
00878 }
00879
00880
00881
00882 clacpy_("F", n, n, &a[a_offset], lda, &ht[ht_offset], lda);
00883 cgeesx_("V", sort, (L_fp)cslect_, "V", n, &ht[ht_offset], lda, &sdim1,
00884 &wt[1], &vs1[vs1_offset], ldvs, &rcnde1, &rcndv1, &work[1],
00885 lwork, &rwork[1], &bwork[1], &iinfo);
00886 if (iinfo != 0) {
00887 result[15] = ulpinv;
00888 if (*jtype != 22) {
00889 io___31.ciunit = *nounit;
00890 s_wsfe(&io___31);
00891 do_fio(&c__1, "CGEESX7", (ftnlen)7);
00892 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00893 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00894 do_fio(&c__1, (char *)&(*jtype), (ftnlen)sizeof(integer));
00895 do_fio(&c__4, (char *)&iseed[1], (ftnlen)sizeof(integer));
00896 e_wsfe();
00897 } else {
00898 io___32.ciunit = *nounit;
00899 s_wsfe(&io___32);
00900 do_fio(&c__1, "CGEESX7", (ftnlen)7);
00901 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00902 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00903 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
00904 e_wsfe();
00905 }
00906 *info = abs(iinfo);
00907 goto L220;
00908 }
00909
00910
00911
00912 if (rcndv1 != rcondv) {
00913 result[15] = ulpinv;
00914 }
00915
00916
00917
00918 i__1 = *n;
00919 for (i__ = 1; i__ <= i__1; ++i__) {
00920 i__2 = i__;
00921 i__3 = i__;
00922 if (w[i__2].r != wt[i__3].r || w[i__2].i != wt[i__3].i) {
00923 result[10] = ulpinv;
00924 }
00925 i__2 = *n;
00926 for (j = 1; j <= i__2; ++j) {
00927 i__3 = i__ + j * h_dim1;
00928 i__4 = i__ + j * ht_dim1;
00929 if (h__[i__3].r != ht[i__4].r || h__[i__3].i != ht[i__4].i) {
00930 result[11] = ulpinv;
00931 }
00932 i__3 = i__ + j * vs_dim1;
00933 i__4 = i__ + j * vs1_dim1;
00934 if (vs[i__3].r != vs1[i__4].r || vs[i__3].i != vs1[i__4].i) {
00935 result[12] = ulpinv;
00936 }
00937
00938 }
00939
00940 }
00941 if (sdim != sdim1) {
00942 result[13] = ulpinv;
00943 }
00944
00945
00946
00947 clacpy_("F", n, n, &a[a_offset], lda, &ht[ht_offset], lda);
00948 cgeesx_("N", sort, (L_fp)cslect_, "V", n, &ht[ht_offset], lda, &sdim1,
00949 &wt[1], &vs1[vs1_offset], ldvs, &rcnde1, &rcndv1, &work[1],
00950 lwork, &rwork[1], &bwork[1], &iinfo);
00951 if (iinfo != 0) {
00952 result[15] = ulpinv;
00953 if (*jtype != 22) {
00954 io___33.ciunit = *nounit;
00955 s_wsfe(&io___33);
00956 do_fio(&c__1, "CGEESX8", (ftnlen)7);
00957 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00958 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00959 do_fio(&c__1, (char *)&(*jtype), (ftnlen)sizeof(integer));
00960 do_fio(&c__4, (char *)&iseed[1], (ftnlen)sizeof(integer));
00961 e_wsfe();
00962 } else {
00963 io___34.ciunit = *nounit;
00964 s_wsfe(&io___34);
00965 do_fio(&c__1, "CGEESX8", (ftnlen)7);
00966 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
00967 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
00968 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
00969 e_wsfe();
00970 }
00971 *info = abs(iinfo);
00972 goto L220;
00973 }
00974
00975
00976
00977 if (rcndv1 != rcondv) {
00978 result[15] = ulpinv;
00979 }
00980
00981
00982
00983 i__1 = *n;
00984 for (i__ = 1; i__ <= i__1; ++i__) {
00985 i__2 = i__;
00986 i__3 = i__;
00987 if (w[i__2].r != wt[i__3].r || w[i__2].i != wt[i__3].i) {
00988 result[10] = ulpinv;
00989 }
00990 i__2 = *n;
00991 for (j = 1; j <= i__2; ++j) {
00992 i__3 = i__ + j * h_dim1;
00993 i__4 = i__ + j * ht_dim1;
00994 if (h__[i__3].r != ht[i__4].r || h__[i__3].i != ht[i__4].i) {
00995 result[11] = ulpinv;
00996 }
00997 i__3 = i__ + j * vs_dim1;
00998 i__4 = i__ + j * vs1_dim1;
00999 if (vs[i__3].r != vs1[i__4].r || vs[i__3].i != vs1[i__4].i) {
01000 result[12] = ulpinv;
01001 }
01002
01003 }
01004
01005 }
01006 if (sdim != sdim1) {
01007 result[13] = ulpinv;
01008 }
01009
01010 }
01011
01012 L220:
01013
01014
01015
01016
01017 if (*comp) {
01018
01019
01020
01021
01022
01023 sslct_1.seldim = *n;
01024 sslct_1.selopt = 1;
01025 eps = dmax(ulp,5.9605e-8f);
01026 i__1 = *n;
01027 for (i__ = 1; i__ <= i__1; ++i__) {
01028 ipnt[i__ - 1] = i__;
01029 sslct_1.selval[i__ - 1] = FALSE_;
01030 i__2 = i__;
01031 sslct_1.selwr[i__ - 1] = wtmp[i__2].r;
01032 sslct_1.selwi[i__ - 1] = r_imag(&wtmp[i__]);
01033
01034 }
01035 i__1 = *n - 1;
01036 for (i__ = 1; i__ <= i__1; ++i__) {
01037 kmin = i__;
01038 if (*isrt == 0) {
01039 i__2 = i__;
01040 vrimin = wtmp[i__2].r;
01041 } else {
01042 vrimin = r_imag(&wtmp[i__]);
01043 }
01044 i__2 = *n;
01045 for (j = i__ + 1; j <= i__2; ++j) {
01046 if (*isrt == 0) {
01047 i__3 = j;
01048 vricmp = wtmp[i__3].r;
01049 } else {
01050 vricmp = r_imag(&wtmp[j]);
01051 }
01052 if (vricmp < vrimin) {
01053 kmin = j;
01054 vrimin = vricmp;
01055 }
01056
01057 }
01058 i__2 = kmin;
01059 ctmp.r = wtmp[i__2].r, ctmp.i = wtmp[i__2].i;
01060 i__2 = kmin;
01061 i__3 = i__;
01062 wtmp[i__2].r = wtmp[i__3].r, wtmp[i__2].i = wtmp[i__3].i;
01063 i__2 = i__;
01064 wtmp[i__2].r = ctmp.r, wtmp[i__2].i = ctmp.i;
01065 itmp = ipnt[i__ - 1];
01066 ipnt[i__ - 1] = ipnt[kmin - 1];
01067 ipnt[kmin - 1] = itmp;
01068
01069 }
01070 i__1 = *nslct;
01071 for (i__ = 1; i__ <= i__1; ++i__) {
01072 sslct_1.selval[ipnt[islct[i__] - 1] - 1] = TRUE_;
01073
01074 }
01075
01076
01077
01078 clacpy_("F", n, n, &a[a_offset], lda, &ht[ht_offset], lda);
01079 cgeesx_("N", "S", (L_fp)cslect_, "B", n, &ht[ht_offset], lda, &sdim1,
01080 &wt[1], &vs1[vs1_offset], ldvs, &rconde, &rcondv, &work[1],
01081 lwork, &rwork[1], &bwork[1], &iinfo);
01082 if (iinfo != 0) {
01083 result[16] = ulpinv;
01084 result[17] = ulpinv;
01085 io___42.ciunit = *nounit;
01086 s_wsfe(&io___42);
01087 do_fio(&c__1, "CGEESX9", (ftnlen)7);
01088 do_fio(&c__1, (char *)&iinfo, (ftnlen)sizeof(integer));
01089 do_fio(&c__1, (char *)&(*n), (ftnlen)sizeof(integer));
01090 do_fio(&c__1, (char *)&iseed[1], (ftnlen)sizeof(integer));
01091 e_wsfe();
01092 *info = abs(iinfo);
01093 goto L270;
01094 }
01095
01096
01097
01098
01099 anorm = clange_("1", n, n, &a[a_offset], lda, &rwork[1]);
01100
01101 r__1 = (real) (*n) * eps * anorm;
01102 v = dmax(r__1,smlnum);
01103 if (anorm == 0.f) {
01104 v = 1.f;
01105 }
01106 if (v > rcondv) {
01107 tol = 1.f;
01108 } else {
01109 tol = v / rcondv;
01110 }
01111 if (v > *rcdvin) {
01112 tolin = 1.f;
01113 } else {
01114 tolin = v / *rcdvin;
01115 }
01116
01117 r__1 = tol, r__2 = smlnum / eps;
01118 tol = dmax(r__1,r__2);
01119
01120 r__1 = tolin, r__2 = smlnum / eps;
01121 tolin = dmax(r__1,r__2);
01122 if (eps * (*rcdein - tolin) > rconde + tol) {
01123 result[16] = ulpinv;
01124 } else if (*rcdein - tolin > rconde + tol) {
01125 result[16] = (*rcdein - tolin) / (rconde + tol);
01126 } else if (*rcdein + tolin < eps * (rconde - tol)) {
01127 result[16] = ulpinv;
01128 } else if (*rcdein + tolin < rconde - tol) {
01129 result[16] = (rconde - tol) / (*rcdein + tolin);
01130 } else {
01131 result[16] = 1.f;
01132 }
01133
01134
01135
01136
01137 if (v > rcondv * rconde) {
01138 tol = rcondv;
01139 } else {
01140 tol = v / rconde;
01141 }
01142 if (v > *rcdvin * *rcdein) {
01143 tolin = *rcdvin;
01144 } else {
01145 tolin = v / *rcdein;
01146 }
01147
01148 r__1 = tol, r__2 = smlnum / eps;
01149 tol = dmax(r__1,r__2);
01150
01151 r__1 = tolin, r__2 = smlnum / eps;
01152 tolin = dmax(r__1,r__2);
01153 if (eps * (*rcdvin - tolin) > rcondv + tol) {
01154 result[17] = ulpinv;
01155 } else if (*rcdvin - tolin > rcondv + tol) {
01156 result[17] = (*rcdvin - tolin) / (rcondv + tol);
01157 } else if (*rcdvin + tolin < eps * (rcondv - tol)) {
01158 result[17] = ulpinv;
01159 } else if (*rcdvin + tolin < rcondv - tol) {
01160 result[17] = (rcondv - tol) / (*rcdvin + tolin);
01161 } else {
01162 result[17] = 1.f;
01163 }
01164
01165 L270:
01166
01167 ;
01168 }
01169
01170
01171 return 0;
01172
01173
01174
01175 }