193 SUBROUTINE zgees( JOBVS, SORT, SELECT, N, A, LDA, SDIM, W, VS,
194 $ LDVS, WORK, LWORK, RWORK, BWORK, INFO )
201 CHARACTER JOBVS, SORT
202 INTEGER INFO, LDA, LDVS, LWORK, N, SDIM
206 DOUBLE PRECISION RWORK( * )
207 COMPLEX*16 A( LDA, * ), VS( LDVS, * ), W( * ), WORK( * )
217 DOUBLE PRECISION ZERO, ONE
218 parameter( zero = 0.0d0, one = 1.0d0 )
221 LOGICAL LQUERY, SCALEA, WANTST, WANTVS
222 INTEGER HSWORK, I, IBAL, ICOND, IERR, IEVAL, IHI, ILO,
223 $ itau, iwrk, maxwrk, minwrk
224 DOUBLE PRECISION ANRM, BIGNUM, CSCALE, EPS, S, SEP, SMLNUM
227 DOUBLE PRECISION DUM( 1 )
237 DOUBLE PRECISION DLAMCH, ZLANGE
238 EXTERNAL lsame, ilaenv, dlamch, zlange
248 lquery = ( lwork.EQ.-1 )
249 wantvs = lsame( jobvs,
'V' )
250 wantst = lsame( sort,
'S' )
251 IF( ( .NOT.wantvs ) .AND. ( .NOT.lsame( jobvs,
'N' ) ) )
THEN
253 ELSE IF( ( .NOT.wantst ) .AND.
254 $ ( .NOT.lsame( sort,
'N' ) ) )
THEN
256 ELSE IF( n.LT.0 )
THEN
258 ELSE IF( lda.LT.max( 1, n ) )
THEN
260 ELSE IF( ldvs.LT.1 .OR. ( wantvs .AND. ldvs.LT.n ) )
THEN
280 maxwrk = n + n*ilaenv( 1,
'ZGEHRD',
' ', n, 1, n, 0 )
283 CALL zhseqr(
'S', jobvs, n, 1, n, a, lda, w, vs, ldvs,
285 hswork = int( work( 1 ) )
287 IF( .NOT.wantvs )
THEN
288 maxwrk = max( maxwrk, hswork )
290 maxwrk = max( maxwrk, n + ( n - 1 )*ilaenv( 1,
292 $
' ', n, 1, n, -1 ) )
293 maxwrk = max( maxwrk, hswork )
298 IF( lwork.LT.minwrk .AND. .NOT.lquery )
THEN
304 CALL xerbla(
'ZGEES ', -info )
306 ELSE IF( lquery )
THEN
320 smlnum = dlamch(
'S' )
321 bignum = one / smlnum
322 smlnum = sqrt( smlnum ) / eps
323 bignum = one / smlnum
327 anrm = zlange(
'M', n, n, a, lda, dum )
329 IF( anrm.GT.zero .AND. anrm.LT.smlnum )
THEN
332 ELSE IF( anrm.GT.bignum )
THEN
337 $
CALL zlascl(
'G', 0, 0, anrm, cscale, n, n, a, lda, ierr )
344 CALL zgebal(
'P', n, a, lda, ilo, ihi, rwork( ibal ), ierr )
352 CALL zgehrd( n, ilo, ihi, a, lda, work( itau ), work( iwrk ),
353 $ lwork-iwrk+1, ierr )
359 CALL zlacpy(
'L', n, n, a, lda, vs, ldvs )
365 CALL zunghr( n, ilo, ihi, vs, ldvs, work( itau ),
367 $ lwork-iwrk+1, ierr )
377 CALL zhseqr(
'S', jobvs, n, ilo, ihi, a, lda, w, vs, ldvs,
378 $ work( iwrk ), lwork-iwrk+1, ieval )
384 IF( wantst .AND. info.EQ.0 )
THEN
386 $
CALL zlascl(
'G', 0, 0, cscale, anrm, n, 1, w, n, ierr )
388 bwork( i ) =
SELECT( w( i ) )
395 CALL ztrsen(
'N', jobvs, bwork, n, a, lda, vs, ldvs, w,
397 $ s, sep, work( iwrk ), lwork-iwrk+1, icond )
406 CALL zgebak(
'P',
'R', n, ilo, ihi, rwork( ibal ), n, vs,
415 CALL zlascl(
'U', 0, 0, cscale, anrm, n, n, a, lda, ierr )
416 CALL zcopy( n, a, lda+1, w, 1 )
subroutine zgees(jobvs, sort, select, n, a, lda, sdim, w, vs, ldvs, work, lwork, rwork, bwork, info)
ZGEES computes the eigenvalues, the Schur form, and, optionally, the matrix of Schur vectors for GE m...