312 SUBROUTINE dhseqr( JOB, COMPZ, N, ILO, IHI, H, LDH, WR, WI, Z,
313 $ LDZ, WORK, LWORK, INFO )
320 INTEGER IHI, ILO, INFO, LDH, LDZ, LWORK, N
324 DOUBLE PRECISION H( LDH, * ), WI( * ), WORK( * ), WR( * ),
336 parameter( ntiny = 15 )
346 DOUBLE PRECISION ZERO, ONE
347 parameter( zero = 0.0d0, one = 1.0d0 )
350 DOUBLE PRECISION HL( NL, NL ), WORKL( NL )
353 INTEGER I, KBOT, NMIN
354 LOGICAL INITZ, LQUERY, WANTT, WANTZ
359 EXTERNAL ilaenv, lsame
366 INTRINSIC dble, max, min
372 wantt = lsame( job,
'S' )
373 initz = lsame( compz,
'I' )
374 wantz = initz .OR. lsame( compz,
'V' )
375 work( 1 ) = dble( max( 1, n ) )
379 IF( .NOT.lsame( job,
'E' ) .AND. .NOT.wantt )
THEN
381 ELSE IF( .NOT.lsame( compz,
'N' ) .AND. .NOT.wantz )
THEN
383 ELSE IF( n.LT.0 )
THEN
385 ELSE IF( ilo.LT.1 .OR. ilo.GT.max( 1, n ) )
THEN
387 ELSE IF( ihi.LT.min( ilo, n ) .OR. ihi.GT.n )
THEN
389 ELSE IF( ldh.LT.max( 1, n ) )
THEN
391 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.max( 1, n ) ) )
THEN
393 ELSE IF( lwork.LT.max( 1, n ) .AND. .NOT.lquery )
THEN
401 CALL xerbla(
'DHSEQR', -info )
404 ELSE IF( n.EQ.0 )
THEN
410 ELSE IF( lquery )
THEN
414 CALL dlaqr0( wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, ilo,
415 $ ihi, z, ldz, work, lwork, info )
418 work( 1 ) = max( dble( max( 1, n ) ), work( 1 ) )
437 $
CALL dlaset(
'A', n, n, zero, one, z, ldz )
441 IF( ilo.EQ.ihi )
THEN
442 wr( ilo ) = h( ilo, ilo )
449 nmin = ilaenv( 12,
'DHSEQR', job( : 1 ) // compz( : 1 ), n,
451 nmin = max( ntiny, nmin )
456 CALL dlaqr0( wantt, wantz, n, ilo, ihi, h, ldh, wr, wi,
458 $ ihi, z, ldz, work, lwork, info )
463 CALL dlahqr( wantt, wantz, n, ilo, ihi, h, ldh, wr, wi,
465 $ ihi, z, ldz, info )
479 CALL dlaqr0( wantt, wantz, n, ilo, kbot, h, ldh,
481 $ wi, ilo, ihi, z, ldz, work, lwork, info )
490 CALL dlacpy(
'A', n, n, h, ldh, hl, nl )
492 CALL dlaset(
'A', nl, nl-n, zero, zero, hl( 1,
495 CALL dlaqr0( wantt, wantz, nl, ilo, kbot, hl, nl,
497 $ wi, ilo, ihi, z, ldz, workl, nl, info )
498 IF( wantt .OR. info.NE.0 )
499 $
CALL dlacpy(
'A', n, n, hl, nl, h, ldh )
506 IF( ( wantt .OR. info.NE.0 ) .AND. n.GT.2 )
507 $
CALL dlaset(
'L', n-2, n-2, zero, zero, h( 3, 1 ), ldh )
512 work( 1 ) = max( dble( max( 1, n ) ), work( 1 ) )
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...