261 SUBROUTINE dhsein( SIDE, EIGSRC, INITV, SELECT, N, H, LDH, WR, WI,
262 $ vl, ldvl, vr, ldvr, mm, m, work, ifaill,
271 CHARACTER eigsrc, initv, side
272 INTEGER info, ldh, ldvl, ldvr, m, mm, n
276 INTEGER ifaill( * ), ifailr( * )
277 DOUBLE PRECISION h( ldh, * ), vl( ldvl, * ), vr( ldvr, * ),
278 $ wi( * ), work( * ), wr( * )
284 DOUBLE PRECISION zero, one
285 parameter( zero = 0.0d+0, one = 1.0d+0 )
288 LOGICAL bothv, fromqr, leftv, noinit, pair, rightv
289 INTEGER i, iinfo, k, kl, kln, kr, ksi, ksr, ldwork
290 DOUBLE PRECISION bignum, eps3, hnorm, smlnum, ulp, unfl, wki,
308 bothv =
lsame( side,
'B' )
309 rightv =
lsame( side,
'R' ) .OR. bothv
310 leftv =
lsame( side,
'L' ) .OR. bothv
312 fromqr =
lsame( eigsrc,
'Q' )
314 noinit =
lsame( initv,
'N' )
324 SELECT( k ) = .false.
326 IF( wi( k ).EQ.zero )
THEN
331 IF(
SELECT( k ) .OR.
SELECT( k+1 ) )
THEN
340 IF( .NOT.rightv .AND. .NOT.leftv )
THEN
342 ELSE IF( .NOT.fromqr .AND. .NOT.
lsame( eigsrc,
'N' ) )
THEN
344 ELSE IF( .NOT.noinit .AND. .NOT.
lsame( initv,
'U' ) )
THEN
346 ELSE IF( n.LT.0 )
THEN
348 ELSE IF( ldh.LT.max( 1, n ) )
THEN
350 ELSE IF( ldvl.LT.1 .OR. ( leftv .AND. ldvl.LT.n ) )
THEN
352 ELSE IF( ldvr.LT.1 .OR. ( rightv .AND. ldvr.LT.n ) )
THEN
354 ELSE IF( mm.LT.m )
THEN
358 CALL
xerbla(
'DHSEIN', -info )
369 unfl =
dlamch(
'Safe minimum' )
370 ulp =
dlamch(
'Precision' )
371 smlnum = unfl*( n / ulp )
372 bignum = ( one-ulp ) / smlnum
386 IF(
SELECT( k ) )
THEN
403 DO 20 i = k, kl + 1, -1
404 IF( h( i, i-1 ).EQ.zero )
411 IF( h( i+1, i ).EQ.zero )
425 hnorm =
dlanhs(
'I', kr-kl+1, h( kl, kl ), ldh, work )
426 IF( hnorm.GT.zero )
THEN
440 DO 70 i = k - 1, kl, -1
441 IF(
SELECT( i ) .AND. abs( wr( i )-wkr )+
442 $ abs( wi( i )-wki ).LT.eps3 )
THEN
459 CALL
dlaein( .false., noinit, n-kl+1, h( kl, kl ), ldh,
460 $ wkr, wki, vl( kl, ksr ), vl( kl, ksi ),
461 $ work, ldwork, work( n*n+n+1 ), eps3, smlnum,
463 IF( iinfo.GT.0 )
THEN
488 CALL
dlaein( .true., noinit, kr, h, ldh, wkr, wki,
489 $ vr( 1, ksr ), vr( 1, ksi ), work, ldwork,
490 $ work( n*n+n+1 ), eps3, smlnum, bignum,
492 IF( iinfo.GT.0 )
THEN