LAPACK 3.3.1
Linear Algebra PACKage

dgeesx.f

Go to the documentation of this file.
00001       SUBROUTINE DGEESX( JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM,
00002      $                   WR, WI, VS, LDVS, RCONDE, RCONDV, WORK, LWORK,
00003      $                   IWORK, LIWORK, BWORK, INFO )
00004 *
00005 *  -- LAPACK driver routine (version 3.2.2) --
00006 *  -- LAPACK is a software package provided by Univ. of Tennessee,    --
00007 *  -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
00008 *     June 2010
00009 *
00010 *     .. Scalar Arguments ..
00011       CHARACTER          JOBVS, SENSE, SORT
00012       INTEGER            INFO, LDA, LDVS, LIWORK, LWORK, N, SDIM
00013       DOUBLE PRECISION   RCONDE, RCONDV
00014 *     ..
00015 *     .. Array Arguments ..
00016       LOGICAL            BWORK( * )
00017       INTEGER            IWORK( * )
00018       DOUBLE PRECISION   A( LDA, * ), VS( LDVS, * ), WI( * ), WORK( * ),
00019      $                   WR( * )
00020 *     ..
00021 *     .. Function Arguments ..
00022       LOGICAL            SELECT
00023       EXTERNAL           SELECT
00024 *     ..
00025 *
00026 *  Purpose
00027 *  =======
00028 *
00029 *  DGEESX computes for an N-by-N real nonsymmetric matrix A, the
00030 *  eigenvalues, the real Schur form T, and, optionally, the matrix of
00031 *  Schur vectors Z.  This gives the Schur factorization A = Z*T*(Z**T).
00032 *
00033 *  Optionally, it also orders the eigenvalues on the diagonal of the
00034 *  real Schur form so that selected eigenvalues are at the top left;
00035 *  computes a reciprocal condition number for the average of the
00036 *  selected eigenvalues (RCONDE); and computes a reciprocal condition
00037 *  number for the right invariant subspace corresponding to the
00038 *  selected eigenvalues (RCONDV).  The leading columns of Z form an
00039 *  orthonormal basis for this invariant subspace.
00040 *
00041 *  For further explanation of the reciprocal condition numbers RCONDE
00042 *  and RCONDV, see Section 4.10 of the LAPACK Users' Guide (where
00043 *  these quantities are called s and sep respectively).
00044 *
00045 *  A real matrix is in real Schur form if it is upper quasi-triangular
00046 *  with 1-by-1 and 2-by-2 blocks. 2-by-2 blocks will be standardized in
00047 *  the form
00048 *            [  a  b  ]
00049 *            [  c  a  ]
00050 *
00051 *  where b*c < 0. The eigenvalues of such a block are a +- sqrt(bc).
00052 *
00053 *  Arguments
00054 *  =========
00055 *
00056 *  JOBVS   (input) CHARACTER*1
00057 *          = 'N': Schur vectors are not computed;
00058 *          = 'V': Schur vectors are computed.
00059 *
00060 *  SORT    (input) CHARACTER*1
00061 *          Specifies whether or not to order the eigenvalues on the
00062 *          diagonal of the Schur form.
00063 *          = 'N': Eigenvalues are not ordered;
00064 *          = 'S': Eigenvalues are ordered (see SELECT).
00065 *
00066 *  SELECT  (external procedure) LOGICAL FUNCTION of two DOUBLE PRECISION arguments
00067 *          SELECT must be declared EXTERNAL in the calling subroutine.
00068 *          If SORT = 'S', SELECT is used to select eigenvalues to sort
00069 *          to the top left of the Schur form.
00070 *          If SORT = 'N', SELECT is not referenced.
00071 *          An eigenvalue WR(j)+sqrt(-1)*WI(j) is selected if
00072 *          SELECT(WR(j),WI(j)) is true; i.e., if either one of a
00073 *          complex conjugate pair of eigenvalues is selected, then both
00074 *          are.  Note that a selected complex eigenvalue may no longer
00075 *          satisfy SELECT(WR(j),WI(j)) = .TRUE. after ordering, since
00076 *          ordering may change the value of complex eigenvalues
00077 *          (especially if the eigenvalue is ill-conditioned); in this
00078 *          case INFO may be set to N+3 (see INFO below).
00079 *
00080 *  SENSE   (input) CHARACTER*1
00081 *          Determines which reciprocal condition numbers are computed.
00082 *          = 'N': None are computed;
00083 *          = 'E': Computed for average of selected eigenvalues only;
00084 *          = 'V': Computed for selected right invariant subspace only;
00085 *          = 'B': Computed for both.
00086 *          If SENSE = 'E', 'V' or 'B', SORT must equal 'S'.
00087 *
00088 *  N       (input) INTEGER
00089 *          The order of the matrix A. N >= 0.
00090 *
00091 *  A       (input/output) DOUBLE PRECISION array, dimension (LDA, N)
00092 *          On entry, the N-by-N matrix A.
00093 *          On exit, A is overwritten by its real Schur form T.
00094 *
00095 *  LDA     (input) INTEGER
00096 *          The leading dimension of the array A.  LDA >= max(1,N).
00097 *
00098 *  SDIM    (output) INTEGER
00099 *          If SORT = 'N', SDIM = 0.
00100 *          If SORT = 'S', SDIM = number of eigenvalues (after sorting)
00101 *                         for which SELECT is true. (Complex conjugate
00102 *                         pairs for which SELECT is true for either
00103 *                         eigenvalue count as 2.)
00104 *
00105 *  WR      (output) DOUBLE PRECISION array, dimension (N)
00106 *  WI      (output) DOUBLE PRECISION array, dimension (N)
00107 *          WR and WI contain the real and imaginary parts, respectively,
00108 *          of the computed eigenvalues, in the same order that they
00109 *          appear on the diagonal of the output Schur form T.  Complex
00110 *          conjugate pairs of eigenvalues appear consecutively with the
00111 *          eigenvalue having the positive imaginary part first.
00112 *
00113 *  VS      (output) DOUBLE PRECISION array, dimension (LDVS,N)
00114 *          If JOBVS = 'V', VS contains the orthogonal matrix Z of Schur
00115 *          vectors.
00116 *          If JOBVS = 'N', VS is not referenced.
00117 *
00118 *  LDVS    (input) INTEGER
00119 *          The leading dimension of the array VS.  LDVS >= 1, and if
00120 *          JOBVS = 'V', LDVS >= N.
00121 *
00122 *  RCONDE  (output) DOUBLE PRECISION
00123 *          If SENSE = 'E' or 'B', RCONDE contains the reciprocal
00124 *          condition number for the average of the selected eigenvalues.
00125 *          Not referenced if SENSE = 'N' or 'V'.
00126 *
00127 *  RCONDV  (output) DOUBLE PRECISION
00128 *          If SENSE = 'V' or 'B', RCONDV contains the reciprocal
00129 *          condition number for the selected right invariant subspace.
00130 *          Not referenced if SENSE = 'N' or 'E'.
00131 *
00132 *  WORK    (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK))
00133 *          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
00134 *
00135 *  LWORK   (input) INTEGER
00136 *          The dimension of the array WORK.  LWORK >= max(1,3*N).
00137 *          Also, if SENSE = 'E' or 'V' or 'B',
00138 *          LWORK >= N+2*SDIM*(N-SDIM), where SDIM is the number of
00139 *          selected eigenvalues computed by this routine.  Note that
00140 *          N+2*SDIM*(N-SDIM) <= N+N*N/2. Note also that an error is only
00141 *          returned if LWORK < max(1,3*N), but if SENSE = 'E' or 'V' or
00142 *          'B' this may not be large enough.
00143 *          For good performance, LWORK must generally be larger.
00144 *
00145 *          If LWORK = -1, then a workspace query is assumed; the routine
00146 *          only calculates upper bounds on the optimal sizes of the
00147 *          arrays WORK and IWORK, returns these values as the first
00148 *          entries of the WORK and IWORK arrays, and no error messages
00149 *          related to LWORK or LIWORK are issued by XERBLA.
00150 *
00151 *  IWORK   (workspace/output) INTEGER array, dimension (MAX(1,LIWORK))
00152 *          On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
00153 *
00154 *  LIWORK  (input) INTEGER
00155 *          The dimension of the array IWORK.
00156 *          LIWORK >= 1; if SENSE = 'V' or 'B', LIWORK >= SDIM*(N-SDIM).
00157 *          Note that SDIM*(N-SDIM) <= N*N/4. Note also that an error is
00158 *          only returned if LIWORK < 1, but if SENSE = 'V' or 'B' this
00159 *          may not be large enough.
00160 *
00161 *          If LIWORK = -1, then a workspace query is assumed; the
00162 *          routine only calculates upper bounds on the optimal sizes of
00163 *          the arrays WORK and IWORK, returns these values as the first
00164 *          entries of the WORK and IWORK arrays, and no error messages
00165 *          related to LWORK or LIWORK are issued by XERBLA.
00166 *
00167 *  BWORK   (workspace) LOGICAL array, dimension (N)
00168 *          Not referenced if SORT = 'N'.
00169 *
00170 *  INFO    (output) INTEGER
00171 *          = 0: successful exit
00172 *          < 0: if INFO = -i, the i-th argument had an illegal value.
00173 *          > 0: if INFO = i, and i is
00174 *             <= N: the QR algorithm failed to compute all the
00175 *                   eigenvalues; elements 1:ILO-1 and i+1:N of WR and WI
00176 *                   contain those eigenvalues which have converged; if
00177 *                   JOBVS = 'V', VS contains the transformation which
00178 *                   reduces A to its partially converged Schur form.
00179 *             = N+1: the eigenvalues could not be reordered because some
00180 *                   eigenvalues were too close to separate (the problem
00181 *                   is very ill-conditioned);
00182 *             = N+2: after reordering, roundoff changed values of some
00183 *                   complex eigenvalues so that leading eigenvalues in
00184 *                   the Schur form no longer satisfy SELECT=.TRUE.  This
00185 *                   could also be caused by underflow due to scaling.
00186 *
00187 *  =====================================================================
00188 *
00189 *     .. Parameters ..
00190       DOUBLE PRECISION   ZERO, ONE
00191       PARAMETER          ( ZERO = 0.0D0, ONE = 1.0D0 )
00192 *     ..
00193 *     .. Local Scalars ..
00194       LOGICAL            CURSL, LASTSL, LQUERY, LST2SL, SCALEA, WANTSB,
00195      $                   WANTSE, WANTSN, WANTST, WANTSV, WANTVS
00196       INTEGER            HSWORK, I, I1, I2, IBAL, ICOND, IERR, IEVAL,
00197      $                   IHI, ILO, INXT, IP, ITAU, IWRK, LIWRK, LWRK,
00198      $                   MAXWRK, MINWRK
00199       DOUBLE PRECISION   ANRM, BIGNUM, CSCALE, EPS, SMLNUM
00200 *     ..
00201 *     .. Local Arrays ..
00202       DOUBLE PRECISION   DUM( 1 )
00203 *     ..
00204 *     .. External Subroutines ..
00205       EXTERNAL           DCOPY, DGEBAK, DGEBAL, DGEHRD, DHSEQR, DLACPY,
00206      $                   DLASCL, DORGHR, DSWAP, DTRSEN, XERBLA
00207 *     ..
00208 *     .. External Functions ..
00209       LOGICAL            LSAME
00210       INTEGER            ILAENV
00211       DOUBLE PRECISION   DLAMCH, DLANGE
00212       EXTERNAL           LSAME, ILAENV, DLABAD, DLAMCH, DLANGE
00213 *     ..
00214 *     .. Intrinsic Functions ..
00215       INTRINSIC          MAX, SQRT
00216 *     ..
00217 *     .. Executable Statements ..
00218 *
00219 *     Test the input arguments
00220 *
00221       INFO = 0
00222       WANTVS = LSAME( JOBVS, 'V' )
00223       WANTST = LSAME( SORT, 'S' )
00224       WANTSN = LSAME( SENSE, 'N' )
00225       WANTSE = LSAME( SENSE, 'E' )
00226       WANTSV = LSAME( SENSE, 'V' )
00227       WANTSB = LSAME( SENSE, 'B' )
00228       LQUERY = ( LWORK.EQ.-1 .OR. LIWORK.EQ.-1 )
00229 *
00230       IF( ( .NOT.WANTVS ) .AND. ( .NOT.LSAME( JOBVS, 'N' ) ) ) THEN
00231          INFO = -1
00232       ELSE IF( ( .NOT.WANTST ) .AND. ( .NOT.LSAME( SORT, 'N' ) ) ) THEN
00233          INFO = -2
00234       ELSE IF( .NOT.( WANTSN .OR. WANTSE .OR. WANTSV .OR. WANTSB ) .OR.
00235      $         ( .NOT.WANTST .AND. .NOT.WANTSN ) ) THEN
00236          INFO = -4
00237       ELSE IF( N.LT.0 ) THEN
00238          INFO = -5
00239       ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
00240          INFO = -7
00241       ELSE IF( LDVS.LT.1 .OR. ( WANTVS .AND. LDVS.LT.N ) ) THEN
00242          INFO = -12
00243       END IF
00244 *
00245 *     Compute workspace
00246 *      (Note: Comments in the code beginning "RWorkspace:" describe the
00247 *       minimal amount of real workspace needed at that point in the
00248 *       code, as well as the preferred amount for good performance.
00249 *       IWorkspace refers to integer workspace.
00250 *       NB refers to the optimal block size for the immediately
00251 *       following subroutine, as returned by ILAENV.
00252 *       HSWORK refers to the workspace preferred by DHSEQR, as
00253 *       calculated below. HSWORK is computed assuming ILO=1 and IHI=N,
00254 *       the worst case.
00255 *       If SENSE = 'E', 'V' or 'B', then the amount of workspace needed
00256 *       depends on SDIM, which is computed by the routine DTRSEN later
00257 *       in the code.)
00258 *
00259       IF( INFO.EQ.0 ) THEN
00260          LIWRK = 1
00261          IF( N.EQ.0 ) THEN
00262             MINWRK = 1
00263             LWRK = 1
00264          ELSE
00265             MAXWRK = 2*N + N*ILAENV( 1, 'DGEHRD', ' ', N, 1, N, 0 )
00266             MINWRK = 3*N
00267 *
00268             CALL DHSEQR( 'S', JOBVS, N, 1, N, A, LDA, WR, WI, VS, LDVS,
00269      $             WORK, -1, IEVAL )
00270             HSWORK = WORK( 1 )
00271 *
00272             IF( .NOT.WANTVS ) THEN
00273                MAXWRK = MAX( MAXWRK, N + HSWORK )
00274             ELSE
00275                MAXWRK = MAX( MAXWRK, 2*N + ( N - 1 )*ILAENV( 1,
00276      $                       'DORGHR', ' ', N, 1, N, -1 ) )
00277                MAXWRK = MAX( MAXWRK, N + HSWORK )
00278             END IF
00279             LWRK = MAXWRK
00280             IF( .NOT.WANTSN )
00281      $         LWRK = MAX( LWRK, N + ( N*N )/2 )
00282             IF( WANTSV .OR. WANTSB )
00283      $         LIWRK = ( N*N )/4
00284          END IF
00285          IWORK( 1 ) = LIWRK
00286          WORK( 1 ) = LWRK
00287 *
00288          IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY ) THEN
00289             INFO = -16
00290          ELSE IF( LIWORK.LT.1 .AND. .NOT.LQUERY ) THEN
00291             INFO = -18
00292          END IF
00293       END IF
00294 *
00295       IF( INFO.NE.0 ) THEN
00296          CALL XERBLA( 'DGEESX', -INFO )
00297          RETURN
00298       ELSE IF( LQUERY ) THEN
00299          RETURN
00300       END IF
00301 *
00302 *     Quick return if possible
00303 *
00304       IF( N.EQ.0 ) THEN
00305          SDIM = 0
00306          RETURN
00307       END IF
00308 *
00309 *     Get machine constants
00310 *
00311       EPS = DLAMCH( 'P' )
00312       SMLNUM = DLAMCH( 'S' )
00313       BIGNUM = ONE / SMLNUM
00314       CALL DLABAD( SMLNUM, BIGNUM )
00315       SMLNUM = SQRT( SMLNUM ) / EPS
00316       BIGNUM = ONE / SMLNUM
00317 *
00318 *     Scale A if max element outside range [SMLNUM,BIGNUM]
00319 *
00320       ANRM = DLANGE( 'M', N, N, A, LDA, DUM )
00321       SCALEA = .FALSE.
00322       IF( ANRM.GT.ZERO .AND. ANRM.LT.SMLNUM ) THEN
00323          SCALEA = .TRUE.
00324          CSCALE = SMLNUM
00325       ELSE IF( ANRM.GT.BIGNUM ) THEN
00326          SCALEA = .TRUE.
00327          CSCALE = BIGNUM
00328       END IF
00329       IF( SCALEA )
00330      $   CALL DLASCL( 'G', 0, 0, ANRM, CSCALE, N, N, A, LDA, IERR )
00331 *
00332 *     Permute the matrix to make it more nearly triangular
00333 *     (RWorkspace: need N)
00334 *
00335       IBAL = 1
00336       CALL DGEBAL( 'P', N, A, LDA, ILO, IHI, WORK( IBAL ), IERR )
00337 *
00338 *     Reduce to upper Hessenberg form
00339 *     (RWorkspace: need 3*N, prefer 2*N+N*NB)
00340 *
00341       ITAU = N + IBAL
00342       IWRK = N + ITAU
00343       CALL DGEHRD( N, ILO, IHI, A, LDA, WORK( ITAU ), WORK( IWRK ),
00344      $             LWORK-IWRK+1, IERR )
00345 *
00346       IF( WANTVS ) THEN
00347 *
00348 *        Copy Householder vectors to VS
00349 *
00350          CALL DLACPY( 'L', N, N, A, LDA, VS, LDVS )
00351 *
00352 *        Generate orthogonal matrix in VS
00353 *        (RWorkspace: need 3*N-1, prefer 2*N+(N-1)*NB)
00354 *
00355          CALL DORGHR( N, ILO, IHI, VS, LDVS, WORK( ITAU ), WORK( IWRK ),
00356      $                LWORK-IWRK+1, IERR )
00357       END IF
00358 *
00359       SDIM = 0
00360 *
00361 *     Perform QR iteration, accumulating Schur vectors in VS if desired
00362 *     (RWorkspace: need N+1, prefer N+HSWORK (see comments) )
00363 *
00364       IWRK = ITAU
00365       CALL DHSEQR( 'S', JOBVS, N, ILO, IHI, A, LDA, WR, WI, VS, LDVS,
00366      $             WORK( IWRK ), LWORK-IWRK+1, IEVAL )
00367       IF( IEVAL.GT.0 )
00368      $   INFO = IEVAL
00369 *
00370 *     Sort eigenvalues if desired
00371 *
00372       IF( WANTST .AND. INFO.EQ.0 ) THEN
00373          IF( SCALEA ) THEN
00374             CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, N, 1, WR, N, IERR )
00375             CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, N, 1, WI, N, IERR )
00376          END IF
00377          DO 10 I = 1, N
00378             BWORK( I ) = SELECT( WR( I ), WI( I ) )
00379    10    CONTINUE
00380 *
00381 *        Reorder eigenvalues, transform Schur vectors, and compute
00382 *        reciprocal condition numbers
00383 *        (RWorkspace: if SENSE is not 'N', need N+2*SDIM*(N-SDIM)
00384 *                     otherwise, need N )
00385 *        (IWorkspace: if SENSE is 'V' or 'B', need SDIM*(N-SDIM)
00386 *                     otherwise, need 0 )
00387 *
00388          CALL DTRSEN( SENSE, JOBVS, BWORK, N, A, LDA, VS, LDVS, WR, WI,
00389      $                SDIM, RCONDE, RCONDV, WORK( IWRK ), LWORK-IWRK+1,
00390      $                IWORK, LIWORK, ICOND )
00391          IF( .NOT.WANTSN )
00392      $      MAXWRK = MAX( MAXWRK, N+2*SDIM*( N-SDIM ) )
00393          IF( ICOND.EQ.-15 ) THEN
00394 *
00395 *           Not enough real workspace
00396 *
00397             INFO = -16
00398          ELSE IF( ICOND.EQ.-17 ) THEN
00399 *
00400 *           Not enough integer workspace
00401 *
00402             INFO = -18
00403          ELSE IF( ICOND.GT.0 ) THEN
00404 *
00405 *           DTRSEN failed to reorder or to restore standard Schur form
00406 *
00407             INFO = ICOND + N
00408          END IF
00409       END IF
00410 *
00411       IF( WANTVS ) THEN
00412 *
00413 *        Undo balancing
00414 *        (RWorkspace: need N)
00415 *
00416          CALL DGEBAK( 'P', 'R', N, ILO, IHI, WORK( IBAL ), N, VS, LDVS,
00417      $                IERR )
00418       END IF
00419 *
00420       IF( SCALEA ) THEN
00421 *
00422 *        Undo scaling for the Schur form of A
00423 *
00424          CALL DLASCL( 'H', 0, 0, CSCALE, ANRM, N, N, A, LDA, IERR )
00425          CALL DCOPY( N, A, LDA+1, WR, 1 )
00426          IF( ( WANTSV .OR. WANTSB ) .AND. INFO.EQ.0 ) THEN
00427             DUM( 1 ) = RCONDV
00428             CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, 1, 1, DUM, 1, IERR )
00429             RCONDV = DUM( 1 )
00430          END IF
00431          IF( CSCALE.EQ.SMLNUM ) THEN
00432 *
00433 *           If scaling back towards underflow, adjust WI if an
00434 *           offdiagonal element of a 2-by-2 block in the Schur form
00435 *           underflows.
00436 *
00437             IF( IEVAL.GT.0 ) THEN
00438                I1 = IEVAL + 1
00439                I2 = IHI - 1
00440                CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, ILO-1, 1, WI, N,
00441      $                      IERR )
00442             ELSE IF( WANTST ) THEN
00443                I1 = 1
00444                I2 = N - 1
00445             ELSE
00446                I1 = ILO
00447                I2 = IHI - 1
00448             END IF
00449             INXT = I1 - 1
00450             DO 20 I = I1, I2
00451                IF( I.LT.INXT )
00452      $            GO TO 20
00453                IF( WI( I ).EQ.ZERO ) THEN
00454                   INXT = I + 1
00455                ELSE
00456                   IF( A( I+1, I ).EQ.ZERO ) THEN
00457                      WI( I ) = ZERO
00458                      WI( I+1 ) = ZERO
00459                   ELSE IF( A( I+1, I ).NE.ZERO .AND. A( I, I+1 ).EQ.
00460      $                     ZERO ) THEN
00461                      WI( I ) = ZERO
00462                      WI( I+1 ) = ZERO
00463                      IF( I.GT.1 )
00464      $                  CALL DSWAP( I-1, A( 1, I ), 1, A( 1, I+1 ), 1 )
00465                      IF( N.GT.I+1 )
00466      $                  CALL DSWAP( N-I-1, A( I, I+2 ), LDA,
00467      $                              A( I+1, I+2 ), LDA )
00468                      CALL DSWAP( N, VS( 1, I ), 1, VS( 1, I+1 ), 1 )
00469                      A( I, I+1 ) = A( I+1, I )
00470                      A( I+1, I ) = ZERO
00471                   END IF
00472                   INXT = I + 2
00473                END IF
00474    20       CONTINUE
00475          END IF
00476          CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, N-IEVAL, 1,
00477      $                WI( IEVAL+1 ), MAX( N-IEVAL, 1 ), IERR )
00478       END IF
00479 *
00480       IF( WANTST .AND. INFO.EQ.0 ) THEN
00481 *
00482 *        Check if reordering successful
00483 *
00484          LASTSL = .TRUE.
00485          LST2SL = .TRUE.
00486          SDIM = 0
00487          IP = 0
00488          DO 30 I = 1, N
00489             CURSL = SELECT( WR( I ), WI( I ) )
00490             IF( WI( I ).EQ.ZERO ) THEN
00491                IF( CURSL )
00492      $            SDIM = SDIM + 1
00493                IP = 0
00494                IF( CURSL .AND. .NOT.LASTSL )
00495      $            INFO = N + 2
00496             ELSE
00497                IF( IP.EQ.1 ) THEN
00498 *
00499 *                 Last eigenvalue of conjugate pair
00500 *
00501                   CURSL = CURSL .OR. LASTSL
00502                   LASTSL = CURSL
00503                   IF( CURSL )
00504      $               SDIM = SDIM + 2
00505                   IP = -1
00506                   IF( CURSL .AND. .NOT.LST2SL )
00507      $               INFO = N + 2
00508                ELSE
00509 *
00510 *                 First eigenvalue of conjugate pair
00511 *
00512                   IP = 1
00513                END IF
00514             END IF
00515             LST2SL = LASTSL
00516             LASTSL = CURSL
00517    30    CONTINUE
00518       END IF
00519 *
00520       WORK( 1 ) = MAXWRK
00521       IF( WANTSV .OR. WANTSB ) THEN
00522          IWORK( 1 ) = MAX( 1, SDIM*( N-SDIM ) )
00523       ELSE
00524          IWORK( 1 ) = 1
00525       END IF
00526 *
00527       RETURN
00528 *
00529 *     End of DGEESX
00530 *
00531       END
 All Files Functions