242 SUBROUTINE chsein( 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( * )
258 COMPLEX H( LDH, * ), VL( LDVL, * ), VR( LDVR, * ),
266 PARAMETER ( ZERO = ( 0.0e+0, 0.0e+0 ) )
268 parameter( rzero = 0.0e+0 )
271 LOGICAL BOTHV, FROMQR, LEFTV, NOINIT, RIGHTV
272 INTEGER I, IINFO, K, KL, KLN, KR, KS, LDWORK
273 REAL EPS3, HNORM, SMLNUM, ULP, UNFL
277 LOGICAL LSAME, SISNAN
279 EXTERNAL lsame, clanhs, slamch, sisnan
285 INTRINSIC abs, aimag, max, real
291 cabs1( cdum ) = abs( real( cdum ) ) + abs( aimag( 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(
'CHSEIN', -info )
344 unfl = slamch(
'Safe minimum' )
345 ulp = slamch(
'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 = clanhs(
'I', kr-kl+1, h( kl, kl ), ldh, rwork )
400 IF( sisnan( 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 claein( .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 claein( .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 chsein(side, eigsrc, initv, select, n, h, ldh, w, vl, ldvl, vr, ldvr, mm, m, work, rwork, ifaill, ifailr, info)
CHSEIN
subroutine claein(rightv, noinit, n, h, ldh, w, v, b, ldb, rwork, eps3, smlnum, info)
CLAEIN computes a specified right or left eigenvector of an upper Hessenberg matrix by inverse iterat...