134 SUBROUTINE clacn2( N, V, X, EST, KASE, ISAVE )
147 COMPLEX V( * ), X( * )
154 parameter ( itmax = 5 )
156 parameter ( one = 1.0e0, two = 2.0e0 )
158 parameter ( czero = ( 0.0e0, 0.0e0 ),
159 $ cone = ( 1.0e0, 0.0e0 ) )
163 REAL ABSXI, ALTSGN, ESTOLD, SAFMIN, TEMP
168 EXTERNAL icmax1, scsum1, slamch
174 INTRINSIC abs, aimag, cmplx, real
178 safmin = slamch(
'Safe minimum' )
181 x( i ) = cmplx( one /
REAL( N ) )
188 GO TO ( 20, 40, 70, 90, 120 )isave( 1 )
200 est = scsum1( n, x, 1 )
203 absxi = abs( x( i ) )
204 IF( absxi.GT.safmin )
THEN
205 x( i ) = cmplx(
REAL( X( I ) ) / ABSXI,
206 $ aimag( x( i ) ) / absxi )
219 isave( 2 ) = icmax1( n, x, 1 )
228 x( isave( 2 ) ) = cone
237 CALL ccopy( n, x, 1, v, 1 )
239 est = scsum1( n, v, 1 )
246 absxi = abs( x( i ) )
247 IF( absxi.GT.safmin )
THEN
248 x( i ) = cmplx(
REAL( X( I ) ) / ABSXI,
249 $ aimag( x( i ) ) / absxi )
263 isave( 2 ) = icmax1( 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 ) = cmplx( altsgn*( one +
REAL( I-1 ) /
REAL( N-1 ) ) )
286 temp = two*( scsum1( n, x, 1 ) /
REAL( 3*N ) )
287 IF( temp.GT.est )
THEN
288 CALL ccopy( n, x, 1, v, 1 )
subroutine ccopy(N, CX, INCX, CY, INCY)
CCOPY
subroutine clacn2(N, V, X, EST, KASE, ISAVE)
CLACN2 estimates the 1-norm of a square matrix, using reverse communication for evaluating matrix-vec...