001:       SUBROUTINE DGEESX( JOBVS, SORT, SELECT, SENSE, N, A, LDA, SDIM,
002:      $                   WR, WI, VS, LDVS, RCONDE, RCONDV, WORK, LWORK,
003:      $                   IWORK, LIWORK, BWORK, INFO )
004: *
005: *  -- LAPACK driver routine (version 3.2) --
006: *     Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
007: *     November 2006
008: *
009: *     .. Scalar Arguments ..
010:       CHARACTER          JOBVS, SENSE, SORT
011:       INTEGER            INFO, LDA, LDVS, LIWORK, LWORK, N, SDIM
012:       DOUBLE PRECISION   RCONDE, RCONDV
013: *     ..
014: *     .. Array Arguments ..
015:       LOGICAL            BWORK( * )
016:       INTEGER            IWORK( * )
017:       DOUBLE PRECISION   A( LDA, * ), VS( LDVS, * ), WI( * ), WORK( * ),
018:      $                   WR( * )
019: *     ..
020: *     .. Function Arguments ..
021:       LOGICAL            SELECT
022:       EXTERNAL           SELECT
023: *     ..
024: *
025: *  Purpose
026: *  =======
027: *
028: *  DGEESX computes for an N-by-N real nonsymmetric matrix A, the
029: *  eigenvalues, the real Schur form T, and, optionally, the matrix of
030: *  Schur vectors Z.  This gives the Schur factorization A = Z*T*(Z**T).
031: *
032: *  Optionally, it also orders the eigenvalues on the diagonal of the
033: *  real Schur form so that selected eigenvalues are at the top left;
034: *  computes a reciprocal condition number for the average of the
035: *  selected eigenvalues (RCONDE); and computes a reciprocal condition
036: *  number for the right invariant subspace corresponding to the
037: *  selected eigenvalues (RCONDV).  The leading columns of Z form an
038: *  orthonormal basis for this invariant subspace.
039: *
040: *  For further explanation of the reciprocal condition numbers RCONDE
041: *  and RCONDV, see Section 4.10 of the LAPACK Users' Guide (where
042: *  these quantities are called s and sep respectively).
043: *
044: *  A real matrix is in real Schur form if it is upper quasi-triangular
045: *  with 1-by-1 and 2-by-2 blocks. 2-by-2 blocks will be standardized in
046: *  the form
047: *            [  a  b  ]
048: *            [  c  a  ]
049: *
050: *  where b*c < 0. The eigenvalues of such a block are a +- sqrt(bc).
051: *
052: *  Arguments
053: *  =========
054: *
055: *  JOBVS   (input) CHARACTER*1
056: *          = 'N': Schur vectors are not computed;
057: *          = 'V': Schur vectors are computed.
058: *
059: *  SORT    (input) CHARACTER*1
060: *          Specifies whether or not to order the eigenvalues on the
061: *          diagonal of the Schur form.
062: *          = 'N': Eigenvalues are not ordered;
063: *          = 'S': Eigenvalues are ordered (see SELECT).
064: *
065: *  SELECT  (external procedure) LOGICAL FUNCTION of two DOUBLE PRECISION arguments
066: *          SELECT must be declared EXTERNAL in the calling subroutine.
067: *          If SORT = 'S', SELECT is used to select eigenvalues to sort
068: *          to the top left of the Schur form.
069: *          If SORT = 'N', SELECT is not referenced.
070: *          An eigenvalue WR(j)+sqrt(-1)*WI(j) is selected if
071: *          SELECT(WR(j),WI(j)) is true; i.e., if either one of a
072: *          complex conjugate pair of eigenvalues is selected, then both
073: *          are.  Note that a selected complex eigenvalue may no longer
074: *          satisfy SELECT(WR(j),WI(j)) = .TRUE. after ordering, since
075: *          ordering may change the value of complex eigenvalues
076: *          (especially if the eigenvalue is ill-conditioned); in this
077: *          case INFO may be set to N+3 (see INFO below).
078: *
079: *  SENSE   (input) CHARACTER*1
080: *          Determines which reciprocal condition numbers are computed.
081: *          = 'N': None are computed;
082: *          = 'E': Computed for average of selected eigenvalues only;
083: *          = 'V': Computed for selected right invariant subspace only;
084: *          = 'B': Computed for both.
085: *          If SENSE = 'E', 'V' or 'B', SORT must equal 'S'.
086: *
087: *  N       (input) INTEGER
088: *          The order of the matrix A. N >= 0.
089: *
090: *  A       (input/output) DOUBLE PRECISION array, dimension (LDA, N)
091: *          On entry, the N-by-N matrix A.
092: *          On exit, A is overwritten by its real Schur form T.
093: *
094: *  LDA     (input) INTEGER
095: *          The leading dimension of the array A.  LDA >= max(1,N).
096: *
097: *  SDIM    (output) INTEGER
098: *          If SORT = 'N', SDIM = 0.
099: *          If SORT = 'S', SDIM = number of eigenvalues (after sorting)
100: *                         for which SELECT is true. (Complex conjugate
101: *                         pairs for which SELECT is true for either
102: *                         eigenvalue count as 2.)
103: *
104: *  WR      (output) DOUBLE PRECISION array, dimension (N)
105: *  WI      (output) DOUBLE PRECISION array, dimension (N)
106: *          WR and WI contain the real and imaginary parts, respectively,
107: *          of the computed eigenvalues, in the same order that they
108: *          appear on the diagonal of the output Schur form T.  Complex
109: *          conjugate pairs of eigenvalues appear consecutively with the
110: *          eigenvalue having the positive imaginary part first.
111: *
112: *  VS      (output) DOUBLE PRECISION array, dimension (LDVS,N)
113: *          If JOBVS = 'V', VS contains the orthogonal matrix Z of Schur
114: *          vectors.
115: *          If JOBVS = 'N', VS is not referenced.
116: *
117: *  LDVS    (input) INTEGER
118: *          The leading dimension of the array VS.  LDVS >= 1, and if
119: *          JOBVS = 'V', LDVS >= N.
120: *
121: *  RCONDE  (output) DOUBLE PRECISION
122: *          If SENSE = 'E' or 'B', RCONDE contains the reciprocal
123: *          condition number for the average of the selected eigenvalues.
124: *          Not referenced if SENSE = 'N' or 'V'.
125: *
126: *  RCONDV  (output) DOUBLE PRECISION
127: *          If SENSE = 'V' or 'B', RCONDV contains the reciprocal
128: *          condition number for the selected right invariant subspace.
129: *          Not referenced if SENSE = 'N' or 'E'.
130: *
131: *  WORK    (workspace/output) DOUBLE PRECISION array, dimension (MAX(1,LWORK))
132: *          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
133: *
134: *  LWORK   (input) INTEGER
135: *          The dimension of the array WORK.  LWORK >= max(1,3*N).
136: *          Also, if SENSE = 'E' or 'V' or 'B',
137: *          LWORK >= N+2*SDIM*(N-SDIM), where SDIM is the number of
138: *          selected eigenvalues computed by this routine.  Note that
139: *          N+2*SDIM*(N-SDIM) <= N+N*N/2. Note also that an error is only
140: *          returned if LWORK < max(1,3*N), but if SENSE = 'E' or 'V' or
141: *          'B' this may not be large enough.
142: *          For good performance, LWORK must generally be larger.
143: *
144: *          If LWORK = -1, then a workspace query is assumed; the routine
145: *          only calculates upper bounds on the optimal sizes of the
146: *          arrays WORK and IWORK, returns these values as the first
147: *          entries of the WORK and IWORK arrays, and no error messages
148: *          related to LWORK or LIWORK are issued by XERBLA.
149: *
150: *  IWORK   (workspace/output) INTEGER array, dimension (MAX(1,LIWORK))
151: *          On exit, if INFO = 0, IWORK(1) returns the optimal LIWORK.
152: *
153: *  LIWORK  (input) INTEGER
154: *          The dimension of the array IWORK.
155: *          LIWORK >= 1; if SENSE = 'V' or 'B', LIWORK >= SDIM*(N-SDIM).
156: *          Note that SDIM*(N-SDIM) <= N*N/4. Note also that an error is
157: *          only returned if LIWORK < 1, but if SENSE = 'V' or 'B' this
158: *          may not be large enough.
159: *
160: *          If LIWORK = -1, then a workspace query is assumed; the
161: *          routine only calculates upper bounds on the optimal sizes of
162: *          the arrays WORK and IWORK, returns these values as the first
163: *          entries of the WORK and IWORK arrays, and no error messages
164: *          related to LWORK or LIWORK are issued by XERBLA.
165: *
166: *  BWORK   (workspace) LOGICAL array, dimension (N)
167: *          Not referenced if SORT = 'N'.
168: *
169: *  INFO    (output) INTEGER
170: *          = 0: successful exit
171: *          < 0: if INFO = -i, the i-th argument had an illegal value.
172: *          > 0: if INFO = i, and i is
173: *             <= N: the QR algorithm failed to compute all the
174: *                   eigenvalues; elements 1:ILO-1 and i+1:N of WR and WI
175: *                   contain those eigenvalues which have converged; if
176: *                   JOBVS = 'V', VS contains the transformation which
177: *                   reduces A to its partially converged Schur form.
178: *             = N+1: the eigenvalues could not be reordered because some
179: *                   eigenvalues were too close to separate (the problem
180: *                   is very ill-conditioned);
181: *             = N+2: after reordering, roundoff changed values of some
182: *                   complex eigenvalues so that leading eigenvalues in
183: *                   the Schur form no longer satisfy SELECT=.TRUE.  This
184: *                   could also be caused by underflow due to scaling.
185: *
186: *  =====================================================================
187: *
188: *     .. Parameters ..
189:       DOUBLE PRECISION   ZERO, ONE
190:       PARAMETER          ( ZERO = 0.0D0, ONE = 1.0D0 )
191: *     ..
192: *     .. Local Scalars ..
193:       LOGICAL            CURSL, LASTSL, LQUERY, LST2SL, SCALEA, WANTSB,
194:      $                   WANTSE, WANTSN, WANTST, WANTSV, WANTVS
195:       INTEGER            HSWORK, I, I1, I2, IBAL, ICOND, IERR, IEVAL,
196:      $                   IHI, ILO, INXT, IP, ITAU, IWRK, LIWRK, LWRK,
197:      $                   MAXWRK, MINWRK
198:       DOUBLE PRECISION   ANRM, BIGNUM, CSCALE, EPS, SMLNUM
199: *     ..
200: *     .. Local Arrays ..
201:       DOUBLE PRECISION   DUM( 1 )
202: *     ..
203: *     .. External Subroutines ..
204:       EXTERNAL           DCOPY, DGEBAK, DGEBAL, DGEHRD, DHSEQR, DLACPY,
205:      $                   DLASCL, DORGHR, DSWAP, DTRSEN, XERBLA
206: *     ..
207: *     .. External Functions ..
208:       LOGICAL            LSAME
209:       INTEGER            ILAENV
210:       DOUBLE PRECISION   DLAMCH, DLANGE
211:       EXTERNAL           LSAME, ILAENV, DLABAD, DLAMCH, DLANGE
212: *     ..
213: *     .. Intrinsic Functions ..
214:       INTRINSIC          MAX, SQRT
215: *     ..
216: *     .. Executable Statements ..
217: *
218: *     Test the input arguments
219: *
220:       INFO = 0
221:       WANTVS = LSAME( JOBVS, 'V' )
222:       WANTST = LSAME( SORT, 'S' )
223:       WANTSN = LSAME( SENSE, 'N' )
224:       WANTSE = LSAME( SENSE, 'E' )
225:       WANTSV = LSAME( SENSE, 'V' )
226:       WANTSB = LSAME( SENSE, 'B' )
227:       LQUERY = ( LWORK.EQ.-1 .OR. LIWORK.EQ.-1 )
228:       IF( ( .NOT.WANTVS ) .AND. ( .NOT.LSAME( JOBVS, 'N' ) ) ) THEN
229:          INFO = -1
230:       ELSE IF( ( .NOT.WANTST ) .AND. ( .NOT.LSAME( SORT, 'N' ) ) ) THEN
231:          INFO = -2
232:       ELSE IF( .NOT.( WANTSN .OR. WANTSE .OR. WANTSV .OR. WANTSB ) .OR.
233:      $         ( .NOT.WANTST .AND. .NOT.WANTSN ) ) THEN
234:          INFO = -4
235:       ELSE IF( N.LT.0 ) THEN
236:          INFO = -5
237:       ELSE IF( LDA.LT.MAX( 1, N ) ) THEN
238:          INFO = -7
239:       ELSE IF( LDVS.LT.1 .OR. ( WANTVS .AND. LDVS.LT.N ) ) THEN
240:          INFO = -12
241:       END IF
242: *
243: *     Compute workspace
244: *      (Note: Comments in the code beginning "RWorkspace:" describe the
245: *       minimal amount of real workspace needed at that point in the
246: *       code, as well as the preferred amount for good performance.
247: *       IWorkspace refers to integer workspace.
248: *       NB refers to the optimal block size for the immediately
249: *       following subroutine, as returned by ILAENV.
250: *       HSWORK refers to the workspace preferred by DHSEQR, as
251: *       calculated below. HSWORK is computed assuming ILO=1 and IHI=N,
252: *       the worst case.
253: *       If SENSE = 'E', 'V' or 'B', then the amount of workspace needed
254: *       depends on SDIM, which is computed by the routine DTRSEN later
255: *       in the code.)
256: *
257:       IF( INFO.EQ.0 ) THEN
258:          LIWRK = 1
259:          IF( N.EQ.0 ) THEN
260:             MINWRK = 1
261:             LWRK = 1
262:          ELSE
263:             MAXWRK = 2*N + N*ILAENV( 1, 'DGEHRD', ' ', N, 1, N, 0 )
264:             MINWRK = 3*N
265: *
266:             CALL DHSEQR( 'S', JOBVS, N, 1, N, A, LDA, WR, WI, VS, LDVS,
267:      $             WORK, -1, IEVAL )
268:             HSWORK = WORK( 1 )
269: *
270:             IF( .NOT.WANTVS ) THEN
271:                MAXWRK = MAX( MAXWRK, N + HSWORK )
272:             ELSE
273:                MAXWRK = MAX( MAXWRK, 2*N + ( N - 1 )*ILAENV( 1,
274:      $                       'DORGHR', ' ', N, 1, N, -1 ) )
275:                MAXWRK = MAX( MAXWRK, N + HSWORK )
276:             END IF
277:             LWRK = MAXWRK
278:             IF( .NOT.WANTSN )
279:      $         LWRK = MAX( LWRK, N + ( N*N )/2 )
280:             IF( WANTSV .OR. WANTSB )
281:      $         LIWRK = ( N*N )/4
282:          END IF
283:          IWORK( 1 ) = LIWRK
284:          WORK( 1 ) = LWRK
285: *
286:          IF( LWORK.LT.MINWRK .AND. .NOT.LQUERY ) THEN
287:             INFO = -16
288:          ELSE IF( LIWORK.LT.1 .AND. .NOT.LQUERY ) THEN
289:             INFO = -18
290:          END IF
291:       END IF
292: *
293:       IF( INFO.NE.0 ) THEN
294:          CALL XERBLA( 'DGEESX', -INFO )
295:          RETURN
296:       END IF
297: *
298: *     Quick return if possible
299: *
300:       IF( N.EQ.0 ) THEN
301:          SDIM = 0
302:          RETURN
303:       END IF
304: *
305: *     Get machine constants
306: *
307:       EPS = DLAMCH( 'P' )
308:       SMLNUM = DLAMCH( 'S' )
309:       BIGNUM = ONE / SMLNUM
310:       CALL DLABAD( SMLNUM, BIGNUM )
311:       SMLNUM = SQRT( SMLNUM ) / EPS
312:       BIGNUM = ONE / SMLNUM
313: *
314: *     Scale A if max element outside range [SMLNUM,BIGNUM]
315: *
316:       ANRM = DLANGE( 'M', N, N, A, LDA, DUM )
317:       SCALEA = .FALSE.
318:       IF( ANRM.GT.ZERO .AND. ANRM.LT.SMLNUM ) THEN
319:          SCALEA = .TRUE.
320:          CSCALE = SMLNUM
321:       ELSE IF( ANRM.GT.BIGNUM ) THEN
322:          SCALEA = .TRUE.
323:          CSCALE = BIGNUM
324:       END IF
325:       IF( SCALEA )
326:      $   CALL DLASCL( 'G', 0, 0, ANRM, CSCALE, N, N, A, LDA, IERR )
327: *
328: *     Permute the matrix to make it more nearly triangular
329: *     (RWorkspace: need N)
330: *
331:       IBAL = 1
332:       CALL DGEBAL( 'P', N, A, LDA, ILO, IHI, WORK( IBAL ), IERR )
333: *
334: *     Reduce to upper Hessenberg form
335: *     (RWorkspace: need 3*N, prefer 2*N+N*NB)
336: *
337:       ITAU = N + IBAL
338:       IWRK = N + ITAU
339:       CALL DGEHRD( N, ILO, IHI, A, LDA, WORK( ITAU ), WORK( IWRK ),
340:      $             LWORK-IWRK+1, IERR )
341: *
342:       IF( WANTVS ) THEN
343: *
344: *        Copy Householder vectors to VS
345: *
346:          CALL DLACPY( 'L', N, N, A, LDA, VS, LDVS )
347: *
348: *        Generate orthogonal matrix in VS
349: *        (RWorkspace: need 3*N-1, prefer 2*N+(N-1)*NB)
350: *
351:          CALL DORGHR( N, ILO, IHI, VS, LDVS, WORK( ITAU ), WORK( IWRK ),
352:      $                LWORK-IWRK+1, IERR )
353:       END IF
354: *
355:       SDIM = 0
356: *
357: *     Perform QR iteration, accumulating Schur vectors in VS if desired
358: *     (RWorkspace: need N+1, prefer N+HSWORK (see comments) )
359: *
360:       IWRK = ITAU
361:       CALL DHSEQR( 'S', JOBVS, N, ILO, IHI, A, LDA, WR, WI, VS, LDVS,
362:      $             WORK( IWRK ), LWORK-IWRK+1, IEVAL )
363:       IF( IEVAL.GT.0 )
364:      $   INFO = IEVAL
365: *
366: *     Sort eigenvalues if desired
367: *
368:       IF( WANTST .AND. INFO.EQ.0 ) THEN
369:          IF( SCALEA ) THEN
370:             CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, N, 1, WR, N, IERR )
371:             CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, N, 1, WI, N, IERR )
372:          END IF
373:          DO 10 I = 1, N
374:             BWORK( I ) = SELECT( WR( I ), WI( I ) )
375:    10    CONTINUE
376: *
377: *        Reorder eigenvalues, transform Schur vectors, and compute
378: *        reciprocal condition numbers
379: *        (RWorkspace: if SENSE is not 'N', need N+2*SDIM*(N-SDIM)
380: *                     otherwise, need N )
381: *        (IWorkspace: if SENSE is 'V' or 'B', need SDIM*(N-SDIM)
382: *                     otherwise, need 0 )
383: *
384:          CALL DTRSEN( SENSE, JOBVS, BWORK, N, A, LDA, VS, LDVS, WR, WI,
385:      $                SDIM, RCONDE, RCONDV, WORK( IWRK ), LWORK-IWRK+1,
386:      $                IWORK, LIWORK, ICOND )
387:          IF( .NOT.WANTSN )
388:      $      MAXWRK = MAX( MAXWRK, N+2*SDIM*( N-SDIM ) )
389:          IF( ICOND.EQ.-15 ) THEN
390: *
391: *           Not enough real workspace
392: *
393:             INFO = -16
394:          ELSE IF( ICOND.EQ.-17 ) THEN
395: *
396: *           Not enough integer workspace
397: *
398:             INFO = -18
399:          ELSE IF( ICOND.GT.0 ) THEN
400: *
401: *           DTRSEN failed to reorder or to restore standard Schur form
402: *
403:             INFO = ICOND + N
404:          END IF
405:       END IF
406: *
407:       IF( WANTVS ) THEN
408: *
409: *        Undo balancing
410: *        (RWorkspace: need N)
411: *
412:          CALL DGEBAK( 'P', 'R', N, ILO, IHI, WORK( IBAL ), N, VS, LDVS,
413:      $                IERR )
414:       END IF
415: *
416:       IF( SCALEA ) THEN
417: *
418: *        Undo scaling for the Schur form of A
419: *
420:          CALL DLASCL( 'H', 0, 0, CSCALE, ANRM, N, N, A, LDA, IERR )
421:          CALL DCOPY( N, A, LDA+1, WR, 1 )
422:          IF( ( WANTSV .OR. WANTSB ) .AND. INFO.EQ.0 ) THEN
423:             DUM( 1 ) = RCONDV
424:             CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, 1, 1, DUM, 1, IERR )
425:             RCONDV = DUM( 1 )
426:          END IF
427:          IF( CSCALE.EQ.SMLNUM ) THEN
428: *
429: *           If scaling back towards underflow, adjust WI if an
430: *           offdiagonal element of a 2-by-2 block in the Schur form
431: *           underflows.
432: *
433:             IF( IEVAL.GT.0 ) THEN
434:                I1 = IEVAL + 1
435:                I2 = IHI - 1
436:                CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, ILO-1, 1, WI, N,
437:      $                      IERR )
438:             ELSE IF( WANTST ) THEN
439:                I1 = 1
440:                I2 = N - 1
441:             ELSE
442:                I1 = ILO
443:                I2 = IHI - 1
444:             END IF
445:             INXT = I1 - 1
446:             DO 20 I = I1, I2
447:                IF( I.LT.INXT )
448:      $            GO TO 20
449:                IF( WI( I ).EQ.ZERO ) THEN
450:                   INXT = I + 1
451:                ELSE
452:                   IF( A( I+1, I ).EQ.ZERO ) THEN
453:                      WI( I ) = ZERO
454:                      WI( I+1 ) = ZERO
455:                   ELSE IF( A( I+1, I ).NE.ZERO .AND. A( I, I+1 ).EQ.
456:      $                     ZERO ) THEN
457:                      WI( I ) = ZERO
458:                      WI( I+1 ) = ZERO
459:                      IF( I.GT.1 )
460:      $                  CALL DSWAP( I-1, A( 1, I ), 1, A( 1, I+1 ), 1 )
461:                      IF( N.GT.I+1 )
462:      $                  CALL DSWAP( N-I-1, A( I, I+2 ), LDA,
463:      $                              A( I+1, I+2 ), LDA )
464:                      CALL DSWAP( N, VS( 1, I ), 1, VS( 1, I+1 ), 1 )
465:                      A( I, I+1 ) = A( I+1, I )
466:                      A( I+1, I ) = ZERO
467:                   END IF
468:                   INXT = I + 2
469:                END IF
470:    20       CONTINUE
471:          END IF
472:          CALL DLASCL( 'G', 0, 0, CSCALE, ANRM, N-IEVAL, 1,
473:      $                WI( IEVAL+1 ), MAX( N-IEVAL, 1 ), IERR )
474:       END IF
475: *
476:       IF( WANTST .AND. INFO.EQ.0 ) THEN
477: *
478: *        Check if reordering successful
479: *
480:          LASTSL = .TRUE.
481:          LST2SL = .TRUE.
482:          SDIM = 0
483:          IP = 0
484:          DO 30 I = 1, N
485:             CURSL = SELECT( WR( I ), WI( I ) )
486:             IF( WI( I ).EQ.ZERO ) THEN
487:                IF( CURSL )
488:      $            SDIM = SDIM + 1
489:                IP = 0
490:                IF( CURSL .AND. .NOT.LASTSL )
491:      $            INFO = N + 2
492:             ELSE
493:                IF( IP.EQ.1 ) THEN
494: *
495: *                 Last eigenvalue of conjugate pair
496: *
497:                   CURSL = CURSL .OR. LASTSL
498:                   LASTSL = CURSL
499:                   IF( CURSL )
500:      $               SDIM = SDIM + 2
501:                   IP = -1
502:                   IF( CURSL .AND. .NOT.LST2SL )
503:      $               INFO = N + 2
504:                ELSE
505: *
506: *                 First eigenvalue of conjugate pair
507: *
508:                   IP = 1
509:                END IF
510:             END IF
511:             LST2SL = LASTSL
512:             LASTSL = CURSL
513:    30    CONTINUE
514:       END IF
515: *
516:       WORK( 1 ) = MAXWRK
517:       IF( WANTSV .OR. WANTSB ) THEN
518:          IWORK( 1 ) = MAX( 1, SDIM*( N-SDIM ) )
519:       ELSE
520:          IWORK( 1 ) = 1
521:       END IF
522: *
523:       RETURN
524: *
525: *     End of DGEESX
526: *
527:       END
528: