130 SUBROUTINE ssteqr( COMPZ, N, D, E, Z, LDZ, WORK, INFO )
141 REAL D( * ), E( * ), WORK( * ), Z( LDZ, * )
147 REAL ZERO, ONE, TWO, THREE
148 parameter( zero = 0.0e0, one = 1.0e0, two = 2.0e0,
151 parameter( maxit = 30 )
154 INTEGER I, ICOMPZ, II, ISCALE, J, JTOT, K, L, L1, LEND,
155 $ LENDM1, LENDP1, LENDSV, LM1, LSV, M, MM, MM1,
157 REAL ANORM, B, C, EPS, EPS2, F, G, P, R, RT1, RT2,
158 $ S, SAFMAX, SAFMIN, SSFMAX, SSFMIN, TST
162 REAL SLAMCH, SLANST, SLAPY2
163 EXTERNAL lsame, slamch, slanst, slapy2
170 INTRINSIC abs, max, sign, sqrt
178 IF( lsame( compz,
'N' ) )
THEN
180 ELSE IF( lsame( compz,
'V' ) )
THEN
182 ELSE IF( lsame( compz,
'I' ) )
THEN
187 IF( icompz.LT.0 )
THEN
189 ELSE IF( n.LT.0 )
THEN
191 ELSE IF( ( ldz.LT.1 ) .OR. ( icompz.GT.0 .AND. ldz.LT.max( 1,
196 CALL xerbla(
'SSTEQR', -info )
215 safmin = slamch(
'S' )
216 safmax = one / safmin
217 ssfmax = sqrt( safmax ) / three
218 ssfmin = sqrt( safmin ) / eps2
224 $
CALL slaset(
'Full', n, n, zero, one, z, ldz )
246 IF( tst.LE.( sqrt( abs( d( m ) ) )*sqrt( abs( d( m+
247 $ 1 ) ) ) )*eps )
THEN
266 anorm = slanst(
'M', lend-l+1, d( l ), e( l ) )
270 IF( anorm.GT.ssfmax )
THEN
272 CALL slascl(
'G', 0, 0, anorm, ssfmax, lend-l+1, 1, d( l ), n,
274 CALL slascl(
'G', 0, 0, anorm, ssfmax, lend-l, 1, e( l ), n,
276 ELSE IF( anorm.LT.ssfmin )
THEN
278 CALL slascl(
'G', 0, 0, anorm, ssfmin, lend-l+1, 1, d( l ), n,
280 CALL slascl(
'G', 0, 0, anorm, ssfmin, lend-l, 1, e( l ), n,
286 IF( abs( d( lend ) ).LT.abs( d( l ) ) )
THEN
301 tst = abs( e( m ) )**2
302 IF( tst.LE.( eps2*abs( d( m ) ) )*abs( d( m+1 ) )+
320 IF( icompz.GT.0 )
THEN
321 CALL slaev2( d( l ), e( l ), d( l+1 ), rt1, rt2, c, s )
324 CALL slasr(
'R',
'V',
'B', n, 2, work( l ),
325 $ work( n-1+l ), z( 1, l ), ldz )
327 CALL slae2( d( l ), e( l ), d( l+1 ), rt1, rt2 )
344 g = ( d( l+1 )-p ) / ( two*e( l ) )
346 g = d( m ) - p + ( e( l ) / ( g+sign( r, g ) ) )
358 CALL slartg( g, f, c, s, r )
362 r = ( d( i )-g )*s + two*c*b
369 IF( icompz.GT.0 )
THEN
378 IF( icompz.GT.0 )
THEN
380 CALL slasr(
'R',
'V',
'B', n, mm, work( l ), work( n-1+l ),
407 DO 100 m = l, lendp1, -1
408 tst = abs( e( m-1 ) )**2
409 IF( tst.LE.( eps2*abs( d( m ) ) )*abs( d( m-1 ) )+
427 IF( icompz.GT.0 )
THEN
428 CALL slaev2( d( l-1 ), e( l-1 ), d( l ), rt1, rt2, c, s )
431 CALL slasr(
'R',
'V',
'F', n, 2, work( m ),
432 $ work( n-1+m ), z( 1, l-1 ), ldz )
434 CALL slae2( d( l-1 ), e( l-1 ), d( l ), rt1, rt2 )
451 g = ( d( l-1 )-p ) / ( two*e( l-1 ) )
453 g = d( m ) - p + ( e( l-1 ) / ( g+sign( r, g ) ) )
465 CALL slartg( g, f, c, s, r )
469 r = ( d( i+1 )-g )*s + two*c*b
476 IF( icompz.GT.0 )
THEN
485 IF( icompz.GT.0 )
THEN
487 CALL slasr(
'R',
'V',
'F', n, mm, work( m ), work( n-1+m ),
510 IF( iscale.EQ.1 )
THEN
511 CALL slascl(
'G', 0, 0, ssfmax, anorm, lendsv-lsv+1, 1,
512 $ d( lsv ), n, info )
513 CALL slascl(
'G', 0, 0, ssfmax, anorm, lendsv-lsv, 1, e( lsv ),
515 ELSE IF( iscale.EQ.2 )
THEN
516 CALL slascl(
'G', 0, 0, ssfmin, anorm, lendsv-lsv+1, 1,
517 $ d( lsv ), n, info )
518 CALL slascl(
'G', 0, 0, ssfmin, anorm, lendsv-lsv, 1, e( lsv ),
536 IF( icompz.EQ.0 )
THEN
540 CALL slasrt(
'I', n, d, info )
551 IF( d( j ).LT.p )
THEN
559 CALL sswap( n, z( 1, i ), 1, z( 1, k ), 1 )
subroutine xerbla(srname, info)
subroutine slae2(a, b, c, rt1, rt2)
SLAE2 computes the eigenvalues of a 2-by-2 symmetric matrix.
subroutine slaev2(a, b, c, rt1, rt2, cs1, sn1)
SLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix.
subroutine slartg(f, g, c, s, r)
SLARTG generates a plane rotation with real cosine and real sine.
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 slaset(uplo, m, n, alpha, beta, a, lda)
SLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine slasr(side, pivot, direct, m, n, c, s, a, lda)
SLASR applies a sequence of plane rotations to a general rectangular matrix.
subroutine slasrt(id, n, d, info)
SLASRT sorts numbers in increasing or decreasing order.
subroutine ssteqr(compz, n, d, e, z, ldz, work, info)
SSTEQR
subroutine sswap(n, sx, incx, sy, incy)
SSWAP