242 SUBROUTINE zhsein( SIDE, EIGSRC, INITV, SELECT, N, H, LDH, W, VL,
243 $ LDVL, VR, LDVR, MM, M, WORK, RWORK, IFAILL,
251 CHARACTER EIGSRC, INITV, SIDE
252 INTEGER INFO, LDH, LDVL, LDVR, M, MM, N
256 INTEGER IFAILL( * ), IFAILR( * )
257 DOUBLE PRECISION RWORK( * )
258 COMPLEX*16 H( LDH, * ), VL( LDVL, * ), VR( LDVR, * ),
266 PARAMETER ( ZERO = ( 0.0d+0, 0.0d+0 ) )
267 DOUBLE PRECISION RZERO
268 parameter( rzero = 0.0d+0 )
271 LOGICAL BOTHV, FROMQR, LEFTV, NOINIT, RIGHTV
272 INTEGER I, IINFO, K, KL, KLN, KR, KS, LDWORK
273 DOUBLE PRECISION EPS3, HNORM, SMLNUM, ULP, UNFL
277 LOGICAL LSAME, DISNAN
278 DOUBLE PRECISION DLAMCH, ZLANHS
279 EXTERNAL lsame, dlamch, zlanhs, disnan
285 INTRINSIC abs, dble, dimag, max
288 DOUBLE PRECISION CABS1
291 cabs1( cdum ) = abs( dble( cdum ) ) + abs( dimag( cdum ) )
297 bothv = lsame( side,
'B' )
298 rightv = lsame( side,
'R' ) .OR. bothv
299 leftv = lsame( side,
'L' ) .OR. bothv
301 fromqr = lsame( eigsrc,
'Q' )
303 noinit = lsame( initv,
'N' )
315 IF( .NOT.rightv .AND. .NOT.leftv )
THEN
317 ELSE IF( .NOT.fromqr .AND. .NOT.lsame( eigsrc,
'N' ) )
THEN
319 ELSE IF( .NOT.noinit .AND. .NOT.lsame( initv,
'U' ) )
THEN
321 ELSE IF( n.LT.0 )
THEN
323 ELSE IF( ldh.LT.max( 1, n ) )
THEN
325 ELSE IF( ldvl.LT.1 .OR. ( leftv .AND. ldvl.LT.n ) )
THEN
327 ELSE IF( ldvr.LT.1 .OR. ( rightv .AND. ldvr.LT.n ) )
THEN
329 ELSE IF( mm.LT.m )
THEN
333 CALL xerbla(
'ZHSEIN', -info )
344 unfl = dlamch(
'Safe minimum' )
345 ulp = dlamch(
'Precision' )
346 smlnum = unfl*( n / ulp )
360 IF(
SELECT( k ) )
THEN
377 DO 20 i = k, kl + 1, -1
378 IF( h( i, i-1 ).EQ.zero )
385 IF( h( i+1, i ).EQ.zero )
399 hnorm = zlanhs(
'I', kr-kl+1, h( kl, kl ), ldh, rwork )
400 IF( disnan( hnorm ) )
THEN
403 ELSE IF( hnorm.GT.rzero )
THEN
416 DO 70 i = k - 1, kl, -1
417 IF(
SELECT( i ) .AND. cabs1( w( i )-wk ).LT.eps3 )
THEN
428 CALL zlaein( .false., noinit, n-kl+1, h( kl, kl ), ldh,
429 $ wk, vl( kl, ks ), work, ldwork, rwork, eps3,
431 IF( iinfo.GT.0 )
THEN
445 CALL zlaein( .true., noinit, kr, h, ldh, wk, vr( 1, ks ),
446 $ work, ldwork, rwork, eps3, smlnum, iinfo )
447 IF( iinfo.GT.0 )
THEN
subroutine xerbla(srname, info)
subroutine zhsein(side, eigsrc, initv, select, n, h, ldh, w, vl, ldvl, vr, ldvr, mm, m, work, rwork, ifaill, ifailr, info)
ZHSEIN
subroutine zlaein(rightv, noinit, n, h, ldh, w, v, b, ldb, rwork, eps3, smlnum, info)
ZLAEIN computes a specified right or left eigenvector of an upper Hessenberg matrix by inverse iterat...