strevc.c
Go to the documentation of this file.
00001 /* strevc.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 /* Table of constant values */
00017 
00018 static logical c_false = FALSE_;
00019 static integer c__1 = 1;
00020 static real c_b22 = 1.f;
00021 static real c_b25 = 0.f;
00022 static integer c__2 = 2;
00023 static logical c_true = TRUE_;
00024 
00025 /* Subroutine */ int strevc_(char *side, char *howmny, logical *select, 
00026         integer *n, real *t, integer *ldt, real *vl, integer *ldvl, real *vr, 
00027         integer *ldvr, integer *mm, integer *m, real *work, integer *info)
00028 {
00029     /* System generated locals */
00030     integer t_dim1, t_offset, vl_dim1, vl_offset, vr_dim1, vr_offset, i__1, 
00031             i__2, i__3;
00032     real r__1, r__2, r__3, r__4;
00033 
00034     /* Builtin functions */
00035     double sqrt(doublereal);
00036 
00037     /* Local variables */
00038     integer i__, j, k;
00039     real x[4]   /* was [2][2] */;
00040     integer j1, j2, n2, ii, ki, ip, is;
00041     real wi, wr, rec, ulp, beta, emax;
00042     logical pair, allv;
00043     integer ierr;
00044     real unfl, ovfl, smin;
00045     extern doublereal sdot_(integer *, real *, integer *, real *, integer *);
00046     logical over;
00047     real vmax;
00048     integer jnxt;
00049     real scale;
00050     extern logical lsame_(char *, char *);
00051     extern /* Subroutine */ int sscal_(integer *, real *, real *, integer *);
00052     real remax;
00053     logical leftv;
00054     extern /* Subroutine */ int sgemv_(char *, integer *, integer *, real *, 
00055             real *, integer *, real *, integer *, real *, real *, integer *);
00056     logical bothv;
00057     real vcrit;
00058     logical somev;
00059     extern /* Subroutine */ int scopy_(integer *, real *, integer *, real *, 
00060             integer *);
00061     real xnorm;
00062     extern /* Subroutine */ int saxpy_(integer *, real *, real *, integer *, 
00063             real *, integer *), slaln2_(logical *, integer *, integer *, real 
00064             *, real *, real *, integer *, real *, real *, real *, integer *, 
00065             real *, real *, real *, integer *, real *, real *, integer *), 
00066             slabad_(real *, real *);
00067     extern doublereal slamch_(char *);
00068     extern /* Subroutine */ int xerbla_(char *, integer *);
00069     real bignum;
00070     extern integer isamax_(integer *, real *, integer *);
00071     logical rightv;
00072     real smlnum;
00073 
00074 
00075 /*  -- LAPACK routine (version 3.2) -- */
00076 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00077 /*     November 2006 */
00078 
00079 /*     .. Scalar Arguments .. */
00080 /*     .. */
00081 /*     .. Array Arguments .. */
00082 /*     .. */
00083 
00084 /*  Purpose */
00085 /*  ======= */
00086 
00087 /*  STREVC computes some or all of the right and/or left eigenvectors of */
00088 /*  a real upper quasi-triangular matrix T. */
00089 /*  Matrices of this type are produced by the Schur factorization of */
00090 /*  a real general matrix:  A = Q*T*Q**T, as computed by SHSEQR. */
00091 
00092 /*  The right eigenvector x and the left eigenvector y of T corresponding */
00093 /*  to an eigenvalue w are defined by: */
00094 
00095 /*     T*x = w*x,     (y**H)*T = w*(y**H) */
00096 
00097 /*  where y**H denotes the conjugate transpose of y. */
00098 /*  The eigenvalues are not input to this routine, but are read directly */
00099 /*  from the diagonal blocks of T. */
00100 
00101 /*  This routine returns the matrices X and/or Y of right and left */
00102 /*  eigenvectors of T, or the products Q*X and/or Q*Y, where Q is an */
00103 /*  input matrix.  If Q is the orthogonal factor that reduces a matrix */
00104 /*  A to Schur form T, then Q*X and Q*Y are the matrices of right and */
00105 /*  left eigenvectors of A. */
00106 
00107 /*  Arguments */
00108 /*  ========= */
00109 
00110 /*  SIDE    (input) CHARACTER*1 */
00111 /*          = 'R':  compute right eigenvectors only; */
00112 /*          = 'L':  compute left eigenvectors only; */
00113 /*          = 'B':  compute both right and left eigenvectors. */
00114 
00115 /*  HOWMNY  (input) CHARACTER*1 */
00116 /*          = 'A':  compute all right and/or left eigenvectors; */
00117 /*          = 'B':  compute all right and/or left eigenvectors, */
00118 /*                  backtransformed by the matrices in VR and/or VL; */
00119 /*          = 'S':  compute selected right and/or left eigenvectors, */
00120 /*                  as indicated by the logical array SELECT. */
00121 
00122 /*  SELECT  (input/output) LOGICAL array, dimension (N) */
00123 /*          If HOWMNY = 'S', SELECT specifies the eigenvectors to be */
00124 /*          computed. */
00125 /*          If w(j) is a real eigenvalue, the corresponding real */
00126 /*          eigenvector is computed if SELECT(j) is .TRUE.. */
00127 /*          If w(j) and w(j+1) are the real and imaginary parts of a */
00128 /*          complex eigenvalue, the corresponding complex eigenvector is */
00129 /*          computed if either SELECT(j) or SELECT(j+1) is .TRUE., and */
00130 /*          on exit SELECT(j) is set to .TRUE. and SELECT(j+1) is set to */
00131 /*          .FALSE.. */
00132 /*          Not referenced if HOWMNY = 'A' or 'B'. */
00133 
00134 /*  N       (input) INTEGER */
00135 /*          The order of the matrix T. N >= 0. */
00136 
00137 /*  T       (input) REAL array, dimension (LDT,N) */
00138 /*          The upper quasi-triangular matrix T in Schur canonical form. */
00139 
00140 /*  LDT     (input) INTEGER */
00141 /*          The leading dimension of the array T. LDT >= max(1,N). */
00142 
00143 /*  VL      (input/output) REAL array, dimension (LDVL,MM) */
00144 /*          On entry, if SIDE = 'L' or 'B' and HOWMNY = 'B', VL must */
00145 /*          contain an N-by-N matrix Q (usually the orthogonal matrix Q */
00146 /*          of Schur vectors returned by SHSEQR). */
00147 /*          On exit, if SIDE = 'L' or 'B', VL contains: */
00148 /*          if HOWMNY = 'A', the matrix Y of left eigenvectors of T; */
00149 /*          if HOWMNY = 'B', the matrix Q*Y; */
00150 /*          if HOWMNY = 'S', the left eigenvectors of T specified by */
00151 /*                           SELECT, stored consecutively in the columns */
00152 /*                           of VL, in the same order as their */
00153 /*                           eigenvalues. */
00154 /*          A complex eigenvector corresponding to a complex eigenvalue */
00155 /*          is stored in two consecutive columns, the first holding the */
00156 /*          real part, and the second the imaginary part. */
00157 /*          Not referenced if SIDE = 'R'. */
00158 
00159 /*  LDVL    (input) INTEGER */
00160 /*          The leading dimension of the array VL.  LDVL >= 1, and if */
00161 /*          SIDE = 'L' or 'B', LDVL >= N. */
00162 
00163 /*  VR      (input/output) REAL array, dimension (LDVR,MM) */
00164 /*          On entry, if SIDE = 'R' or 'B' and HOWMNY = 'B', VR must */
00165 /*          contain an N-by-N matrix Q (usually the orthogonal matrix Q */
00166 /*          of Schur vectors returned by SHSEQR). */
00167 /*          On exit, if SIDE = 'R' or 'B', VR contains: */
00168 /*          if HOWMNY = 'A', the matrix X of right eigenvectors of T; */
00169 /*          if HOWMNY = 'B', the matrix Q*X; */
00170 /*          if HOWMNY = 'S', the right eigenvectors of T specified by */
00171 /*                           SELECT, stored consecutively in the columns */
00172 /*                           of VR, in the same order as their */
00173 /*                           eigenvalues. */
00174 /*          A complex eigenvector corresponding to a complex eigenvalue */
00175 /*          is stored in two consecutive columns, the first holding the */
00176 /*          real part and the second the imaginary part. */
00177 /*          Not referenced if SIDE = 'L'. */
00178 
00179 /*  LDVR    (input) INTEGER */
00180 /*          The leading dimension of the array VR.  LDVR >= 1, and if */
00181 /*          SIDE = 'R' or 'B', LDVR >= N. */
00182 
00183 /*  MM      (input) INTEGER */
00184 /*          The number of columns in the arrays VL and/or VR. MM >= M. */
00185 
00186 /*  M       (output) INTEGER */
00187 /*          The number of columns in the arrays VL and/or VR actually */
00188 /*          used to store the eigenvectors. */
00189 /*          If HOWMNY = 'A' or 'B', M is set to N. */
00190 /*          Each selected real eigenvector occupies one column and each */
00191 /*          selected complex eigenvector occupies two columns. */
00192 
00193 /*  WORK    (workspace) REAL array, dimension (3*N) */
00194 
00195 /*  INFO    (output) INTEGER */
00196 /*          = 0:  successful exit */
00197 /*          < 0:  if INFO = -i, the i-th argument had an illegal value */
00198 
00199 /*  Further Details */
00200 /*  =============== */
00201 
00202 /*  The algorithm used in this program is basically backward (forward) */
00203 /*  substitution, with scaling to make the the code robust against */
00204 /*  possible overflow. */
00205 
00206 /*  Each eigenvector is normalized so that the element of largest */
00207 /*  magnitude has magnitude 1; here the magnitude of a complex number */
00208 /*  (x,y) is taken to be |x| + |y|. */
00209 
00210 /*  ===================================================================== */
00211 
00212 /*     .. Parameters .. */
00213 /*     .. */
00214 /*     .. Local Scalars .. */
00215 /*     .. */
00216 /*     .. External Functions .. */
00217 /*     .. */
00218 /*     .. External Subroutines .. */
00219 /*     .. */
00220 /*     .. Intrinsic Functions .. */
00221 /*     .. */
00222 /*     .. Local Arrays .. */
00223 /*     .. */
00224 /*     .. Executable Statements .. */
00225 
00226 /*     Decode and test the input parameters */
00227 
00228     /* Parameter adjustments */
00229     --select;
00230     t_dim1 = *ldt;
00231     t_offset = 1 + t_dim1;
00232     t -= t_offset;
00233     vl_dim1 = *ldvl;
00234     vl_offset = 1 + vl_dim1;
00235     vl -= vl_offset;
00236     vr_dim1 = *ldvr;
00237     vr_offset = 1 + vr_dim1;
00238     vr -= vr_offset;
00239     --work;
00240 
00241     /* Function Body */
00242     bothv = lsame_(side, "B");
00243     rightv = lsame_(side, "R") || bothv;
00244     leftv = lsame_(side, "L") || bothv;
00245 
00246     allv = lsame_(howmny, "A");
00247     over = lsame_(howmny, "B");
00248     somev = lsame_(howmny, "S");
00249 
00250     *info = 0;
00251     if (! rightv && ! leftv) {
00252         *info = -1;
00253     } else if (! allv && ! over && ! somev) {
00254         *info = -2;
00255     } else if (*n < 0) {
00256         *info = -4;
00257     } else if (*ldt < max(1,*n)) {
00258         *info = -6;
00259     } else if (*ldvl < 1 || leftv && *ldvl < *n) {
00260         *info = -8;
00261     } else if (*ldvr < 1 || rightv && *ldvr < *n) {
00262         *info = -10;
00263     } else {
00264 
00265 /*        Set M to the number of columns required to store the selected */
00266 /*        eigenvectors, standardize the array SELECT if necessary, and */
00267 /*        test MM. */
00268 
00269         if (somev) {
00270             *m = 0;
00271             pair = FALSE_;
00272             i__1 = *n;
00273             for (j = 1; j <= i__1; ++j) {
00274                 if (pair) {
00275                     pair = FALSE_;
00276                     select[j] = FALSE_;
00277                 } else {
00278                     if (j < *n) {
00279                         if (t[j + 1 + j * t_dim1] == 0.f) {
00280                             if (select[j]) {
00281                                 ++(*m);
00282                             }
00283                         } else {
00284                             pair = TRUE_;
00285                             if (select[j] || select[j + 1]) {
00286                                 select[j] = TRUE_;
00287                                 *m += 2;
00288                             }
00289                         }
00290                     } else {
00291                         if (select[*n]) {
00292                             ++(*m);
00293                         }
00294                     }
00295                 }
00296 /* L10: */
00297             }
00298         } else {
00299             *m = *n;
00300         }
00301 
00302         if (*mm < *m) {
00303             *info = -11;
00304         }
00305     }
00306     if (*info != 0) {
00307         i__1 = -(*info);
00308         xerbla_("STREVC", &i__1);
00309         return 0;
00310     }
00311 
00312 /*     Quick return if possible. */
00313 
00314     if (*n == 0) {
00315         return 0;
00316     }
00317 
00318 /*     Set the constants to control overflow. */
00319 
00320     unfl = slamch_("Safe minimum");
00321     ovfl = 1.f / unfl;
00322     slabad_(&unfl, &ovfl);
00323     ulp = slamch_("Precision");
00324     smlnum = unfl * (*n / ulp);
00325     bignum = (1.f - ulp) / smlnum;
00326 
00327 /*     Compute 1-norm of each column of strictly upper triangular */
00328 /*     part of T to control overflow in triangular solver. */
00329 
00330     work[1] = 0.f;
00331     i__1 = *n;
00332     for (j = 2; j <= i__1; ++j) {
00333         work[j] = 0.f;
00334         i__2 = j - 1;
00335         for (i__ = 1; i__ <= i__2; ++i__) {
00336             work[j] += (r__1 = t[i__ + j * t_dim1], dabs(r__1));
00337 /* L20: */
00338         }
00339 /* L30: */
00340     }
00341 
00342 /*     Index IP is used to specify the real or complex eigenvalue: */
00343 /*       IP = 0, real eigenvalue, */
00344 /*            1, first of conjugate complex pair: (wr,wi) */
00345 /*           -1, second of conjugate complex pair: (wr,wi) */
00346 
00347     n2 = *n << 1;
00348 
00349     if (rightv) {
00350 
00351 /*        Compute right eigenvectors. */
00352 
00353         ip = 0;
00354         is = *m;
00355         for (ki = *n; ki >= 1; --ki) {
00356 
00357             if (ip == 1) {
00358                 goto L130;
00359             }
00360             if (ki == 1) {
00361                 goto L40;
00362             }
00363             if (t[ki + (ki - 1) * t_dim1] == 0.f) {
00364                 goto L40;
00365             }
00366             ip = -1;
00367 
00368 L40:
00369             if (somev) {
00370                 if (ip == 0) {
00371                     if (! select[ki]) {
00372                         goto L130;
00373                     }
00374                 } else {
00375                     if (! select[ki - 1]) {
00376                         goto L130;
00377                     }
00378                 }
00379             }
00380 
00381 /*           Compute the KI-th eigenvalue (WR,WI). */
00382 
00383             wr = t[ki + ki * t_dim1];
00384             wi = 0.f;
00385             if (ip != 0) {
00386                 wi = sqrt((r__1 = t[ki + (ki - 1) * t_dim1], dabs(r__1))) * 
00387                         sqrt((r__2 = t[ki - 1 + ki * t_dim1], dabs(r__2)));
00388             }
00389 /* Computing MAX */
00390             r__1 = ulp * (dabs(wr) + dabs(wi));
00391             smin = dmax(r__1,smlnum);
00392 
00393             if (ip == 0) {
00394 
00395 /*              Real right eigenvector */
00396 
00397                 work[ki + *n] = 1.f;
00398 
00399 /*              Form right-hand side */
00400 
00401                 i__1 = ki - 1;
00402                 for (k = 1; k <= i__1; ++k) {
00403                     work[k + *n] = -t[k + ki * t_dim1];
00404 /* L50: */
00405                 }
00406 
00407 /*              Solve the upper quasi-triangular system: */
00408 /*                 (T(1:KI-1,1:KI-1) - WR)*X = SCALE*WORK. */
00409 
00410                 jnxt = ki - 1;
00411                 for (j = ki - 1; j >= 1; --j) {
00412                     if (j > jnxt) {
00413                         goto L60;
00414                     }
00415                     j1 = j;
00416                     j2 = j;
00417                     jnxt = j - 1;
00418                     if (j > 1) {
00419                         if (t[j + (j - 1) * t_dim1] != 0.f) {
00420                             j1 = j - 1;
00421                             jnxt = j - 2;
00422                         }
00423                     }
00424 
00425                     if (j1 == j2) {
00426 
00427 /*                    1-by-1 diagonal block */
00428 
00429                         slaln2_(&c_false, &c__1, &c__1, &smin, &c_b22, &t[j + 
00430                                 j * t_dim1], ldt, &c_b22, &c_b22, &work[j + *
00431                                 n], n, &wr, &c_b25, x, &c__2, &scale, &xnorm, 
00432                                 &ierr);
00433 
00434 /*                    Scale X(1,1) to avoid overflow when updating */
00435 /*                    the right-hand side. */
00436 
00437                         if (xnorm > 1.f) {
00438                             if (work[j] > bignum / xnorm) {
00439                                 x[0] /= xnorm;
00440                                 scale /= xnorm;
00441                             }
00442                         }
00443 
00444 /*                    Scale if necessary */
00445 
00446                         if (scale != 1.f) {
00447                             sscal_(&ki, &scale, &work[*n + 1], &c__1);
00448                         }
00449                         work[j + *n] = x[0];
00450 
00451 /*                    Update right-hand side */
00452 
00453                         i__1 = j - 1;
00454                         r__1 = -x[0];
00455                         saxpy_(&i__1, &r__1, &t[j * t_dim1 + 1], &c__1, &work[
00456                                 *n + 1], &c__1);
00457 
00458                     } else {
00459 
00460 /*                    2-by-2 diagonal block */
00461 
00462                         slaln2_(&c_false, &c__2, &c__1, &smin, &c_b22, &t[j - 
00463                                 1 + (j - 1) * t_dim1], ldt, &c_b22, &c_b22, &
00464                                 work[j - 1 + *n], n, &wr, &c_b25, x, &c__2, &
00465                                 scale, &xnorm, &ierr);
00466 
00467 /*                    Scale X(1,1) and X(2,1) to avoid overflow when */
00468 /*                    updating the right-hand side. */
00469 
00470                         if (xnorm > 1.f) {
00471 /* Computing MAX */
00472                             r__1 = work[j - 1], r__2 = work[j];
00473                             beta = dmax(r__1,r__2);
00474                             if (beta > bignum / xnorm) {
00475                                 x[0] /= xnorm;
00476                                 x[1] /= xnorm;
00477                                 scale /= xnorm;
00478                             }
00479                         }
00480 
00481 /*                    Scale if necessary */
00482 
00483                         if (scale != 1.f) {
00484                             sscal_(&ki, &scale, &work[*n + 1], &c__1);
00485                         }
00486                         work[j - 1 + *n] = x[0];
00487                         work[j + *n] = x[1];
00488 
00489 /*                    Update right-hand side */
00490 
00491                         i__1 = j - 2;
00492                         r__1 = -x[0];
00493                         saxpy_(&i__1, &r__1, &t[(j - 1) * t_dim1 + 1], &c__1, 
00494                                 &work[*n + 1], &c__1);
00495                         i__1 = j - 2;
00496                         r__1 = -x[1];
00497                         saxpy_(&i__1, &r__1, &t[j * t_dim1 + 1], &c__1, &work[
00498                                 *n + 1], &c__1);
00499                     }
00500 L60:
00501                     ;
00502                 }
00503 
00504 /*              Copy the vector x or Q*x to VR and normalize. */
00505 
00506                 if (! over) {
00507                     scopy_(&ki, &work[*n + 1], &c__1, &vr[is * vr_dim1 + 1], &
00508                             c__1);
00509 
00510                     ii = isamax_(&ki, &vr[is * vr_dim1 + 1], &c__1);
00511                     remax = 1.f / (r__1 = vr[ii + is * vr_dim1], dabs(r__1));
00512                     sscal_(&ki, &remax, &vr[is * vr_dim1 + 1], &c__1);
00513 
00514                     i__1 = *n;
00515                     for (k = ki + 1; k <= i__1; ++k) {
00516                         vr[k + is * vr_dim1] = 0.f;
00517 /* L70: */
00518                     }
00519                 } else {
00520                     if (ki > 1) {
00521                         i__1 = ki - 1;
00522                         sgemv_("N", n, &i__1, &c_b22, &vr[vr_offset], ldvr, &
00523                                 work[*n + 1], &c__1, &work[ki + *n], &vr[ki * 
00524                                 vr_dim1 + 1], &c__1);
00525                     }
00526 
00527                     ii = isamax_(n, &vr[ki * vr_dim1 + 1], &c__1);
00528                     remax = 1.f / (r__1 = vr[ii + ki * vr_dim1], dabs(r__1));
00529                     sscal_(n, &remax, &vr[ki * vr_dim1 + 1], &c__1);
00530                 }
00531 
00532             } else {
00533 
00534 /*              Complex right eigenvector. */
00535 
00536 /*              Initial solve */
00537 /*                [ (T(KI-1,KI-1) T(KI-1,KI) ) - (WR + I* WI)]*X = 0. */
00538 /*                [ (T(KI,KI-1)   T(KI,KI)   )               ] */
00539 
00540                 if ((r__1 = t[ki - 1 + ki * t_dim1], dabs(r__1)) >= (r__2 = t[
00541                         ki + (ki - 1) * t_dim1], dabs(r__2))) {
00542                     work[ki - 1 + *n] = 1.f;
00543                     work[ki + n2] = wi / t[ki - 1 + ki * t_dim1];
00544                 } else {
00545                     work[ki - 1 + *n] = -wi / t[ki + (ki - 1) * t_dim1];
00546                     work[ki + n2] = 1.f;
00547                 }
00548                 work[ki + *n] = 0.f;
00549                 work[ki - 1 + n2] = 0.f;
00550 
00551 /*              Form right-hand side */
00552 
00553                 i__1 = ki - 2;
00554                 for (k = 1; k <= i__1; ++k) {
00555                     work[k + *n] = -work[ki - 1 + *n] * t[k + (ki - 1) * 
00556                             t_dim1];
00557                     work[k + n2] = -work[ki + n2] * t[k + ki * t_dim1];
00558 /* L80: */
00559                 }
00560 
00561 /*              Solve upper quasi-triangular system: */
00562 /*              (T(1:KI-2,1:KI-2) - (WR+i*WI))*X = SCALE*(WORK+i*WORK2) */
00563 
00564                 jnxt = ki - 2;
00565                 for (j = ki - 2; j >= 1; --j) {
00566                     if (j > jnxt) {
00567                         goto L90;
00568                     }
00569                     j1 = j;
00570                     j2 = j;
00571                     jnxt = j - 1;
00572                     if (j > 1) {
00573                         if (t[j + (j - 1) * t_dim1] != 0.f) {
00574                             j1 = j - 1;
00575                             jnxt = j - 2;
00576                         }
00577                     }
00578 
00579                     if (j1 == j2) {
00580 
00581 /*                    1-by-1 diagonal block */
00582 
00583                         slaln2_(&c_false, &c__1, &c__2, &smin, &c_b22, &t[j + 
00584                                 j * t_dim1], ldt, &c_b22, &c_b22, &work[j + *
00585                                 n], n, &wr, &wi, x, &c__2, &scale, &xnorm, &
00586                                 ierr);
00587 
00588 /*                    Scale X(1,1) and X(1,2) to avoid overflow when */
00589 /*                    updating the right-hand side. */
00590 
00591                         if (xnorm > 1.f) {
00592                             if (work[j] > bignum / xnorm) {
00593                                 x[0] /= xnorm;
00594                                 x[2] /= xnorm;
00595                                 scale /= xnorm;
00596                             }
00597                         }
00598 
00599 /*                    Scale if necessary */
00600 
00601                         if (scale != 1.f) {
00602                             sscal_(&ki, &scale, &work[*n + 1], &c__1);
00603                             sscal_(&ki, &scale, &work[n2 + 1], &c__1);
00604                         }
00605                         work[j + *n] = x[0];
00606                         work[j + n2] = x[2];
00607 
00608 /*                    Update the right-hand side */
00609 
00610                         i__1 = j - 1;
00611                         r__1 = -x[0];
00612                         saxpy_(&i__1, &r__1, &t[j * t_dim1 + 1], &c__1, &work[
00613                                 *n + 1], &c__1);
00614                         i__1 = j - 1;
00615                         r__1 = -x[2];
00616                         saxpy_(&i__1, &r__1, &t[j * t_dim1 + 1], &c__1, &work[
00617                                 n2 + 1], &c__1);
00618 
00619                     } else {
00620 
00621 /*                    2-by-2 diagonal block */
00622 
00623                         slaln2_(&c_false, &c__2, &c__2, &smin, &c_b22, &t[j - 
00624                                 1 + (j - 1) * t_dim1], ldt, &c_b22, &c_b22, &
00625                                 work[j - 1 + *n], n, &wr, &wi, x, &c__2, &
00626                                 scale, &xnorm, &ierr);
00627 
00628 /*                    Scale X to avoid overflow when updating */
00629 /*                    the right-hand side. */
00630 
00631                         if (xnorm > 1.f) {
00632 /* Computing MAX */
00633                             r__1 = work[j - 1], r__2 = work[j];
00634                             beta = dmax(r__1,r__2);
00635                             if (beta > bignum / xnorm) {
00636                                 rec = 1.f / xnorm;
00637                                 x[0] *= rec;
00638                                 x[2] *= rec;
00639                                 x[1] *= rec;
00640                                 x[3] *= rec;
00641                                 scale *= rec;
00642                             }
00643                         }
00644 
00645 /*                    Scale if necessary */
00646 
00647                         if (scale != 1.f) {
00648                             sscal_(&ki, &scale, &work[*n + 1], &c__1);
00649                             sscal_(&ki, &scale, &work[n2 + 1], &c__1);
00650                         }
00651                         work[j - 1 + *n] = x[0];
00652                         work[j + *n] = x[1];
00653                         work[j - 1 + n2] = x[2];
00654                         work[j + n2] = x[3];
00655 
00656 /*                    Update the right-hand side */
00657 
00658                         i__1 = j - 2;
00659                         r__1 = -x[0];
00660                         saxpy_(&i__1, &r__1, &t[(j - 1) * t_dim1 + 1], &c__1, 
00661                                 &work[*n + 1], &c__1);
00662                         i__1 = j - 2;
00663                         r__1 = -x[1];
00664                         saxpy_(&i__1, &r__1, &t[j * t_dim1 + 1], &c__1, &work[
00665                                 *n + 1], &c__1);
00666                         i__1 = j - 2;
00667                         r__1 = -x[2];
00668                         saxpy_(&i__1, &r__1, &t[(j - 1) * t_dim1 + 1], &c__1, 
00669                                 &work[n2 + 1], &c__1);
00670                         i__1 = j - 2;
00671                         r__1 = -x[3];
00672                         saxpy_(&i__1, &r__1, &t[j * t_dim1 + 1], &c__1, &work[
00673                                 n2 + 1], &c__1);
00674                     }
00675 L90:
00676                     ;
00677                 }
00678 
00679 /*              Copy the vector x or Q*x to VR and normalize. */
00680 
00681                 if (! over) {
00682                     scopy_(&ki, &work[*n + 1], &c__1, &vr[(is - 1) * vr_dim1 
00683                             + 1], &c__1);
00684                     scopy_(&ki, &work[n2 + 1], &c__1, &vr[is * vr_dim1 + 1], &
00685                             c__1);
00686 
00687                     emax = 0.f;
00688                     i__1 = ki;
00689                     for (k = 1; k <= i__1; ++k) {
00690 /* Computing MAX */
00691                         r__3 = emax, r__4 = (r__1 = vr[k + (is - 1) * vr_dim1]
00692                                 , dabs(r__1)) + (r__2 = vr[k + is * vr_dim1], 
00693                                 dabs(r__2));
00694                         emax = dmax(r__3,r__4);
00695 /* L100: */
00696                     }
00697 
00698                     remax = 1.f / emax;
00699                     sscal_(&ki, &remax, &vr[(is - 1) * vr_dim1 + 1], &c__1);
00700                     sscal_(&ki, &remax, &vr[is * vr_dim1 + 1], &c__1);
00701 
00702                     i__1 = *n;
00703                     for (k = ki + 1; k <= i__1; ++k) {
00704                         vr[k + (is - 1) * vr_dim1] = 0.f;
00705                         vr[k + is * vr_dim1] = 0.f;
00706 /* L110: */
00707                     }
00708 
00709                 } else {
00710 
00711                     if (ki > 2) {
00712                         i__1 = ki - 2;
00713                         sgemv_("N", n, &i__1, &c_b22, &vr[vr_offset], ldvr, &
00714                                 work[*n + 1], &c__1, &work[ki - 1 + *n], &vr[(
00715                                 ki - 1) * vr_dim1 + 1], &c__1);
00716                         i__1 = ki - 2;
00717                         sgemv_("N", n, &i__1, &c_b22, &vr[vr_offset], ldvr, &
00718                                 work[n2 + 1], &c__1, &work[ki + n2], &vr[ki * 
00719                                 vr_dim1 + 1], &c__1);
00720                     } else {
00721                         sscal_(n, &work[ki - 1 + *n], &vr[(ki - 1) * vr_dim1 
00722                                 + 1], &c__1);
00723                         sscal_(n, &work[ki + n2], &vr[ki * vr_dim1 + 1], &
00724                                 c__1);
00725                     }
00726 
00727                     emax = 0.f;
00728                     i__1 = *n;
00729                     for (k = 1; k <= i__1; ++k) {
00730 /* Computing MAX */
00731                         r__3 = emax, r__4 = (r__1 = vr[k + (ki - 1) * vr_dim1]
00732                                 , dabs(r__1)) + (r__2 = vr[k + ki * vr_dim1], 
00733                                 dabs(r__2));
00734                         emax = dmax(r__3,r__4);
00735 /* L120: */
00736                     }
00737                     remax = 1.f / emax;
00738                     sscal_(n, &remax, &vr[(ki - 1) * vr_dim1 + 1], &c__1);
00739                     sscal_(n, &remax, &vr[ki * vr_dim1 + 1], &c__1);
00740                 }
00741             }
00742 
00743             --is;
00744             if (ip != 0) {
00745                 --is;
00746             }
00747 L130:
00748             if (ip == 1) {
00749                 ip = 0;
00750             }
00751             if (ip == -1) {
00752                 ip = 1;
00753             }
00754 /* L140: */
00755         }
00756     }
00757 
00758     if (leftv) {
00759 
00760 /*        Compute left eigenvectors. */
00761 
00762         ip = 0;
00763         is = 1;
00764         i__1 = *n;
00765         for (ki = 1; ki <= i__1; ++ki) {
00766 
00767             if (ip == -1) {
00768                 goto L250;
00769             }
00770             if (ki == *n) {
00771                 goto L150;
00772             }
00773             if (t[ki + 1 + ki * t_dim1] == 0.f) {
00774                 goto L150;
00775             }
00776             ip = 1;
00777 
00778 L150:
00779             if (somev) {
00780                 if (! select[ki]) {
00781                     goto L250;
00782                 }
00783             }
00784 
00785 /*           Compute the KI-th eigenvalue (WR,WI). */
00786 
00787             wr = t[ki + ki * t_dim1];
00788             wi = 0.f;
00789             if (ip != 0) {
00790                 wi = sqrt((r__1 = t[ki + (ki + 1) * t_dim1], dabs(r__1))) * 
00791                         sqrt((r__2 = t[ki + 1 + ki * t_dim1], dabs(r__2)));
00792             }
00793 /* Computing MAX */
00794             r__1 = ulp * (dabs(wr) + dabs(wi));
00795             smin = dmax(r__1,smlnum);
00796 
00797             if (ip == 0) {
00798 
00799 /*              Real left eigenvector. */
00800 
00801                 work[ki + *n] = 1.f;
00802 
00803 /*              Form right-hand side */
00804 
00805                 i__2 = *n;
00806                 for (k = ki + 1; k <= i__2; ++k) {
00807                     work[k + *n] = -t[ki + k * t_dim1];
00808 /* L160: */
00809                 }
00810 
00811 /*              Solve the quasi-triangular system: */
00812 /*                 (T(KI+1:N,KI+1:N) - WR)'*X = SCALE*WORK */
00813 
00814                 vmax = 1.f;
00815                 vcrit = bignum;
00816 
00817                 jnxt = ki + 1;
00818                 i__2 = *n;
00819                 for (j = ki + 1; j <= i__2; ++j) {
00820                     if (j < jnxt) {
00821                         goto L170;
00822                     }
00823                     j1 = j;
00824                     j2 = j;
00825                     jnxt = j + 1;
00826                     if (j < *n) {
00827                         if (t[j + 1 + j * t_dim1] != 0.f) {
00828                             j2 = j + 1;
00829                             jnxt = j + 2;
00830                         }
00831                     }
00832 
00833                     if (j1 == j2) {
00834 
00835 /*                    1-by-1 diagonal block */
00836 
00837 /*                    Scale if necessary to avoid overflow when forming */
00838 /*                    the right-hand side. */
00839 
00840                         if (work[j] > vcrit) {
00841                             rec = 1.f / vmax;
00842                             i__3 = *n - ki + 1;
00843                             sscal_(&i__3, &rec, &work[ki + *n], &c__1);
00844                             vmax = 1.f;
00845                             vcrit = bignum;
00846                         }
00847 
00848                         i__3 = j - ki - 1;
00849                         work[j + *n] -= sdot_(&i__3, &t[ki + 1 + j * t_dim1], 
00850                                 &c__1, &work[ki + 1 + *n], &c__1);
00851 
00852 /*                    Solve (T(J,J)-WR)'*X = WORK */
00853 
00854                         slaln2_(&c_false, &c__1, &c__1, &smin, &c_b22, &t[j + 
00855                                 j * t_dim1], ldt, &c_b22, &c_b22, &work[j + *
00856                                 n], n, &wr, &c_b25, x, &c__2, &scale, &xnorm, 
00857                                 &ierr);
00858 
00859 /*                    Scale if necessary */
00860 
00861                         if (scale != 1.f) {
00862                             i__3 = *n - ki + 1;
00863                             sscal_(&i__3, &scale, &work[ki + *n], &c__1);
00864                         }
00865                         work[j + *n] = x[0];
00866 /* Computing MAX */
00867                         r__2 = (r__1 = work[j + *n], dabs(r__1));
00868                         vmax = dmax(r__2,vmax);
00869                         vcrit = bignum / vmax;
00870 
00871                     } else {
00872 
00873 /*                    2-by-2 diagonal block */
00874 
00875 /*                    Scale if necessary to avoid overflow when forming */
00876 /*                    the right-hand side. */
00877 
00878 /* Computing MAX */
00879                         r__1 = work[j], r__2 = work[j + 1];
00880                         beta = dmax(r__1,r__2);
00881                         if (beta > vcrit) {
00882                             rec = 1.f / vmax;
00883                             i__3 = *n - ki + 1;
00884                             sscal_(&i__3, &rec, &work[ki + *n], &c__1);
00885                             vmax = 1.f;
00886                             vcrit = bignum;
00887                         }
00888 
00889                         i__3 = j - ki - 1;
00890                         work[j + *n] -= sdot_(&i__3, &t[ki + 1 + j * t_dim1], 
00891                                 &c__1, &work[ki + 1 + *n], &c__1);
00892 
00893                         i__3 = j - ki - 1;
00894                         work[j + 1 + *n] -= sdot_(&i__3, &t[ki + 1 + (j + 1) *
00895                                  t_dim1], &c__1, &work[ki + 1 + *n], &c__1);
00896 
00897 /*                    Solve */
00898 /*                      [T(J,J)-WR   T(J,J+1)     ]'* X = SCALE*( WORK1 ) */
00899 /*                      [T(J+1,J)    T(J+1,J+1)-WR]             ( WORK2 ) */
00900 
00901                         slaln2_(&c_true, &c__2, &c__1, &smin, &c_b22, &t[j + 
00902                                 j * t_dim1], ldt, &c_b22, &c_b22, &work[j + *
00903                                 n], n, &wr, &c_b25, x, &c__2, &scale, &xnorm, 
00904                                 &ierr);
00905 
00906 /*                    Scale if necessary */
00907 
00908                         if (scale != 1.f) {
00909                             i__3 = *n - ki + 1;
00910                             sscal_(&i__3, &scale, &work[ki + *n], &c__1);
00911                         }
00912                         work[j + *n] = x[0];
00913                         work[j + 1 + *n] = x[1];
00914 
00915 /* Computing MAX */
00916                         r__3 = (r__1 = work[j + *n], dabs(r__1)), r__4 = (
00917                                 r__2 = work[j + 1 + *n], dabs(r__2)), r__3 = 
00918                                 max(r__3,r__4);
00919                         vmax = dmax(r__3,vmax);
00920                         vcrit = bignum / vmax;
00921 
00922                     }
00923 L170:
00924                     ;
00925                 }
00926 
00927 /*              Copy the vector x or Q*x to VL and normalize. */
00928 
00929                 if (! over) {
00930                     i__2 = *n - ki + 1;
00931                     scopy_(&i__2, &work[ki + *n], &c__1, &vl[ki + is * 
00932                             vl_dim1], &c__1);
00933 
00934                     i__2 = *n - ki + 1;
00935                     ii = isamax_(&i__2, &vl[ki + is * vl_dim1], &c__1) + ki - 
00936                             1;
00937                     remax = 1.f / (r__1 = vl[ii + is * vl_dim1], dabs(r__1));
00938                     i__2 = *n - ki + 1;
00939                     sscal_(&i__2, &remax, &vl[ki + is * vl_dim1], &c__1);
00940 
00941                     i__2 = ki - 1;
00942                     for (k = 1; k <= i__2; ++k) {
00943                         vl[k + is * vl_dim1] = 0.f;
00944 /* L180: */
00945                     }
00946 
00947                 } else {
00948 
00949                     if (ki < *n) {
00950                         i__2 = *n - ki;
00951                         sgemv_("N", n, &i__2, &c_b22, &vl[(ki + 1) * vl_dim1 
00952                                 + 1], ldvl, &work[ki + 1 + *n], &c__1, &work[
00953                                 ki + *n], &vl[ki * vl_dim1 + 1], &c__1);
00954                     }
00955 
00956                     ii = isamax_(n, &vl[ki * vl_dim1 + 1], &c__1);
00957                     remax = 1.f / (r__1 = vl[ii + ki * vl_dim1], dabs(r__1));
00958                     sscal_(n, &remax, &vl[ki * vl_dim1 + 1], &c__1);
00959 
00960                 }
00961 
00962             } else {
00963 
00964 /*              Complex left eigenvector. */
00965 
00966 /*               Initial solve: */
00967 /*                 ((T(KI,KI)    T(KI,KI+1) )' - (WR - I* WI))*X = 0. */
00968 /*                 ((T(KI+1,KI) T(KI+1,KI+1))                ) */
00969 
00970                 if ((r__1 = t[ki + (ki + 1) * t_dim1], dabs(r__1)) >= (r__2 = 
00971                         t[ki + 1 + ki * t_dim1], dabs(r__2))) {
00972                     work[ki + *n] = wi / t[ki + (ki + 1) * t_dim1];
00973                     work[ki + 1 + n2] = 1.f;
00974                 } else {
00975                     work[ki + *n] = 1.f;
00976                     work[ki + 1 + n2] = -wi / t[ki + 1 + ki * t_dim1];
00977                 }
00978                 work[ki + 1 + *n] = 0.f;
00979                 work[ki + n2] = 0.f;
00980 
00981 /*              Form right-hand side */
00982 
00983                 i__2 = *n;
00984                 for (k = ki + 2; k <= i__2; ++k) {
00985                     work[k + *n] = -work[ki + *n] * t[ki + k * t_dim1];
00986                     work[k + n2] = -work[ki + 1 + n2] * t[ki + 1 + k * t_dim1]
00987                             ;
00988 /* L190: */
00989                 }
00990 
00991 /*              Solve complex quasi-triangular system: */
00992 /*              ( T(KI+2,N:KI+2,N) - (WR-i*WI) )*X = WORK1+i*WORK2 */
00993 
00994                 vmax = 1.f;
00995                 vcrit = bignum;
00996 
00997                 jnxt = ki + 2;
00998                 i__2 = *n;
00999                 for (j = ki + 2; j <= i__2; ++j) {
01000                     if (j < jnxt) {
01001                         goto L200;
01002                     }
01003                     j1 = j;
01004                     j2 = j;
01005                     jnxt = j + 1;
01006                     if (j < *n) {
01007                         if (t[j + 1 + j * t_dim1] != 0.f) {
01008                             j2 = j + 1;
01009                             jnxt = j + 2;
01010                         }
01011                     }
01012 
01013                     if (j1 == j2) {
01014 
01015 /*                    1-by-1 diagonal block */
01016 
01017 /*                    Scale if necessary to avoid overflow when */
01018 /*                    forming the right-hand side elements. */
01019 
01020                         if (work[j] > vcrit) {
01021                             rec = 1.f / vmax;
01022                             i__3 = *n - ki + 1;
01023                             sscal_(&i__3, &rec, &work[ki + *n], &c__1);
01024                             i__3 = *n - ki + 1;
01025                             sscal_(&i__3, &rec, &work[ki + n2], &c__1);
01026                             vmax = 1.f;
01027                             vcrit = bignum;
01028                         }
01029 
01030                         i__3 = j - ki - 2;
01031                         work[j + *n] -= sdot_(&i__3, &t[ki + 2 + j * t_dim1], 
01032                                 &c__1, &work[ki + 2 + *n], &c__1);
01033                         i__3 = j - ki - 2;
01034                         work[j + n2] -= sdot_(&i__3, &t[ki + 2 + j * t_dim1], 
01035                                 &c__1, &work[ki + 2 + n2], &c__1);
01036 
01037 /*                    Solve (T(J,J)-(WR-i*WI))*(X11+i*X12)= WK+I*WK2 */
01038 
01039                         r__1 = -wi;
01040                         slaln2_(&c_false, &c__1, &c__2, &smin, &c_b22, &t[j + 
01041                                 j * t_dim1], ldt, &c_b22, &c_b22, &work[j + *
01042                                 n], n, &wr, &r__1, x, &c__2, &scale, &xnorm, &
01043                                 ierr);
01044 
01045 /*                    Scale if necessary */
01046 
01047                         if (scale != 1.f) {
01048                             i__3 = *n - ki + 1;
01049                             sscal_(&i__3, &scale, &work[ki + *n], &c__1);
01050                             i__3 = *n - ki + 1;
01051                             sscal_(&i__3, &scale, &work[ki + n2], &c__1);
01052                         }
01053                         work[j + *n] = x[0];
01054                         work[j + n2] = x[2];
01055 /* Computing MAX */
01056                         r__3 = (r__1 = work[j + *n], dabs(r__1)), r__4 = (
01057                                 r__2 = work[j + n2], dabs(r__2)), r__3 = max(
01058                                 r__3,r__4);
01059                         vmax = dmax(r__3,vmax);
01060                         vcrit = bignum / vmax;
01061 
01062                     } else {
01063 
01064 /*                    2-by-2 diagonal block */
01065 
01066 /*                    Scale if necessary to avoid overflow when forming */
01067 /*                    the right-hand side elements. */
01068 
01069 /* Computing MAX */
01070                         r__1 = work[j], r__2 = work[j + 1];
01071                         beta = dmax(r__1,r__2);
01072                         if (beta > vcrit) {
01073                             rec = 1.f / vmax;
01074                             i__3 = *n - ki + 1;
01075                             sscal_(&i__3, &rec, &work[ki + *n], &c__1);
01076                             i__3 = *n - ki + 1;
01077                             sscal_(&i__3, &rec, &work[ki + n2], &c__1);
01078                             vmax = 1.f;
01079                             vcrit = bignum;
01080                         }
01081 
01082                         i__3 = j - ki - 2;
01083                         work[j + *n] -= sdot_(&i__3, &t[ki + 2 + j * t_dim1], 
01084                                 &c__1, &work[ki + 2 + *n], &c__1);
01085 
01086                         i__3 = j - ki - 2;
01087                         work[j + n2] -= sdot_(&i__3, &t[ki + 2 + j * t_dim1], 
01088                                 &c__1, &work[ki + 2 + n2], &c__1);
01089 
01090                         i__3 = j - ki - 2;
01091                         work[j + 1 + *n] -= sdot_(&i__3, &t[ki + 2 + (j + 1) *
01092                                  t_dim1], &c__1, &work[ki + 2 + *n], &c__1);
01093 
01094                         i__3 = j - ki - 2;
01095                         work[j + 1 + n2] -= sdot_(&i__3, &t[ki + 2 + (j + 1) *
01096                                  t_dim1], &c__1, &work[ki + 2 + n2], &c__1);
01097 
01098 /*                    Solve 2-by-2 complex linear equation */
01099 /*                      ([T(j,j)   T(j,j+1)  ]'-(wr-i*wi)*I)*X = SCALE*B */
01100 /*                      ([T(j+1,j) T(j+1,j+1)]             ) */
01101 
01102                         r__1 = -wi;
01103                         slaln2_(&c_true, &c__2, &c__2, &smin, &c_b22, &t[j + 
01104                                 j * t_dim1], ldt, &c_b22, &c_b22, &work[j + *
01105                                 n], n, &wr, &r__1, x, &c__2, &scale, &xnorm, &
01106                                 ierr);
01107 
01108 /*                    Scale if necessary */
01109 
01110                         if (scale != 1.f) {
01111                             i__3 = *n - ki + 1;
01112                             sscal_(&i__3, &scale, &work[ki + *n], &c__1);
01113                             i__3 = *n - ki + 1;
01114                             sscal_(&i__3, &scale, &work[ki + n2], &c__1);
01115                         }
01116                         work[j + *n] = x[0];
01117                         work[j + n2] = x[2];
01118                         work[j + 1 + *n] = x[1];
01119                         work[j + 1 + n2] = x[3];
01120 /* Computing MAX */
01121                         r__1 = dabs(x[0]), r__2 = dabs(x[2]), r__1 = max(r__1,
01122                                 r__2), r__2 = dabs(x[1]), r__1 = max(r__1,
01123                                 r__2), r__2 = dabs(x[3]), r__1 = max(r__1,
01124                                 r__2);
01125                         vmax = dmax(r__1,vmax);
01126                         vcrit = bignum / vmax;
01127 
01128                     }
01129 L200:
01130                     ;
01131                 }
01132 
01133 /*              Copy the vector x or Q*x to VL and normalize. */
01134 
01135                 if (! over) {
01136                     i__2 = *n - ki + 1;
01137                     scopy_(&i__2, &work[ki + *n], &c__1, &vl[ki + is * 
01138                             vl_dim1], &c__1);
01139                     i__2 = *n - ki + 1;
01140                     scopy_(&i__2, &work[ki + n2], &c__1, &vl[ki + (is + 1) * 
01141                             vl_dim1], &c__1);
01142 
01143                     emax = 0.f;
01144                     i__2 = *n;
01145                     for (k = ki; k <= i__2; ++k) {
01146 /* Computing MAX */
01147                         r__3 = emax, r__4 = (r__1 = vl[k + is * vl_dim1], 
01148                                 dabs(r__1)) + (r__2 = vl[k + (is + 1) * 
01149                                 vl_dim1], dabs(r__2));
01150                         emax = dmax(r__3,r__4);
01151 /* L220: */
01152                     }
01153                     remax = 1.f / emax;
01154                     i__2 = *n - ki + 1;
01155                     sscal_(&i__2, &remax, &vl[ki + is * vl_dim1], &c__1);
01156                     i__2 = *n - ki + 1;
01157                     sscal_(&i__2, &remax, &vl[ki + (is + 1) * vl_dim1], &c__1)
01158                             ;
01159 
01160                     i__2 = ki - 1;
01161                     for (k = 1; k <= i__2; ++k) {
01162                         vl[k + is * vl_dim1] = 0.f;
01163                         vl[k + (is + 1) * vl_dim1] = 0.f;
01164 /* L230: */
01165                     }
01166                 } else {
01167                     if (ki < *n - 1) {
01168                         i__2 = *n - ki - 1;
01169                         sgemv_("N", n, &i__2, &c_b22, &vl[(ki + 2) * vl_dim1 
01170                                 + 1], ldvl, &work[ki + 2 + *n], &c__1, &work[
01171                                 ki + *n], &vl[ki * vl_dim1 + 1], &c__1);
01172                         i__2 = *n - ki - 1;
01173                         sgemv_("N", n, &i__2, &c_b22, &vl[(ki + 2) * vl_dim1 
01174                                 + 1], ldvl, &work[ki + 2 + n2], &c__1, &work[
01175                                 ki + 1 + n2], &vl[(ki + 1) * vl_dim1 + 1], &
01176                                 c__1);
01177                     } else {
01178                         sscal_(n, &work[ki + *n], &vl[ki * vl_dim1 + 1], &
01179                                 c__1);
01180                         sscal_(n, &work[ki + 1 + n2], &vl[(ki + 1) * vl_dim1 
01181                                 + 1], &c__1);
01182                     }
01183 
01184                     emax = 0.f;
01185                     i__2 = *n;
01186                     for (k = 1; k <= i__2; ++k) {
01187 /* Computing MAX */
01188                         r__3 = emax, r__4 = (r__1 = vl[k + ki * vl_dim1], 
01189                                 dabs(r__1)) + (r__2 = vl[k + (ki + 1) * 
01190                                 vl_dim1], dabs(r__2));
01191                         emax = dmax(r__3,r__4);
01192 /* L240: */
01193                     }
01194                     remax = 1.f / emax;
01195                     sscal_(n, &remax, &vl[ki * vl_dim1 + 1], &c__1);
01196                     sscal_(n, &remax, &vl[(ki + 1) * vl_dim1 + 1], &c__1);
01197 
01198                 }
01199 
01200             }
01201 
01202             ++is;
01203             if (ip != 0) {
01204                 ++is;
01205             }
01206 L250:
01207             if (ip == -1) {
01208                 ip = 0;
01209             }
01210             if (ip == 1) {
01211                 ip = -1;
01212             }
01213 
01214 /* L260: */
01215         }
01216 
01217     }
01218 
01219     return 0;
01220 
01221 /*     End of STREVC */
01222 
01223 } /* strevc_ */


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