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


swiftnav
Author(s):
autogenerated on Sat Jun 8 2019 18:55:45