314 SUBROUTINE dhseqr( JOB, COMPZ, N, ILO, IHI, H, LDH, WR, WI, Z,
315 $ LDZ, WORK, LWORK, INFO )
322 INTEGER IHI, ILO, INFO, LDH, LDZ, LWORK, N
326 DOUBLE PRECISION H( LDH, * ), WI( * ), WORK( * ), WR( * ),
338 parameter( ntiny = 15 )
348 DOUBLE PRECISION ZERO, ONE
349 parameter( zero = 0.0d0, one = 1.0d0 )
352 DOUBLE PRECISION HL( NL, NL ), WORKL( NL )
355 INTEGER I, KBOT, NMIN
356 LOGICAL INITZ, LQUERY, WANTT, WANTZ
361 EXTERNAL ilaenv, lsame
367 INTRINSIC dble, max, min
373 wantt = lsame( job,
'S' )
374 initz = lsame( compz,
'I' )
375 wantz = initz .OR. lsame( compz,
'V' )
376 work( 1 ) = dble( max( 1, n ) )
380 IF( .NOT.lsame( job,
'E' ) .AND. .NOT.wantt )
THEN
382 ELSE IF( .NOT.lsame( compz,
'N' ) .AND. .NOT.wantz )
THEN
384 ELSE IF( n.LT.0 )
THEN
386 ELSE IF( ilo.LT.1 .OR. ilo.GT.max( 1, n ) )
THEN
388 ELSE IF( ihi.LT.min( ilo, n ) .OR. ihi.GT.n )
THEN
390 ELSE IF( ldh.LT.max( 1, n ) )
THEN
392 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.max( 1, n ) ) )
THEN
394 ELSE IF( lwork.LT.max( 1, n ) .AND. .NOT.lquery )
THEN
402 CALL xerbla(
'DHSEQR', -info )
405 ELSE IF( n.EQ.0 )
THEN
411 ELSE IF( lquery )
THEN
415 CALL dlaqr0( wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, ilo,
416 $ ihi, z, ldz, work, lwork, info )
419 work( 1 ) = max( dble( max( 1, n ) ), work( 1 ) )
438 $
CALL dlaset(
'A', n, n, zero, one, z, ldz )
442 IF( ilo.EQ.ihi )
THEN
443 wr( ilo ) = h( ilo, ilo )
450 nmin = ilaenv( 12,
'DHSEQR', job( : 1 ) // compz( : 1 ), n,
452 nmin = max( ntiny, nmin )
457 CALL dlaqr0( wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, ilo,
458 $ ihi, z, ldz, work, lwork, info )
463 CALL dlahqr( wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, ilo,
464 $ ihi, z, ldz, info )
478 CALL dlaqr0( wantt, wantz, n, ilo, kbot, h, ldh, wr,
479 $ wi, ilo, ihi, z, ldz, work, lwork, info )
488 CALL dlacpy(
'A', n, n, h, ldh, hl, nl )
490 CALL dlaset(
'A', nl, nl-n, zero, zero, hl( 1, n+1 ),
492 CALL dlaqr0( wantt, wantz, nl, ilo, kbot, hl, nl, wr,
493 $ wi, ilo, ihi, z, ldz, workl, nl, info )
494 IF( wantt .OR. info.NE.0 )
495 $
CALL dlacpy(
'A', n, n, hl, nl, h, ldh )
502 IF( ( wantt .OR. info.NE.0 ) .AND. n.GT.2 )
503 $
CALL dlaset(
'L', n-2, n-2, zero, zero, h( 3, 1 ), ldh )
508 work( 1 ) = max( dble( max( 1, n ) ), work( 1 ) )
subroutine xerbla(srname, info)
subroutine dhseqr(job, compz, n, ilo, ihi, h, ldh, wr, wi, z, ldz, work, lwork, info)
DHSEQR
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
subroutine dlahqr(wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, iloz, ihiz, z, ldz, info)
DLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix,...
subroutine dlaqr0(wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, iloz, ihiz, z, ldz, work, lwork, info)
DLAQR0 computes the eigenvalues of a Hessenberg matrix, and optionally the matrices from the Schur de...
subroutine dlaset(uplo, m, n, alpha, beta, a, lda)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.