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