sget24.c
Go to the documentation of this file.
00001 /* sget24.f -- translated by f2c (version 20061008).
00002    You must link the resulting object file with libf2c:
00003         on Microsoft Windows system, link with libf2c.lib;
00004         on Linux or Unix systems, link with .../path/to/libf2c.a -lm
00005         or, if you install libf2c.a in a standard place, with -lf2c -lm
00006         -- in that order, at the end of the command line, as in
00007                 cc *.o -lf2c -lm
00008         Source for libf2c is in /netlib/f2c/libf2c.zip, e.g.,
00009 
00010                 http://www.netlib.org/f2c/libf2c.zip
00011 */
00012 
00013 #include "f2c.h"
00014 #include "blaswrap.h"
00015 
00016 /* Common Block Declarations */
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 /* Table of constant values */
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 /* Subroutine */ 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     /* Format strings */
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     /* System generated locals */
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     /* Builtin functions */
00055     integer s_wsfe(cilist *), do_fio(integer *, char *, ftnlen), e_wsfe(void);
00056     double r_sign(real *, real *), sqrt(doublereal);
00057 
00058     /* Local variables */
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 /* Subroutine */ int sgemm_(char *, char *, integer *, integer *, 
00065             integer *, real *, real *, integer *, real *, integer *, real *, 
00066             real *, integer *);
00067     real anorm, vimin, tolin;
00068     extern /* Subroutine */ int sort01_(char *, integer *, integer *, real *, 
00069             integer *, real *, integer *, real *);
00070     real vrmin;
00071     integer isort;
00072     real wnorm;
00073     extern /* Subroutine */ 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 /* Subroutine */ int xerbla_(char *, integer *);
00080     integer knteig;
00081     real rcondv;
00082     extern /* Subroutine */ int slacpy_(char *, integer *, integer *, real *, 
00083             integer *, real *, integer *);
00084     extern logical sslect_(real *, real *);
00085     extern /* Subroutine */ 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     /* Fortran I/O blocks */
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 /*  -- LAPACK test routine (version 3.1) -- */
00114 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00115 /*     November 2006 */
00116 
00117 /*     .. Scalar Arguments .. */
00118 /*     .. */
00119 /*     .. Array Arguments .. */
00120 /*     .. */
00121 
00122 /*  Purpose */
00123 /*  ======= */
00124 
00125 /*     SGET24 checks the nonsymmetric eigenvalue (Schur form) problem */
00126 /*     expert driver SGEESX. */
00127 
00128 /*     If COMP = .FALSE., the first 13 of the following tests will be */
00129 /*     be performed on the input matrix A, and also tests 14 and 15 */
00130 /*     if LWORK is sufficiently large. */
00131 /*     If COMP = .TRUE., all 17 test will be performed. */
00132 
00133 /*     (1)     0 if T is in Schur form, 1/ulp otherwise */
00134 /*            (no sorting of eigenvalues) */
00135 
00136 /*     (2)     | A - VS T VS' | / ( n |A| ulp ) */
00137 
00138 /*       Here VS is the matrix of Schur eigenvectors, and T is in Schur */
00139 /*       form  (no sorting of eigenvalues). */
00140 
00141 /*     (3)     | I - VS VS' | / ( n ulp ) (no sorting of eigenvalues). */
00142 
00143 /*     (4)     0     if WR+sqrt(-1)*WI are eigenvalues of T */
00144 /*             1/ulp otherwise */
00145 /*             (no sorting of eigenvalues) */
00146 
00147 /*     (5)     0     if T(with VS) = T(without VS), */
00148 /*             1/ulp otherwise */
00149 /*             (no sorting of eigenvalues) */
00150 
00151 /*     (6)     0     if eigenvalues(with VS) = eigenvalues(without VS), */
00152 /*             1/ulp otherwise */
00153 /*             (no sorting of eigenvalues) */
00154 
00155 /*     (7)     0 if T is in Schur form, 1/ulp otherwise */
00156 /*             (with sorting of eigenvalues) */
00157 
00158 /*     (8)     | A - VS T VS' | / ( n |A| ulp ) */
00159 
00160 /*       Here VS is the matrix of Schur eigenvectors, and T is in Schur */
00161 /*       form  (with sorting of eigenvalues). */
00162 
00163 /*     (9)     | I - VS VS' | / ( n ulp ) (with sorting of eigenvalues). */
00164 
00165 /*     (10)    0     if WR+sqrt(-1)*WI are eigenvalues of T */
00166 /*             1/ulp otherwise */
00167 /*             If workspace sufficient, also compare WR, WI with and */
00168 /*             without reciprocal condition numbers */
00169 /*             (with sorting of eigenvalues) */
00170 
00171 /*     (11)    0     if T(with VS) = T(without VS), */
00172 /*             1/ulp otherwise */
00173 /*             If workspace sufficient, also compare T with and without */
00174 /*             reciprocal condition numbers */
00175 /*             (with sorting of eigenvalues) */
00176 
00177 /*     (12)    0     if eigenvalues(with VS) = eigenvalues(without VS), */
00178 /*             1/ulp otherwise */
00179 /*             If workspace sufficient, also compare VS with and without */
00180 /*             reciprocal condition numbers */
00181 /*             (with sorting of eigenvalues) */
00182 
00183 /*     (13)    if sorting worked and SDIM is the number of */
00184 /*             eigenvalues which were SELECTed */
00185 /*             If workspace sufficient, also compare SDIM with and */
00186 /*             without reciprocal condition numbers */
00187 
00188 /*     (14)    if RCONDE the same no matter if VS and/or RCONDV computed */
00189 
00190 /*     (15)    if RCONDV the same no matter if VS and/or RCONDE computed */
00191 
00192 /*     (16)  |RCONDE - RCDEIN| / cond(RCONDE) */
00193 
00194 /*        RCONDE is the reciprocal average eigenvalue condition number */
00195 /*        computed by SGEESX and RCDEIN (the precomputed true value) */
00196 /*        is supplied as input.  cond(RCONDE) is the condition number */
00197 /*        of RCONDE, and takes errors in computing RCONDE into account, */
00198 /*        so that the resulting quantity should be O(ULP). cond(RCONDE) */
00199 /*        is essentially given by norm(A)/RCONDV. */
00200 
00201 /*     (17)  |RCONDV - RCDVIN| / cond(RCONDV) */
00202 
00203 /*        RCONDV is the reciprocal right invariant subspace condition */
00204 /*        number computed by SGEESX and RCDVIN (the precomputed true */
00205 /*        value) is supplied as input. cond(RCONDV) is the condition */
00206 /*        number of RCONDV, and takes errors in computing RCONDV into */
00207 /*        account, so that the resulting quantity should be O(ULP). */
00208 /*        cond(RCONDV) is essentially given by norm(A)/RCONDE. */
00209 
00210 /*  Arguments */
00211 /*  ========= */
00212 
00213 /*  COMP    (input) LOGICAL */
00214 /*          COMP describes which input tests to perform: */
00215 /*            = .FALSE. if the computed condition numbers are not to */
00216 /*                      be tested against RCDVIN and RCDEIN */
00217 /*            = .TRUE.  if they are to be compared */
00218 
00219 /*  JTYPE   (input) INTEGER */
00220 /*          Type of input matrix. Used to label output if error occurs. */
00221 
00222 /*  ISEED   (input) INTEGER array, dimension (4) */
00223 /*          If COMP = .FALSE., the random number generator seed */
00224 /*          used to produce matrix. */
00225 /*          If COMP = .TRUE., ISEED(1) = the number of the example. */
00226 /*          Used to label output if error occurs. */
00227 
00228 /*  THRESH  (input) REAL */
00229 /*          A test will count as "failed" if the "error", computed as */
00230 /*          described above, exceeds THRESH.  Note that the error */
00231 /*          is scaled to be O(1), so THRESH should be a reasonably */
00232 /*          small multiple of 1, e.g., 10 or 100.  In particular, */
00233 /*          it should not depend on the precision (single vs. double) */
00234 /*          or the size of the matrix.  It must be at least zero. */
00235 
00236 /*  NOUNIT  (input) INTEGER */
00237 /*          The FORTRAN unit number for printing out error messages */
00238 /*          (e.g., if a routine returns INFO not equal to 0.) */
00239 
00240 /*  N       (input) INTEGER */
00241 /*          The dimension of A. N must be at least 0. */
00242 
00243 /*  A       (input/output) REAL array, dimension (LDA, N) */
00244 /*          Used to hold the matrix whose eigenvalues are to be */
00245 /*          computed. */
00246 
00247 /*  LDA     (input) INTEGER */
00248 /*          The leading dimension of A, and H. LDA must be at */
00249 /*          least 1 and at least N. */
00250 
00251 /*  H       (workspace) REAL array, dimension (LDA, N) */
00252 /*          Another copy of the test matrix A, modified by SGEESX. */
00253 
00254 /*  HT      (workspace) REAL array, dimension (LDA, N) */
00255 /*          Yet another copy of the test matrix A, modified by SGEESX. */
00256 
00257 /*  WR      (workspace) REAL array, dimension (N) */
00258 /*  WI      (workspace) REAL array, dimension (N) */
00259 /*          The real and imaginary parts of the eigenvalues of A. */
00260 /*          On exit, WR + WI*i are the eigenvalues of the matrix in A. */
00261 
00262 /*  WRT     (workspace) REAL array, dimension (N) */
00263 /*  WIT     (workspace) REAL array, dimension (N) */
00264 /*          Like WR, WI, these arrays contain the eigenvalues of A, */
00265 /*          but those computed when SGEESX only computes a partial */
00266 /*          eigendecomposition, i.e. not Schur vectors */
00267 
00268 /*  WRTMP   (workspace) REAL array, dimension (N) */
00269 /*  WITMP   (workspace) REAL array, dimension (N) */
00270 /*          Like WR, WI, these arrays contain the eigenvalues of A, */
00271 /*          but sorted by increasing real part. */
00272 
00273 /*  VS      (workspace) REAL array, dimension (LDVS, N) */
00274 /*          VS holds the computed Schur vectors. */
00275 
00276 /*  LDVS    (input) INTEGER */
00277 /*          Leading dimension of VS. Must be at least max(1, N). */
00278 
00279 /*  VS1     (workspace) REAL array, dimension (LDVS, N) */
00280 /*          VS1 holds another copy of the computed Schur vectors. */
00281 
00282 /*  RCDEIN  (input) REAL */
00283 /*          When COMP = .TRUE. RCDEIN holds the precomputed reciprocal */
00284 /*          condition number for the average of selected eigenvalues. */
00285 
00286 /*  RCDVIN  (input) REAL */
00287 /*          When COMP = .TRUE. RCDVIN holds the precomputed reciprocal */
00288 /*          condition number for the selected right invariant subspace. */
00289 
00290 /*  NSLCT   (input) INTEGER */
00291 /*          When COMP = .TRUE. the number of selected eigenvalues */
00292 /*          corresponding to the precomputed values RCDEIN and RCDVIN. */
00293 
00294 /*  ISLCT   (input) INTEGER array, dimension (NSLCT) */
00295 /*          When COMP = .TRUE. ISLCT selects the eigenvalues of the */
00296 /*          input matrix corresponding to the precomputed values RCDEIN */
00297 /*          and RCDVIN. For I=1, ... ,NSLCT, if ISLCT(I) = J, then the */
00298 /*          eigenvalue with the J-th largest real part is selected. */
00299 /*          Not referenced if COMP = .FALSE. */
00300 
00301 /*  RESULT  (output) REAL array, dimension (17) */
00302 /*          The values computed by the 17 tests described above. */
00303 /*          The values are currently limited to 1/ulp, to avoid */
00304 /*          overflow. */
00305 
00306 /*  WORK    (workspace) REAL array, dimension (LWORK) */
00307 
00308 /*  LWORK   (input) INTEGER */
00309 /*          The number of entries in WORK to be passed to SGEESX. This */
00310 /*          must be at least 3*N, and N+N**2 if tests 14--16 are to */
00311 /*          be performed. */
00312 
00313 /*  IWORK   (workspace) INTEGER array, dimension (N*N) */
00314 
00315 /*  BWORK   (workspace) LOGICAL array, dimension (N) */
00316 
00317 /*  INFO    (output) INTEGER */
00318 /*          If 0,  successful exit. */
00319 /*          If <0, input parameter -INFO had an incorrect value. */
00320 /*          If >0, SGEESX returned an error code, the absolute */
00321 /*                 value of which is returned. */
00322 
00323 /*  ===================================================================== */
00324 
00325 /*     .. Parameters .. */
00326 /*     .. */
00327 /*     .. Local Scalars .. */
00328 /*     .. */
00329 /*     .. Local Arrays .. */
00330 /*     .. */
00331 /*     .. Arrays in Common .. */
00332 /*     .. */
00333 /*     .. Scalars in Common .. */
00334 /*     .. */
00335 /*     .. Common blocks .. */
00336 /*     .. */
00337 /*     .. External Functions .. */
00338 /*     .. */
00339 /*     .. External Subroutines .. */
00340 /*     .. */
00341 /*     .. Intrinsic Functions .. */
00342 /*     .. */
00343 /*     .. Executable Statements .. */
00344 
00345 /*     Check for errors */
00346 
00347     /* Parameter adjustments */
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     /* Function Body */
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 /*     Quick return if nothing to do */
00399 
00400     for (i__ = 1; i__ <= 17; ++i__) {
00401         result[i__] = -1.f;
00402 /* L10: */
00403     }
00404 
00405     if (*n == 0) {
00406         return 0;
00407     }
00408 
00409 /*     Important constants */
00410 
00411     smlnum = slamch_("Safe minimum");
00412     ulp = slamch_("Precision");
00413     ulpinv = 1.f / ulp;
00414 
00415 /*     Perform tests (1)-(13) */
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 /*        Compute Schur form and Schur vectors, and test them */
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 /*        Do Test (1) or Test (7) */
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 /* L20: */
00473             }
00474 /* L30: */
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 /* L40: */
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 /* L50: */
00495         }
00496 
00497 /*        Test (2) or (8): Compute norm(A - Q*H*Q') / (norm(A) * N * ULP) */
00498 
00499 /*        Copy A to VS1, used as workspace */
00500 
00501         slacpy_(" ", n, n, &a[a_offset], lda, &vs1[vs1_offset], ldvs);
00502 
00503 /*        Compute Q*H and store in HT. */
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 /*        Compute A - Q*H*Q' */
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 /* Computing MAX */
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 /* Computing MIN */
00523                 r__1 = wnorm, r__2 = *n * anorm;
00524                 result[rsub + 2] = dmin(r__1,r__2) / anorm / (*n * ulp);
00525             } else {
00526 /* Computing MIN */
00527                 r__1 = wnorm / anorm, r__2 = (real) (*n);
00528                 result[rsub + 2] = dmin(r__1,r__2) / (*n * ulp);
00529             }
00530         }
00531 
00532 /*        Test (3) or (9):  Compute norm( I - Q'*Q ) / ( N * ULP ) */
00533 
00534         sort01_("Columns", n, n, &vs[vs_offset], ldvs, &work[1], lwork, &
00535                 result[rsub + 3]);
00536 
00537 /*        Do Test (4) or Test (10) */
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 /* L60: */
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 /* Computing MAX */
00562 /* Computing MAX */
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 /* Computing MAX */
00568 /* Computing MAX */
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 /* L70: */
00580         }
00581 
00582 /*        Do Test (5) or Test (11) */
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 /* L80: */
00621             }
00622 /* L90: */
00623         }
00624 
00625 /*        Do Test (6) or Test (12) */
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 /* L100: */
00634         }
00635 
00636 /*        Do Test (13) */
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 /* L110: */
00658             }
00659             if (sdim != knteig) {
00660                 result[13] = ulpinv;
00661             }
00662         }
00663 
00664 /* L120: */
00665     }
00666 
00667 /*     If there is enough workspace, perform tests (14) and (15) */
00668 /*     as well as (10) through (13) */
00669 
00670     if (*lwork >= *n + *n * *n / 2) {
00671 
00672 /*        Compute both RCONDE and RCONDV with VS */
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 /*        Perform tests (10), (11), (12), and (13) */
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 /* L130: */
00722             }
00723 /* L140: */
00724         }
00725         if (sdim != sdim1) {
00726             result[13] = ulpinv;
00727         }
00728 
00729 /*        Compute both RCONDE and RCONDV without VS, and compare */
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 /*        Perform tests (14) and (15) */
00761 
00762         if (rcnde1 != rconde) {
00763             result[14] = ulpinv;
00764         }
00765         if (rcndv1 != rcondv) {
00766             result[15] = ulpinv;
00767         }
00768 
00769 /*        Perform tests (10), (11), (12), and (13) */
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 /* L150: */
00785             }
00786 /* L160: */
00787         }
00788         if (sdim != sdim1) {
00789             result[13] = ulpinv;
00790         }
00791 
00792 /*        Compute RCONDE with VS, and compare */
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 /*        Perform test (14) */
00823 
00824         if (rcnde1 != rconde) {
00825             result[14] = ulpinv;
00826         }
00827 
00828 /*        Perform tests (10), (11), (12), and (13) */
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 /* L170: */
00844             }
00845 /* L180: */
00846         }
00847         if (sdim != sdim1) {
00848             result[13] = ulpinv;
00849         }
00850 
00851 /*        Compute RCONDE without VS, and compare */
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 /*        Perform test (14) */
00882 
00883         if (rcnde1 != rconde) {
00884             result[14] = ulpinv;
00885         }
00886 
00887 /*        Perform tests (10), (11), (12), and (13) */
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 /* L190: */
00903             }
00904 /* L200: */
00905         }
00906         if (sdim != sdim1) {
00907             result[13] = ulpinv;
00908         }
00909 
00910 /*        Compute RCONDV with VS, and compare */
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 /*        Perform test (15) */
00941 
00942         if (rcndv1 != rcondv) {
00943             result[15] = ulpinv;
00944         }
00945 
00946 /*        Perform tests (10), (11), (12), and (13) */
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 /* L210: */
00962             }
00963 /* L220: */
00964         }
00965         if (sdim != sdim1) {
00966             result[13] = ulpinv;
00967         }
00968 
00969 /*        Compute RCONDV without VS, and compare */
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 /*        Perform test (15) */
01000 
01001         if (rcndv1 != rcondv) {
01002             result[15] = ulpinv;
01003         }
01004 
01005 /*        Perform tests (10), (11), (12), and (13) */
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 /* L230: */
01021             }
01022 /* L240: */
01023         }
01024         if (sdim != sdim1) {
01025             result[13] = ulpinv;
01026         }
01027 
01028     }
01029 
01030 L250:
01031 
01032 /*     If there are precomputed reciprocal condition numbers, compare */
01033 /*     computed values with them. */
01034 
01035     if (*comp) {
01036 
01037 /*        First set up SELOPT, SELDIM, SELVAL, SELWR, and SELWI so that */
01038 /*        the logical function SSLECT selects the eigenvalues specified */
01039 /*        by NSLCT and ISLCT. */
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 /* L260: */
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 /* L270: */
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 /* L280: */
01074         }
01075         i__1 = *nslct;
01076         for (i__ = 1; i__ <= i__1; ++i__) {
01077             sslct_1.selval[ipnt[islct[i__] - 1] - 1] = TRUE_;
01078 /* L290: */
01079         }
01080 
01081 /*        Compute condition numbers */
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 /*        Compare condition number for average of selected eigenvalues */
01102 /*        taking its condition number into account */
01103 
01104         anorm = slange_("1", n, n, &a[a_offset], lda, &work[1]);
01105 /* Computing MAX */
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 /* Computing MAX */
01122         r__1 = tol, r__2 = smlnum / eps;
01123         tol = dmax(r__1,r__2);
01124 /* Computing MAX */
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 /*        Compare condition numbers for right invariant subspace */
01140 /*        taking its condition number into account */
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 /* Computing MAX */
01153         r__1 = tol, r__2 = smlnum / eps;
01154         tol = dmax(r__1,r__2);
01155 /* Computing MAX */
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 /*     End of SGET24 */
01179 
01180 } /* sget24_ */


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:56:08