132 SUBROUTINE ssyequb( UPLO, N, A, LDA, S, SCOND, AMAX, WORK, INFO )
145 REAL A( lda, * ), S( * ), WORK( * )
152 parameter ( one = 1.0e0, zero = 0.0e0 )
154 parameter ( max_iter = 100 )
158 REAL AVG, STD, TOL, C0, C1, C2, T, U, SI, D, BASE,
159 $ smin, smax, smlnum, bignum, scale, sumsq
165 EXTERNAL lsame, slamch
171 INTRINSIC abs, int, log, max, min, sqrt
178 IF ( .NOT. ( lsame( uplo,
'U' ) .OR. lsame( uplo,
'L' ) ) )
THEN
180 ELSE IF ( n .LT. 0 )
THEN
182 ELSE IF ( lda .LT. max( 1, n ) )
THEN
185 IF ( info .NE. 0 )
THEN
186 CALL xerbla(
'SSYEQUB', -info )
190 up = lsame( uplo,
'U' )
208 s( i ) = max( s( i ), abs( a( i, j ) ) )
209 s( j ) = max( s( j ), abs( a( i, j ) ) )
210 amax = max( amax, abs( a( i, j ) ) )
212 s( j ) = max( s( j ), abs( a( j, j ) ) )
213 amax = max( amax, abs( a( j, j ) ) )
217 s( j ) = max( s( j ), abs( a( j, j ) ) )
218 amax = max( amax, abs( a( j, j ) ) )
220 s( i ) = max( s( i ), abs( a( i, j ) ) )
221 s( j ) = max( s( j ), abs( a( i, j ) ) )
222 amax = max( amax, abs( a( i, j ) ) )
227 s( j ) = 1.0e0 / s( j )
230 tol = one / sqrt( 2.0e0 * n )
232 DO iter = 1, max_iter
242 work( i ) = work( i ) + abs( a( i, j ) ) * s( j )
243 work( j ) = work( j ) + abs( a( i, j ) ) * s( i )
245 work( j ) = work( j ) + abs( a( j, j ) ) * s( j )
249 work( j ) = work( j ) + abs( a( j, j ) ) * s( j )
251 work( i ) = work( i ) + abs( a( i, j ) ) * s( j )
252 work( j ) = work( j ) + abs( a( i, j ) ) * s( i )
260 avg = avg + s( i )*work( i )
266 work( i ) = s( i-n ) * work( i-n ) - avg
268 CALL slassq( n, work( n+1 ), 1, scale, sumsq )
269 std = scale * sqrt( sumsq / n )
271 IF ( std .LT. tol * avg )
GOTO 999
277 c1 = ( n-2 ) * ( work( i ) - t*si )
278 c0 = -(t*si)*si + 2*work( i )*si - n*avg
285 si = -2*c0 / ( c1 + sqrt( d ) )
293 work( j ) = work( j ) + d*t
298 work( j ) = work( j ) + d*t
304 work( j ) = work( j ) + d*t
309 work( j ) = work( j ) + d*t
313 avg = avg + ( u + work( i ) ) * d / n
320 smlnum = slamch(
'SAFEMIN' )
321 bignum = one / smlnum
324 t = one / sqrt( avg )
326 u = one / log( base )
328 s( i ) = base ** int( u * log( s( i ) * t ) )
329 smin = min( smin, s( i ) )
330 smax = max( smax, s( i ) )
332 scond = max( smin, smlnum ) / min( smax, bignum )
subroutine ssyequb(UPLO, N, A, LDA, S, SCOND, AMAX, WORK, INFO)
SSYEQUB
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine slassq(N, X, INCX, SCALE, SUMSQ)
SLASSQ updates a sum of squares represented in scaled form.