sgeev.c
Go to the documentation of this file.
00001 /* sgeev.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 integer c__1 = 1;
00019 static integer c__0 = 0;
00020 static integer c_n1 = -1;
00021 
00022 /* Subroutine */ int sgeev_(char *jobvl, char *jobvr, integer *n, real *a, 
00023         integer *lda, real *wr, real *wi, real *vl, integer *ldvl, real *vr, 
00024         integer *ldvr, real *work, integer *lwork, integer *info)
00025 {
00026     /* System generated locals */
00027     integer a_dim1, a_offset, vl_dim1, vl_offset, vr_dim1, vr_offset, i__1, 
00028             i__2, i__3;
00029     real r__1, r__2;
00030 
00031     /* Builtin functions */
00032     double sqrt(doublereal);
00033 
00034     /* Local variables */
00035     integer i__, k;
00036     real r__, cs, sn;
00037     integer ihi;
00038     real scl;
00039     integer ilo;
00040     real dum[1], eps;
00041     integer ibal;
00042     char side[1];
00043     real anrm;
00044     integer ierr, itau, iwrk, nout;
00045     extern /* Subroutine */ int srot_(integer *, real *, integer *, real *, 
00046             integer *, real *, real *);
00047     extern doublereal snrm2_(integer *, real *, integer *);
00048     extern logical lsame_(char *, char *);
00049     extern /* Subroutine */ int sscal_(integer *, real *, real *, integer *);
00050     extern doublereal slapy2_(real *, real *);
00051     extern /* Subroutine */ int slabad_(real *, real *);
00052     logical scalea;
00053     real cscale;
00054     extern /* Subroutine */ int sgebak_(char *, char *, integer *, integer *, 
00055             integer *, real *, integer *, real *, integer *, integer *), sgebal_(char *, integer *, real *, integer *, 
00056             integer *, integer *, real *, integer *);
00057     extern doublereal slamch_(char *), slange_(char *, integer *, 
00058             integer *, real *, integer *, real *);
00059     extern /* Subroutine */ int sgehrd_(integer *, integer *, integer *, real 
00060             *, integer *, real *, real *, integer *, integer *), xerbla_(char 
00061             *, integer *);
00062     extern integer ilaenv_(integer *, char *, char *, integer *, integer *, 
00063             integer *, integer *);
00064     logical select[1];
00065     real bignum;
00066     extern /* Subroutine */ int slascl_(char *, integer *, integer *, real *, 
00067             real *, integer *, integer *, real *, integer *, integer *);
00068     extern integer isamax_(integer *, real *, integer *);
00069     extern /* Subroutine */ int slacpy_(char *, integer *, integer *, real *, 
00070             integer *, real *, integer *), slartg_(real *, real *, 
00071             real *, real *, real *), sorghr_(integer *, integer *, integer *, 
00072             real *, integer *, real *, real *, integer *, integer *), shseqr_(
00073             char *, char *, integer *, integer *, integer *, real *, integer *
00074 , real *, real *, real *, integer *, real *, integer *, integer *), strevc_(char *, char *, logical *, integer *, 
00075             real *, integer *, real *, integer *, real *, integer *, integer *
00076 , integer *, real *, integer *);
00077     integer minwrk, maxwrk;
00078     logical wantvl;
00079     real smlnum;
00080     integer hswork;
00081     logical lquery, wantvr;
00082 
00083 
00084 /*  -- LAPACK driver routine (version 3.2) -- */
00085 /*     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd.. */
00086 /*     November 2006 */
00087 
00088 /*     .. Scalar Arguments .. */
00089 /*     .. */
00090 /*     .. Array Arguments .. */
00091 /*     .. */
00092 
00093 /*  Purpose */
00094 /*  ======= */
00095 
00096 /*  SGEEV computes for an N-by-N real nonsymmetric matrix A, the */
00097 /*  eigenvalues and, optionally, the left and/or right eigenvectors. */
00098 
00099 /*  The right eigenvector v(j) of A satisfies */
00100 /*                   A * v(j) = lambda(j) * v(j) */
00101 /*  where lambda(j) is its eigenvalue. */
00102 /*  The left eigenvector u(j) of A satisfies */
00103 /*                u(j)**H * A = lambda(j) * u(j)**H */
00104 /*  where u(j)**H denotes the conjugate transpose of u(j). */
00105 
00106 /*  The computed eigenvectors are normalized to have Euclidean norm */
00107 /*  equal to 1 and largest component real. */
00108 
00109 /*  Arguments */
00110 /*  ========= */
00111 
00112 /*  JOBVL   (input) CHARACTER*1 */
00113 /*          = 'N': left eigenvectors of A are not computed; */
00114 /*          = 'V': left eigenvectors of A are computed. */
00115 
00116 /*  JOBVR   (input) CHARACTER*1 */
00117 /*          = 'N': right eigenvectors of A are not computed; */
00118 /*          = 'V': right eigenvectors of A are computed. */
00119 
00120 /*  N       (input) INTEGER */
00121 /*          The order of the matrix A. N >= 0. */
00122 
00123 /*  A       (input/output) REAL array, dimension (LDA,N) */
00124 /*          On entry, the N-by-N matrix A. */
00125 /*          On exit, A has been overwritten. */
00126 
00127 /*  LDA     (input) INTEGER */
00128 /*          The leading dimension of the array A.  LDA >= max(1,N). */
00129 
00130 /*  WR      (output) REAL array, dimension (N) */
00131 /*  WI      (output) REAL array, dimension (N) */
00132 /*          WR and WI contain the real and imaginary parts, */
00133 /*          respectively, of the computed eigenvalues.  Complex */
00134 /*          conjugate pairs of eigenvalues appear consecutively */
00135 /*          with the eigenvalue having the positive imaginary part */
00136 /*          first. */
00137 
00138 /*  VL      (output) REAL array, dimension (LDVL,N) */
00139 /*          If JOBVL = 'V', the left eigenvectors u(j) are stored one */
00140 /*          after another in the columns of VL, in the same order */
00141 /*          as their eigenvalues. */
00142 /*          If JOBVL = 'N', VL is not referenced. */
00143 /*          If the j-th eigenvalue is real, then u(j) = VL(:,j), */
00144 /*          the j-th column of VL. */
00145 /*          If the j-th and (j+1)-st eigenvalues form a complex */
00146 /*          conjugate pair, then u(j) = VL(:,j) + i*VL(:,j+1) and */
00147 /*          u(j+1) = VL(:,j) - i*VL(:,j+1). */
00148 
00149 /*  LDVL    (input) INTEGER */
00150 /*          The leading dimension of the array VL.  LDVL >= 1; if */
00151 /*          JOBVL = 'V', LDVL >= N. */
00152 
00153 /*  VR      (output) REAL array, dimension (LDVR,N) */
00154 /*          If JOBVR = 'V', the right eigenvectors v(j) are stored one */
00155 /*          after another in the columns of VR, in the same order */
00156 /*          as their eigenvalues. */
00157 /*          If JOBVR = 'N', VR is not referenced. */
00158 /*          If the j-th eigenvalue is real, then v(j) = VR(:,j), */
00159 /*          the j-th column of VR. */
00160 /*          If the j-th and (j+1)-st eigenvalues form a complex */
00161 /*          conjugate pair, then v(j) = VR(:,j) + i*VR(:,j+1) and */
00162 /*          v(j+1) = VR(:,j) - i*VR(:,j+1). */
00163 
00164 /*  LDVR    (input) INTEGER */
00165 /*          The leading dimension of the array VR.  LDVR >= 1; if */
00166 /*          JOBVR = 'V', LDVR >= N. */
00167 
00168 /*  WORK    (workspace/output) REAL array, dimension (MAX(1,LWORK)) */
00169 /*          On exit, if INFO = 0, WORK(1) returns the optimal LWORK. */
00170 
00171 /*  LWORK   (input) INTEGER */
00172 /*          The dimension of the array WORK.  LWORK >= max(1,3*N), and */
00173 /*          if JOBVL = 'V' or JOBVR = 'V', LWORK >= 4*N.  For good */
00174 /*          performance, LWORK must generally be larger. */
00175 
00176 /*          If LWORK = -1, then a workspace query is assumed; the routine */
00177 /*          only calculates the optimal size of the WORK array, returns */
00178 /*          this value as the first entry of the WORK array, and no error */
00179 /*          message related to LWORK is issued by XERBLA. */
00180 
00181 /*  INFO    (output) INTEGER */
00182 /*          = 0:  successful exit */
00183 /*          < 0:  if INFO = -i, the i-th argument had an illegal value. */
00184 /*          > 0:  if INFO = i, the QR algorithm failed to compute all the */
00185 /*                eigenvalues, and no eigenvectors have been computed; */
00186 /*                elements i+1:N of WR and WI contain eigenvalues which */
00187 /*                have converged. */
00188 
00189 /*  ===================================================================== */
00190 
00191 /*     .. Parameters .. */
00192 /*     .. */
00193 /*     .. Local Scalars .. */
00194 /*     .. */
00195 /*     .. Local Arrays .. */
00196 /*     .. */
00197 /*     .. External Subroutines .. */
00198 /*     .. */
00199 /*     .. External Functions .. */
00200 /*     .. */
00201 /*     .. Intrinsic Functions .. */
00202 /*     .. */
00203 /*     .. Executable Statements .. */
00204 
00205 /*     Test the input arguments */
00206 
00207     /* Parameter adjustments */
00208     a_dim1 = *lda;
00209     a_offset = 1 + a_dim1;
00210     a -= a_offset;
00211     --wr;
00212     --wi;
00213     vl_dim1 = *ldvl;
00214     vl_offset = 1 + vl_dim1;
00215     vl -= vl_offset;
00216     vr_dim1 = *ldvr;
00217     vr_offset = 1 + vr_dim1;
00218     vr -= vr_offset;
00219     --work;
00220 
00221     /* Function Body */
00222     *info = 0;
00223     lquery = *lwork == -1;
00224     wantvl = lsame_(jobvl, "V");
00225     wantvr = lsame_(jobvr, "V");
00226     if (! wantvl && ! lsame_(jobvl, "N")) {
00227         *info = -1;
00228     } else if (! wantvr && ! lsame_(jobvr, "N")) {
00229         *info = -2;
00230     } else if (*n < 0) {
00231         *info = -3;
00232     } else if (*lda < max(1,*n)) {
00233         *info = -5;
00234     } else if (*ldvl < 1 || wantvl && *ldvl < *n) {
00235         *info = -9;
00236     } else if (*ldvr < 1 || wantvr && *ldvr < *n) {
00237         *info = -11;
00238     }
00239 
00240 /*     Compute workspace */
00241 /*      (Note: Comments in the code beginning "Workspace:" describe the */
00242 /*       minimal amount of workspace needed at that point in the code, */
00243 /*       as well as the preferred amount for good performance. */
00244 /*       NB refers to the optimal block size for the immediately */
00245 /*       following subroutine, as returned by ILAENV. */
00246 /*       HSWORK refers to the workspace preferred by SHSEQR, as */
00247 /*       calculated below. HSWORK is computed assuming ILO=1 and IHI=N, */
00248 /*       the worst case.) */
00249 
00250     if (*info == 0) {
00251         if (*n == 0) {
00252             minwrk = 1;
00253             maxwrk = 1;
00254         } else {
00255             maxwrk = (*n << 1) + *n * ilaenv_(&c__1, "SGEHRD", " ", n, &c__1, 
00256                     n, &c__0);
00257             if (wantvl) {
00258                 minwrk = *n << 2;
00259 /* Computing MAX */
00260                 i__1 = maxwrk, i__2 = (*n << 1) + (*n - 1) * ilaenv_(&c__1, 
00261                         "SORGHR", " ", n, &c__1, n, &c_n1);
00262                 maxwrk = max(i__1,i__2);
00263                 shseqr_("S", "V", n, &c__1, n, &a[a_offset], lda, &wr[1], &wi[
00264                         1], &vl[vl_offset], ldvl, &work[1], &c_n1, info);
00265                 hswork = work[1];
00266 /* Computing MAX */
00267                 i__1 = maxwrk, i__2 = *n + 1, i__1 = max(i__1,i__2), i__2 = *
00268                         n + hswork;
00269                 maxwrk = max(i__1,i__2);
00270 /* Computing MAX */
00271                 i__1 = maxwrk, i__2 = *n << 2;
00272                 maxwrk = max(i__1,i__2);
00273             } else if (wantvr) {
00274                 minwrk = *n << 2;
00275 /* Computing MAX */
00276                 i__1 = maxwrk, i__2 = (*n << 1) + (*n - 1) * ilaenv_(&c__1, 
00277                         "SORGHR", " ", n, &c__1, n, &c_n1);
00278                 maxwrk = max(i__1,i__2);
00279                 shseqr_("S", "V", n, &c__1, n, &a[a_offset], lda, &wr[1], &wi[
00280                         1], &vr[vr_offset], ldvr, &work[1], &c_n1, info);
00281                 hswork = work[1];
00282 /* Computing MAX */
00283                 i__1 = maxwrk, i__2 = *n + 1, i__1 = max(i__1,i__2), i__2 = *
00284                         n + hswork;
00285                 maxwrk = max(i__1,i__2);
00286 /* Computing MAX */
00287                 i__1 = maxwrk, i__2 = *n << 2;
00288                 maxwrk = max(i__1,i__2);
00289             } else {
00290                 minwrk = *n * 3;
00291                 shseqr_("E", "N", n, &c__1, n, &a[a_offset], lda, &wr[1], &wi[
00292                         1], &vr[vr_offset], ldvr, &work[1], &c_n1, info);
00293                 hswork = work[1];
00294 /* Computing MAX */
00295                 i__1 = maxwrk, i__2 = *n + 1, i__1 = max(i__1,i__2), i__2 = *
00296                         n + hswork;
00297                 maxwrk = max(i__1,i__2);
00298             }
00299             maxwrk = max(maxwrk,minwrk);
00300         }
00301         work[1] = (real) maxwrk;
00302 
00303         if (*lwork < minwrk && ! lquery) {
00304             *info = -13;
00305         }
00306     }
00307 
00308     if (*info != 0) {
00309         i__1 = -(*info);
00310         xerbla_("SGEEV ", &i__1);
00311         return 0;
00312     } else if (lquery) {
00313         return 0;
00314     }
00315 
00316 /*     Quick return if possible */
00317 
00318     if (*n == 0) {
00319         return 0;
00320     }
00321 
00322 /*     Get machine constants */
00323 
00324     eps = slamch_("P");
00325     smlnum = slamch_("S");
00326     bignum = 1.f / smlnum;
00327     slabad_(&smlnum, &bignum);
00328     smlnum = sqrt(smlnum) / eps;
00329     bignum = 1.f / smlnum;
00330 
00331 /*     Scale A if max element outside range [SMLNUM,BIGNUM] */
00332 
00333     anrm = slange_("M", n, n, &a[a_offset], lda, dum);
00334     scalea = FALSE_;
00335     if (anrm > 0.f && anrm < smlnum) {
00336         scalea = TRUE_;
00337         cscale = smlnum;
00338     } else if (anrm > bignum) {
00339         scalea = TRUE_;
00340         cscale = bignum;
00341     }
00342     if (scalea) {
00343         slascl_("G", &c__0, &c__0, &anrm, &cscale, n, n, &a[a_offset], lda, &
00344                 ierr);
00345     }
00346 
00347 /*     Balance the matrix */
00348 /*     (Workspace: need N) */
00349 
00350     ibal = 1;
00351     sgebal_("B", n, &a[a_offset], lda, &ilo, &ihi, &work[ibal], &ierr);
00352 
00353 /*     Reduce to upper Hessenberg form */
00354 /*     (Workspace: need 3*N, prefer 2*N+N*NB) */
00355 
00356     itau = ibal + *n;
00357     iwrk = itau + *n;
00358     i__1 = *lwork - iwrk + 1;
00359     sgehrd_(n, &ilo, &ihi, &a[a_offset], lda, &work[itau], &work[iwrk], &i__1, 
00360              &ierr);
00361 
00362     if (wantvl) {
00363 
00364 /*        Want left eigenvectors */
00365 /*        Copy Householder vectors to VL */
00366 
00367         *(unsigned char *)side = 'L';
00368         slacpy_("L", n, n, &a[a_offset], lda, &vl[vl_offset], ldvl)
00369                 ;
00370 
00371 /*        Generate orthogonal matrix in VL */
00372 /*        (Workspace: need 3*N-1, prefer 2*N+(N-1)*NB) */
00373 
00374         i__1 = *lwork - iwrk + 1;
00375         sorghr_(n, &ilo, &ihi, &vl[vl_offset], ldvl, &work[itau], &work[iwrk], 
00376                  &i__1, &ierr);
00377 
00378 /*        Perform QR iteration, accumulating Schur vectors in VL */
00379 /*        (Workspace: need N+1, prefer N+HSWORK (see comments) ) */
00380 
00381         iwrk = itau;
00382         i__1 = *lwork - iwrk + 1;
00383         shseqr_("S", "V", n, &ilo, &ihi, &a[a_offset], lda, &wr[1], &wi[1], &
00384                 vl[vl_offset], ldvl, &work[iwrk], &i__1, info);
00385 
00386         if (wantvr) {
00387 
00388 /*           Want left and right eigenvectors */
00389 /*           Copy Schur vectors to VR */
00390 
00391             *(unsigned char *)side = 'B';
00392             slacpy_("F", n, n, &vl[vl_offset], ldvl, &vr[vr_offset], ldvr);
00393         }
00394 
00395     } else if (wantvr) {
00396 
00397 /*        Want right eigenvectors */
00398 /*        Copy Householder vectors to VR */
00399 
00400         *(unsigned char *)side = 'R';
00401         slacpy_("L", n, n, &a[a_offset], lda, &vr[vr_offset], ldvr)
00402                 ;
00403 
00404 /*        Generate orthogonal matrix in VR */
00405 /*        (Workspace: need 3*N-1, prefer 2*N+(N-1)*NB) */
00406 
00407         i__1 = *lwork - iwrk + 1;
00408         sorghr_(n, &ilo, &ihi, &vr[vr_offset], ldvr, &work[itau], &work[iwrk], 
00409                  &i__1, &ierr);
00410 
00411 /*        Perform QR iteration, accumulating Schur vectors in VR */
00412 /*        (Workspace: need N+1, prefer N+HSWORK (see comments) ) */
00413 
00414         iwrk = itau;
00415         i__1 = *lwork - iwrk + 1;
00416         shseqr_("S", "V", n, &ilo, &ihi, &a[a_offset], lda, &wr[1], &wi[1], &
00417                 vr[vr_offset], ldvr, &work[iwrk], &i__1, info);
00418 
00419     } else {
00420 
00421 /*        Compute eigenvalues only */
00422 /*        (Workspace: need N+1, prefer N+HSWORK (see comments) ) */
00423 
00424         iwrk = itau;
00425         i__1 = *lwork - iwrk + 1;
00426         shseqr_("E", "N", n, &ilo, &ihi, &a[a_offset], lda, &wr[1], &wi[1], &
00427                 vr[vr_offset], ldvr, &work[iwrk], &i__1, info);
00428     }
00429 
00430 /*     If INFO > 0 from SHSEQR, then quit */
00431 
00432     if (*info > 0) {
00433         goto L50;
00434     }
00435 
00436     if (wantvl || wantvr) {
00437 
00438 /*        Compute left and/or right eigenvectors */
00439 /*        (Workspace: need 4*N) */
00440 
00441         strevc_(side, "B", select, n, &a[a_offset], lda, &vl[vl_offset], ldvl, 
00442                  &vr[vr_offset], ldvr, n, &nout, &work[iwrk], &ierr);
00443     }
00444 
00445     if (wantvl) {
00446 
00447 /*        Undo balancing of left eigenvectors */
00448 /*        (Workspace: need N) */
00449 
00450         sgebak_("B", "L", n, &ilo, &ihi, &work[ibal], n, &vl[vl_offset], ldvl, 
00451                  &ierr);
00452 
00453 /*        Normalize left eigenvectors and make largest component real */
00454 
00455         i__1 = *n;
00456         for (i__ = 1; i__ <= i__1; ++i__) {
00457             if (wi[i__] == 0.f) {
00458                 scl = 1.f / snrm2_(n, &vl[i__ * vl_dim1 + 1], &c__1);
00459                 sscal_(n, &scl, &vl[i__ * vl_dim1 + 1], &c__1);
00460             } else if (wi[i__] > 0.f) {
00461                 r__1 = snrm2_(n, &vl[i__ * vl_dim1 + 1], &c__1);
00462                 r__2 = snrm2_(n, &vl[(i__ + 1) * vl_dim1 + 1], &c__1);
00463                 scl = 1.f / slapy2_(&r__1, &r__2);
00464                 sscal_(n, &scl, &vl[i__ * vl_dim1 + 1], &c__1);
00465                 sscal_(n, &scl, &vl[(i__ + 1) * vl_dim1 + 1], &c__1);
00466                 i__2 = *n;
00467                 for (k = 1; k <= i__2; ++k) {
00468 /* Computing 2nd power */
00469                     r__1 = vl[k + i__ * vl_dim1];
00470 /* Computing 2nd power */
00471                     r__2 = vl[k + (i__ + 1) * vl_dim1];
00472                     work[iwrk + k - 1] = r__1 * r__1 + r__2 * r__2;
00473 /* L10: */
00474                 }
00475                 k = isamax_(n, &work[iwrk], &c__1);
00476                 slartg_(&vl[k + i__ * vl_dim1], &vl[k + (i__ + 1) * vl_dim1], 
00477                         &cs, &sn, &r__);
00478                 srot_(n, &vl[i__ * vl_dim1 + 1], &c__1, &vl[(i__ + 1) * 
00479                         vl_dim1 + 1], &c__1, &cs, &sn);
00480                 vl[k + (i__ + 1) * vl_dim1] = 0.f;
00481             }
00482 /* L20: */
00483         }
00484     }
00485 
00486     if (wantvr) {
00487 
00488 /*        Undo balancing of right eigenvectors */
00489 /*        (Workspace: need N) */
00490 
00491         sgebak_("B", "R", n, &ilo, &ihi, &work[ibal], n, &vr[vr_offset], ldvr, 
00492                  &ierr);
00493 
00494 /*        Normalize right eigenvectors and make largest component real */
00495 
00496         i__1 = *n;
00497         for (i__ = 1; i__ <= i__1; ++i__) {
00498             if (wi[i__] == 0.f) {
00499                 scl = 1.f / snrm2_(n, &vr[i__ * vr_dim1 + 1], &c__1);
00500                 sscal_(n, &scl, &vr[i__ * vr_dim1 + 1], &c__1);
00501             } else if (wi[i__] > 0.f) {
00502                 r__1 = snrm2_(n, &vr[i__ * vr_dim1 + 1], &c__1);
00503                 r__2 = snrm2_(n, &vr[(i__ + 1) * vr_dim1 + 1], &c__1);
00504                 scl = 1.f / slapy2_(&r__1, &r__2);
00505                 sscal_(n, &scl, &vr[i__ * vr_dim1 + 1], &c__1);
00506                 sscal_(n, &scl, &vr[(i__ + 1) * vr_dim1 + 1], &c__1);
00507                 i__2 = *n;
00508                 for (k = 1; k <= i__2; ++k) {
00509 /* Computing 2nd power */
00510                     r__1 = vr[k + i__ * vr_dim1];
00511 /* Computing 2nd power */
00512                     r__2 = vr[k + (i__ + 1) * vr_dim1];
00513                     work[iwrk + k - 1] = r__1 * r__1 + r__2 * r__2;
00514 /* L30: */
00515                 }
00516                 k = isamax_(n, &work[iwrk], &c__1);
00517                 slartg_(&vr[k + i__ * vr_dim1], &vr[k + (i__ + 1) * vr_dim1], 
00518                         &cs, &sn, &r__);
00519                 srot_(n, &vr[i__ * vr_dim1 + 1], &c__1, &vr[(i__ + 1) * 
00520                         vr_dim1 + 1], &c__1, &cs, &sn);
00521                 vr[k + (i__ + 1) * vr_dim1] = 0.f;
00522             }
00523 /* L40: */
00524         }
00525     }
00526 
00527 /*     Undo scaling if necessary */
00528 
00529 L50:
00530     if (scalea) {
00531         i__1 = *n - *info;
00532 /* Computing MAX */
00533         i__3 = *n - *info;
00534         i__2 = max(i__3,1);
00535         slascl_("G", &c__0, &c__0, &cscale, &anrm, &i__1, &c__1, &wr[*info + 
00536                 1], &i__2, &ierr);
00537         i__1 = *n - *info;
00538 /* Computing MAX */
00539         i__3 = *n - *info;
00540         i__2 = max(i__3,1);
00541         slascl_("G", &c__0, &c__0, &cscale, &anrm, &i__1, &c__1, &wi[*info + 
00542                 1], &i__2, &ierr);
00543         if (*info > 0) {
00544             i__1 = ilo - 1;
00545             slascl_("G", &c__0, &c__0, &cscale, &anrm, &i__1, &c__1, &wr[1], 
00546                     n, &ierr);
00547             i__1 = ilo - 1;
00548             slascl_("G", &c__0, &c__0, &cscale, &anrm, &i__1, &c__1, &wi[1], 
00549                     n, &ierr);
00550         }
00551     }
00552 
00553     work[1] = (real) maxwrk;
00554     return 0;
00555 
00556 /*     End of SGEEV */
00557 
00558 } /* sgeev_ */


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