168 SUBROUTINE dlaein( RIGHTV, NOINIT, N, H, LDH, WR, WI, VR, VI,
170 $ LDB, WORK, EPS3, SMLNUM, BIGNUM, INFO )
177 LOGICAL NOINIT, RIGHTV
178 INTEGER INFO, LDB, LDH, N
179 DOUBLE PRECISION BIGNUM, EPS3, SMLNUM, WI, WR
182 DOUBLE PRECISION B( LDB, * ), H( LDH, * ), VI( * ), VR( * ),
189 DOUBLE PRECISION ZERO, ONE, TENTH
190 PARAMETER ( ZERO = 0.0d+0, one = 1.0d+0, tenth = 1.0d-1 )
193 CHARACTER NORMIN, TRANS
194 INTEGER I, I1, I2, I3, IERR, ITS, J
195 DOUBLE PRECISION ABSBII, ABSBJJ, EI, EJ, GROWTO, NORM, NRMSML,
196 $ rec, rootn, scale, temp, vcrit, vmax, vnorm, w,
201 DOUBLE PRECISION DASUM, DLAPY2, DNRM2
202 EXTERNAL idamax, dasum, dlapy2, dnrm2
208 INTRINSIC abs, dble, max, sqrt
217 rootn = sqrt( dble( n ) )
218 growto = tenth / rootn
219 nrmsml = max( one, eps3*rootn )*smlnum
226 b( i, j ) = h( i, j )
228 b( j, j ) = h( j, j ) - wr
231 IF( wi.EQ.zero )
THEN
246 vnorm = dnrm2( n, vr, 1 )
247 CALL dscal( n, ( eps3*rootn ) / max( vnorm, nrmsml ), vr,
258 IF( abs( b( i, i ) ).LT.abs( ei ) )
THEN
266 b( i+1, j ) = b( i, j ) - x*temp
273 IF( b( i, i ).EQ.zero )
278 b( i+1, j ) = b( i+1, j ) - x*b( i, j )
283 IF( b( n, n ).EQ.zero )
295 IF( abs( b( j, j ) ).LT.abs( ej ) )
THEN
303 b( i, j-1 ) = b( i, j ) - x*temp
310 IF( b( j, j ).EQ.zero )
315 b( i, j-1 ) = b( i, j-1 ) - x*b( i, j )
320 IF( b( 1, 1 ).EQ.zero )
334 CALL dlatrs(
'Upper', trans,
'Nonunit', normin, n, b,
336 $ vr, scale, work, ierr )
341 vnorm = dasum( n, vr, 1 )
342 IF( vnorm.GE.growto*scale )
347 temp = eps3 / ( rootn+one )
352 vr( n-its+1 ) = vr( n-its+1 ) - eps3*rootn
363 i = idamax( n, vr, 1 )
364 CALL dscal( n, one / abs( vr( i ) ), vr, 1 )
381 norm = dlapy2( dnrm2( n, vr, 1 ),
382 $ dnrm2( n, vi, 1 ) )
383 rec = ( eps3*rootn ) / max( norm, nrmsml )
384 CALL dscal( n, rec, vr, 1 )
385 CALL dscal( n, rec, vi, 1 )
402 absbii = dlapy2( b( i, i ), b( i+1, i ) )
404 IF( absbii.LT.abs( ei ) )
THEN
409 xi = b( i+1, i ) / ei
414 b( i+1, j ) = b( i, j ) - xr*temp
415 b( j+1, i+1 ) = b( j+1, i ) - xi*temp
420 b( i+1, i+1 ) = b( i+1, i+1 ) - xi*wi
421 b( i+2, i+1 ) = b( i+2, i+1 ) + xr*wi
426 IF( absbii.EQ.zero )
THEN
431 ei = ( ei / absbii ) / absbii
435 b( i+1, j ) = b( i+1, j ) - xr*b( i, j ) +
437 b( j+1, i+1 ) = -xr*b( j+1, i ) - xi*b( i, j )
439 b( i+2, i+1 ) = b( i+2, i+1 ) - wi
444 work( i ) = dasum( n-i, b( i, i+1 ), ldb ) +
445 $ dasum( n-i, b( i+2, i ), 1 )
447 IF( b( n, n ).EQ.zero .AND. b( n+1, n ).EQ.zero )
469 absbjj = dlapy2( b( j, j ), b( j+1, j ) )
470 IF( absbjj.LT.abs( ej ) )
THEN
475 xi = b( j+1, j ) / ej
480 b( i, j-1 ) = b( i, j ) - xr*temp
481 b( j, i ) = b( j+1, i ) - xi*temp
486 b( j-1, j-1 ) = b( j-1, j-1 ) + xi*wi
487 b( j, j-1 ) = b( j, j-1 ) - xr*wi
492 IF( absbjj.EQ.zero )
THEN
497 ej = ( ej / absbjj ) / absbjj
501 b( i, j-1 ) = b( i, j-1 ) - xr*b( i, j ) +
503 b( j, i ) = -xr*b( j+1, i ) - xi*b( i, j )
505 b( j, j-1 ) = b( j, j-1 ) + wi
510 work( j ) = dasum( j-1, b( 1, j ), 1 ) +
511 $ dasum( j-1, b( j+1, 1 ), ldb )
513 IF( b( 1, 1 ).EQ.zero .AND. b( 2, 1 ).EQ.zero )
531 DO 250 i = i1, i2, i3
533 IF( work( i ).GT.vcrit )
THEN
535 CALL dscal( n, rec, vr, 1 )
536 CALL dscal( n, rec, vi, 1 )
546 xr = xr - b( i, j )*vr( j ) + b( j+1, i )*vi( j )
547 xi = xi - b( i, j )*vi( j ) - b( j+1, i )*vr( j )
551 xr = xr - b( j, i )*vr( j ) + b( i+1, j )*vi( j )
552 xi = xi - b( j, i )*vi( j ) - b( i+1, j )*vr( j )
556 w = abs( b( i, i ) ) + abs( b( i+1, i ) )
557 IF( w.GT.smlnum )
THEN
559 w1 = abs( xr ) + abs( xi )
560 IF( w1.GT.w*bignum )
THEN
562 CALL dscal( n, rec, vr, 1 )
563 CALL dscal( n, rec, vi, 1 )
573 CALL dladiv( xr, xi, b( i, i ), b( i+1, i ),
576 vmax = max( abs( vr( i ) )+abs( vi( i ) ), vmax )
577 vcrit = bignum / vmax
593 vnorm = dasum( n, vr, 1 ) + dasum( n, vi, 1 )
594 IF( vnorm.GE.growto*scale )
599 y = eps3 / ( rootn+one )
607 vr( n-its+1 ) = vr( n-its+1 ) - eps3*rootn
620 vnorm = max( vnorm, abs( vr( i ) )+abs( vi( i ) ) )
622 CALL dscal( n, one / vnorm, vr, 1 )
623 CALL dscal( n, one / vnorm, vi, 1 )