101 REAL ZERO, ONE, TWO, THREE
102 parameter( zero = 0.0e0, one = 1.0e0, two = 2.0e0,
105 parameter( maxit = 30 )
108 INTEGER I, ISCALE, JTOT, L, L1, LEND, LENDSV, LSV, M,
110 REAL ALPHA, ANORM, BB, C, EPS, EPS2, GAMMA, OLDC,
111 $ OLDGAM, P, R, RT1, RT2, RTE, S, SAFMAX, SAFMIN,
112 $ SIGMA, SSFMAX, SSFMIN
115 REAL SLAMCH, SLANST, SLAPY2
116 EXTERNAL slamch, slanst, slapy2
122 INTRINSIC abs, sign, sqrt
134 CALL xerbla(
'SSTERF', -info )
144 safmin = slamch(
'S' )
145 safmax = one / safmin
146 ssfmax = sqrt( safmax ) / three
147 ssfmin = sqrt( safmin ) / eps2
167 IF( abs( e( m ) ).LE.( sqrt( abs( d( m ) ) )*
168 $ sqrt( abs( d( m+1 ) ) ) )*eps )
THEN
186 anorm = slanst(
'M', lend-l+1, d( l ), e( l ) )
190 IF( anorm.GT.ssfmax )
THEN
192 CALL slascl(
'G', 0, 0, anorm, ssfmax, lend-l+1, 1, d( l ), n,
194 CALL slascl(
'G', 0, 0, anorm, ssfmax, lend-l, 1, e( l ), n,
196 ELSE IF( anorm.LT.ssfmin )
THEN
198 CALL slascl(
'G', 0, 0, anorm, ssfmin, lend-l+1, 1, d( l ), n,
200 CALL slascl(
'G', 0, 0, anorm, ssfmin, lend-l, 1, e( l ), n,
204 DO 40 i = l, lend - 1
210 IF( abs( d( lend ) ).LT.abs( d( l ) ) )
THEN
223 DO 60 m = l, lend - 1
224 IF( abs( e( m ) ).LE.eps2*abs( d( m )*d( m+1 ) ) )
242 CALL slae2( d( l ), rte, d( l+1 ), rt1, rt2 )
259 sigma = ( d( l+1 )-p ) / ( two*rte )
260 r = slapy2( sigma, one )
261 sigma = p - ( rte / ( sigma+sign( r, sigma ) ) )
265 gamma = d( m ) - sigma
270 DO 80 i = m - 1, l, -1
280 gamma = c*( alpha-sigma ) - s*oldgam
281 d( i+1 ) = oldgam + ( alpha-gamma )
283 p = ( gamma*gamma ) / c
290 d( l ) = sigma + gamma
310 DO 110 m = l, lend + 1, -1
311 IF( abs( e( m-1 ) ).LE.eps2*abs( d( m )*d( m-1 ) ) )
327 rte = sqrt( e( l-1 ) )
328 CALL slae2( d( l ), rte, d( l-1 ), rt1, rt2 )
344 rte = sqrt( e( l-1 ) )
345 sigma = ( d( l-1 )-p ) / ( two*rte )
346 r = slapy2( sigma, one )
347 sigma = p - ( rte / ( sigma+sign( r, sigma ) ) )
351 gamma = d( m ) - sigma
366 gamma = c*( alpha-sigma ) - s*oldgam
367 d( i ) = oldgam + ( alpha-gamma )
369 p = ( gamma*gamma ) / c
376 d( l ) = sigma + gamma
395 $
CALL slascl(
'G', 0, 0, ssfmax, anorm, lendsv-lsv+1, 1,
396 $ d( lsv ), n, info )
398 $
CALL slascl(
'G', 0, 0, ssfmin, anorm, lendsv-lsv+1, 1,
399 $ d( lsv ), n, info )
415 CALL slasrt(
'I', n, d, info )
subroutine xerbla(srname, info)
subroutine slae2(a, b, c, rt1, rt2)
SLAE2 computes the eigenvalues of a 2-by-2 symmetric matrix.
subroutine slascl(type, kl, ku, cfrom, cto, m, n, a, lda, info)
SLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine slasrt(id, n, d, info)
SLASRT sorts numbers in increasing or decreasing order.
subroutine ssterf(n, d, e, info)
SSTERF