137 SUBROUTINE dlacn2( N, V, X, ISGN, EST, KASE, ISAVE )
149 INTEGER isgn( * ), isave( 3 )
150 DOUBLE PRECISION v( * ), x( * )
157 parameter( itmax = 5 )
158 DOUBLE PRECISION zero, one, two
159 parameter( zero = 0.0d+0, one = 1.0d+0, two = 2.0d+0 )
163 DOUBLE PRECISION altsgn, estold, temp
167 DOUBLE PRECISION dasum
174 INTRINSIC abs, dble, nint, sign
180 x( i ) = one / dble( n )
187 go to( 20, 40, 70, 110, 140 )isave( 1 )
199 est =
dasum( n, x, 1 )
202 x( i ) = sign( one, x( i ) )
203 isgn( i ) = nint( x( i ) )
213 isave( 2 ) =
idamax( n, x, 1 )
222 x( isave( 2 ) ) = one
231 CALL
dcopy( n, x, 1, v, 1 )
233 est =
dasum( n, v, 1 )
235 IF( nint( sign( one, x( i ) ) ).NE.isgn( i ) )
247 x( i ) = sign( one, x( i ) )
248 isgn( i ) = nint( x( i ) )
259 isave( 2 ) =
idamax( n, x, 1 )
260 IF( ( x( jlast ).NE.abs( x( isave( 2 ) ) ) ) .AND.
261 $ ( isave( 3 ).LT.itmax ) )
THEN
262 isave( 3 ) = isave( 3 ) + 1
271 x( i ) = altsgn*( one+dble( i-1 ) / dble( n-1 ) )
282 temp = two*(
dasum( n, x, 1 ) / dble( 3*n ) )
283 IF( temp.GT.est )
THEN
284 CALL
dcopy( n, x, 1, v, 1 )