134 SUBROUTINE zlacn2( N, V, X, EST, KASE, ISAVE )
147 COMPLEX*16 v( * ), x( * )
154 parameter( itmax = 5 )
155 DOUBLE PRECISION one, two
156 parameter( one = 1.0d0, two = 2.0d0 )
157 COMPLEX*16 czero, cone
158 parameter( czero = ( 0.0d0, 0.0d0 ),
159 $ cone = ( 1.0d0, 0.0d0 ) )
163 DOUBLE PRECISION absxi, altsgn, estold, safmin, temp
174 INTRINSIC abs, dble, dcmplx, dimag
178 safmin =
dlamch(
'Safe minimum' )
181 x( i ) = dcmplx( one / dble( n ) )
188 go to( 20, 40, 70, 90, 120 )isave( 1 )
203 absxi = abs( x( i ) )
204 IF( absxi.GT.safmin )
THEN
205 x( i ) = dcmplx( dble( x( i ) ) / absxi,
206 $ dimag( x( i ) ) / absxi )
219 isave( 2 ) =
izmax1( n, x, 1 )
228 x( isave( 2 ) ) = cone
237 CALL
zcopy( n, x, 1, v, 1 )
246 absxi = abs( x( i ) )
247 IF( absxi.GT.safmin )
THEN
248 x( i ) = dcmplx( dble( x( i ) ) / absxi,
249 $ dimag( x( i ) ) / absxi )
263 isave( 2 ) =
izmax1( n, x, 1 )
264 IF( ( abs( x( jlast ) ).NE.abs( x( isave( 2 ) ) ) ) .AND.
265 $ ( isave( 3 ).LT.itmax ) )
THEN
266 isave( 3 ) = isave( 3 ) + 1
275 x( i ) = dcmplx( altsgn*( one+dble( i-1 ) / dble( n-1 ) ) )
286 temp = two*(
dzsum1( n, x, 1 ) / dble( 3*n ) )
287 IF( temp.GT.est )
THEN
288 CALL
zcopy( n, x, 1, v, 1 )