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