312 SUBROUTINE shseqr( 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 REAL H( LDH, * ), WI( * ), WORK( * ), WR( * ),
336 parameter( ntiny = 15 )
347 parameter( zero = 0.0e0, one = 1.0e0 )
350 REAL HL( NL, NL ), WORKL( NL )
353 INTEGER I, KBOT, NMIN
354 LOGICAL INITZ, LQUERY, WANTT, WANTZ
360 EXTERNAL ilaenv, lsame, sroundup_lwork
367 INTRINSIC max, min, real
373 wantt = lsame( job,
'S' )
374 initz = lsame( compz,
'I' )
375 wantz = initz .OR. lsame( compz,
'V' )
376 work( 1 ) = sroundup_lwork( 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(
'SHSEQR', -info )
405 ELSE IF( n.EQ.0 )
THEN
411 ELSE IF( lquery )
THEN
415 CALL slaqr0( wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, ilo,
416 $ ihi, z, ldz, work, lwork, info )
419 work( 1 ) = max( real( max( 1, n ) ), work( 1 ) )
438 $
CALL slaset(
'A', n, n, zero, one, z, ldz )
442 IF( ilo.EQ.ihi )
THEN
443 wr( ilo ) = h( ilo, ilo )
450 nmin = ilaenv( 12,
'SHSEQR', job( : 1 ) // compz( : 1 ), n,
452 nmin = max( ntiny, nmin )
457 CALL slaqr0( wantt, wantz, n, ilo, ihi, h, ldh, wr, wi,
459 $ ihi, z, ldz, work, lwork, info )
464 CALL slahqr( wantt, wantz, n, ilo, ihi, h, ldh, wr, wi,
466 $ ihi, z, ldz, info )
480 CALL slaqr0( wantt, wantz, n, ilo, kbot, h, ldh,
482 $ wi, ilo, ihi, z, ldz, work, lwork, info )
491 CALL slacpy(
'A', n, n, h, ldh, hl, nl )
493 CALL slaset(
'A', nl, nl-n, zero, zero, hl( 1,
496 CALL slaqr0( wantt, wantz, nl, ilo, kbot, hl, nl,
498 $ wi, ilo, ihi, z, ldz, workl, nl, info )
499 IF( wantt .OR. info.NE.0 )
500 $
CALL slacpy(
'A', n, n, hl, nl, h, ldh )
507 IF( ( wantt .OR. info.NE.0 ) .AND. n.GT.2 )
508 $
CALL slaset(
'L', n-2, n-2, zero, zero, h( 3, 1 ), ldh )
513 work( 1 ) = max( real( max( 1, n ) ), work( 1 ) )
subroutine slahqr(wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, iloz, ihiz, z, ldz, info)
SLAHQR computes the eigenvalues and Schur factorization of an upper Hessenberg matrix,...
subroutine slaqr0(wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, iloz, ihiz, z, ldz, work, lwork, info)
SLAQR0 computes the eigenvalues of a Hessenberg matrix, and optionally the matrices from the Schur de...