130 SUBROUTINE ssyequb( UPLO, N, A, LDA, S, SCOND, AMAX, WORK, INFO )
142 REAL A( LDA, * ), S( * ), WORK( * )
149 parameter( one = 1.0e0, zero = 0.0e0 )
151 parameter( max_iter = 100 )
155 REAL AVG, STD, TOL, C0, C1, C2, T, U, SI, D, BASE,
156 $ SMIN, SMAX, SMLNUM, BIGNUM, SCALE, SUMSQ
162 EXTERNAL lsame, slamch
168 INTRINSIC abs, int, log, max, min, sqrt
175 IF ( .NOT. ( lsame( uplo,
'U' ) .OR. lsame( uplo,
'L' ) ) )
THEN
177 ELSE IF ( n .LT. 0 )
THEN
179 ELSE IF ( lda .LT. max( 1, n ) )
THEN
182 IF ( info .NE. 0 )
THEN
183 CALL xerbla(
'SSYEQUB', -info )
187 up = lsame( uplo,
'U' )
205 s( i ) = max( s( i ), abs( a( i, j ) ) )
206 s( j ) = max( s( j ), abs( a( i, j ) ) )
207 amax = max( amax, abs( a( i, j ) ) )
209 s( j ) = max( s( j ), abs( a( j, j ) ) )
210 amax = max( amax, abs( a( j, j ) ) )
214 s( j ) = max( s( j ), abs( a( j, j ) ) )
215 amax = max( amax, abs( a( j, j ) ) )
217 s( i ) = max( s( i ), abs( a( i, j ) ) )
218 s( j ) = max( s( j ), abs( a( i, j ) ) )
219 amax = max( amax, abs( a( i, j ) ) )
224 s( j ) = 1.0e0 / s( j )
227 tol = one / sqrt( 2.0e0 * n )
229 DO iter = 1, max_iter
239 work( i ) = work( i ) + abs( a( i, j ) ) * s( j )
240 work( j ) = work( j ) + abs( a( i, j ) ) * s( i )
242 work( j ) = work( j ) + abs( a( j, j ) ) * s( j )
246 work( j ) = work( j ) + abs( a( j, j ) ) * s( j )
248 work( i ) = work( i ) + abs( a( i, j ) ) * s( j )
249 work( j ) = work( j ) + abs( a( i, j ) ) * s( i )
257 avg = avg + s( i )*work( i )
263 work( i ) = s( i-n ) * work( i-n ) - avg
265 CALL slassq( n, work( n+1 ), 1, scale, sumsq )
266 std = scale * sqrt( sumsq / n )
268 IF ( std .LT. tol * avg )
GOTO 999
274 c1 = ( n-2 ) * ( work( i ) - t*si )
275 c0 = -(t*si)*si + 2*work( i )*si - n*avg
282 si = -2*c0 / ( c1 + sqrt( d ) )
290 work( j ) = work( j ) + d*t
295 work( j ) = work( j ) + d*t
301 work( j ) = work( j ) + d*t
306 work( j ) = work( j ) + d*t
310 avg = avg + ( u + work( i ) ) * d / n
317 smlnum = slamch(
'SAFEMIN' )
318 bignum = one / smlnum
321 t = one / sqrt( avg )
323 u = one / log( base )
325 s( i ) = base ** int( u * log( s( i ) * t ) )
326 smin = min( smin, s( i ) )
327 smax = max( smax, s( i ) )
329 scond = max( smin, smlnum ) / min( smax, bignum )
subroutine xerbla(srname, info)
subroutine ssyequb(uplo, n, a, lda, s, scond, amax, work, info)
SSYEQUB
subroutine slassq(n, x, incx, scale, sumsq)
SLASSQ updates a sum of squares represented in scaled form.