195 SUBROUTINE zgees( JOBVS, SORT, SELECT, N, A, LDA, SDIM, W, VS,
196 $ LDVS, WORK, LWORK, RWORK, BWORK, INFO )
203 CHARACTER JOBVS, SORT
204 INTEGER INFO, LDA, LDVS, LWORK, N, SDIM
208 DOUBLE PRECISION RWORK( * )
209 COMPLEX*16 A( LDA, * ), VS( LDVS, * ), W( * ), WORK( * )
219 DOUBLE PRECISION ZERO, ONE
220 parameter( zero = 0.0d0, one = 1.0d0 )
223 LOGICAL LQUERY, SCALEA, WANTST, WANTVS
224 INTEGER HSWORK, I, IBAL, ICOND, IERR, IEVAL, IHI, ILO,
225 $ itau, iwrk, maxwrk, minwrk
226 DOUBLE PRECISION ANRM, BIGNUM, CSCALE, EPS, S, SEP, SMLNUM
229 DOUBLE PRECISION DUM( 1 )
238 DOUBLE PRECISION DLAMCH, ZLANGE
239 EXTERNAL lsame, ilaenv, dlamch, zlange
249 lquery = ( lwork.EQ.-1 )
250 wantvs = lsame( jobvs,
'V' )
251 wantst = lsame( sort,
'S' )
252 IF( ( .NOT.wantvs ) .AND. ( .NOT.lsame( jobvs,
'N' ) ) )
THEN
254 ELSE IF( ( .NOT.wantst ) .AND. ( .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,
'ZUNGHR',
291 $
' ', n, 1, n, -1 ) )
292 maxwrk = max( maxwrk, hswork )
297 IF( lwork.LT.minwrk .AND. .NOT.lquery )
THEN
303 CALL xerbla(
'ZGEES ', -info )
305 ELSE IF( lquery )
THEN
319 smlnum = dlamch(
'S' )
320 bignum = one / smlnum
321 smlnum = sqrt( smlnum ) / eps
322 bignum = one / smlnum
326 anrm = zlange(
'M', n, n, a, lda, dum )
328 IF( anrm.GT.zero .AND. anrm.LT.smlnum )
THEN
331 ELSE IF( anrm.GT.bignum )
THEN
336 $
CALL zlascl(
'G', 0, 0, anrm, cscale, n, n, a, lda, ierr )
343 CALL zgebal(
'P', n, a, lda, ilo, ihi, rwork( ibal ), ierr )
351 CALL zgehrd( n, ilo, ihi, a, lda, work( itau ), work( iwrk ),
352 $ lwork-iwrk+1, ierr )
358 CALL zlacpy(
'L', n, n, a, lda, vs, ldvs )
364 CALL zunghr( n, ilo, ihi, vs, ldvs, work( itau ), work( iwrk ),
365 $ lwork-iwrk+1, ierr )
375 CALL zhseqr(
'S', jobvs, n, ilo, ihi, a, lda, w, vs, ldvs,
376 $ work( iwrk ), lwork-iwrk+1, ieval )
382 IF( wantst .AND. info.EQ.0 )
THEN
384 $
CALL zlascl(
'G', 0, 0, cscale, anrm, n, 1, w, n, ierr )
386 bwork( i ) =
SELECT( w( i ) )
393 CALL ztrsen(
'N', jobvs, bwork, n, a, lda, vs, ldvs, w, sdim,
394 $ s, sep, work( iwrk ), lwork-iwrk+1, icond )
403 CALL zgebak(
'P',
'R', n, ilo, ihi, rwork( ibal ), n, vs, ldvs,
411 CALL zlascl(
'U', 0, 0, cscale, anrm, n, n, a, lda, ierr )
412 CALL zcopy( n, a, lda+1, w, 1 )
subroutine xerbla(srname, info)
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine zgebak(job, side, n, ilo, ihi, scale, m, v, ldv, info)
ZGEBAK
subroutine zgebal(job, n, a, lda, ilo, ihi, scale, info)
ZGEBAL
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...
subroutine zgehrd(n, ilo, ihi, a, lda, tau, work, lwork, info)
ZGEHRD
subroutine zhseqr(job, compz, n, ilo, ihi, h, ldh, w, z, ldz, work, lwork, info)
ZHSEQR
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zlascl(type, kl, ku, cfrom, cto, m, n, a, lda, info)
ZLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine ztrsen(job, compq, select, n, t, ldt, q, ldq, w, m, s, sep, work, lwork, info)
ZTRSEN
subroutine zunghr(n, ilo, ihi, a, lda, tau, work, lwork, info)
ZUNGHR