314 SUBROUTINE shseqr( 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 REAL H( LDH, * ), WI( * ), WORK( * ), WR( * ),
338 parameter( ntiny = 15 )
349 parameter( zero = 0.0e0, one = 1.0e0 )
352 REAL HL( NL, NL ), WORKL( NL )
355 INTEGER I, KBOT, NMIN
356 LOGICAL INITZ, LQUERY, WANTT, WANTZ
362 EXTERNAL ilaenv, lsame, sroundup_lwork
368 INTRINSIC max, min, real
374 wantt = lsame( job,
'S' )
375 initz = lsame( compz,
'I' )
376 wantz = initz .OR. lsame( compz,
'V' )
377 work( 1 ) = sroundup_lwork( max( 1, n ) )
381 IF( .NOT.lsame( job,
'E' ) .AND. .NOT.wantt )
THEN
383 ELSE IF( .NOT.lsame( compz,
'N' ) .AND. .NOT.wantz )
THEN
385 ELSE IF( n.LT.0 )
THEN
387 ELSE IF( ilo.LT.1 .OR. ilo.GT.max( 1, n ) )
THEN
389 ELSE IF( ihi.LT.min( ilo, n ) .OR. ihi.GT.n )
THEN
391 ELSE IF( ldh.LT.max( 1, n ) )
THEN
393 ELSE IF( ldz.LT.1 .OR. ( wantz .AND. ldz.LT.max( 1, n ) ) )
THEN
395 ELSE IF( lwork.LT.max( 1, n ) .AND. .NOT.lquery )
THEN
403 CALL xerbla(
'SHSEQR', -info )
406 ELSE IF( n.EQ.0 )
THEN
412 ELSE IF( lquery )
THEN
416 CALL slaqr0( wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, ilo,
417 $ ihi, z, ldz, work, lwork, info )
420 work( 1 ) = max( real( max( 1, n ) ), work( 1 ) )
439 $
CALL slaset(
'A', n, n, zero, one, z, ldz )
443 IF( ilo.EQ.ihi )
THEN
444 wr( ilo ) = h( ilo, ilo )
451 nmin = ilaenv( 12,
'SHSEQR', job( : 1 ) // compz( : 1 ), n,
453 nmin = max( ntiny, nmin )
458 CALL slaqr0( wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, ilo,
459 $ ihi, z, ldz, work, lwork, info )
464 CALL slahqr( wantt, wantz, n, ilo, ihi, h, ldh, wr, wi, ilo,
465 $ ihi, z, ldz, info )
479 CALL slaqr0( wantt, wantz, n, ilo, kbot, h, ldh, wr,
480 $ wi, ilo, ihi, z, ldz, work, lwork, info )
489 CALL slacpy(
'A', n, n, h, ldh, hl, nl )
491 CALL slaset(
'A', nl, nl-n, zero, zero, hl( 1, n+1 ),
493 CALL slaqr0( wantt, wantz, nl, ilo, kbot, hl, nl, wr,
494 $ wi, ilo, ihi, z, ldz, workl, nl, info )
495 IF( wantt .OR. info.NE.0 )
496 $
CALL slacpy(
'A', n, n, hl, nl, h, ldh )
503 IF( ( wantt .OR. info.NE.0 ) .AND. n.GT.2 )
504 $
CALL slaset(
'L', n-2, n-2, zero, zero, h( 3, 1 ), ldh )
509 work( 1 ) = max( real( max( 1, n ) ), work( 1 ) )
subroutine xerbla(srname, info)
subroutine shseqr(job, compz, n, ilo, ihi, h, ldh, wr, wi, z, ldz, work, lwork, info)
SHSEQR
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
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...
subroutine slaset(uplo, m, n, alpha, beta, a, lda)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.