1 SUBROUTINE dsteqr( COMPZ, N, D, E, Z, LDZ, WORK, INFO )
13 DOUBLE PRECISION D( * ), E( * ), WORK( * ), Z( LDZ, * )
79 DOUBLE PRECISION ZERO, ONE, TWO, THREE
80 parameter( zero = 0.0d0, one = 1.0d0, two = 2.0d0,
83 parameter( maxit = 30 )
86 INTEGER I, ICOMPZ, II, ISCALE, J, JTOT, K, L, L1, LEND,
87 $ LENDM1, LENDP1, LENDSV, LM1, LSV, M, MM, MM1,
89 DOUBLE PRECISION ANORM, B, C, EPS, EPS2, F, G, P, R, RT1, RT2,
90 $ S, SAFMAX, SAFMIN, SSFMAX, SSFMIN, TST
94 DOUBLE PRECISION DLAMCH, DLANST, DLAPY2
95 EXTERNAL lsame, dlamch, dlanst, dlapy2
102 INTRINSIC abs, max, sign, sqrt
110 IF( lsame( compz,
'N' ) )
THEN
112 ELSE IF( lsame( compz,
'V' ) )
THEN
114 ELSE IF( lsame( compz,
'I' ) )
THEN
119 IF( icompz.LT.0 )
THEN
121 ELSE IF( n.LT.0 )
THEN
123 ELSE IF( ( ldz.LT.1 ) .OR. ( icompz.GT.0 .AND. ldz.LT.max( 1,
128 CALL xerbla(
'DSTEQR', -info )
147 safmin = dlamch(
'S' )
148 safmax = one / safmin
149 ssfmax = sqrt( safmax ) / three
150 ssfmin = sqrt( safmin ) / eps2
156 $
CALL dlaset(
'Full', n, n, zero, one, z, ldz )
178 IF( tst.LE.( sqrt( abs( d( m ) ) )*sqrt( abs( d( m+
179 $ 1 ) ) ) )*eps )
THEN
198 anorm = dlanst(
'I', lend-l+1, d( l ), e( l ) )
202 IF( anorm.GT.ssfmax )
THEN
204 CALL dlascl(
'G', 0, 0, anorm, ssfmax, lend-l+1, 1, d( l ), n,
206 CALL dlascl(
'G', 0, 0, anorm, ssfmax, lend-l, 1, e( l ), n,
208 ELSE IF( anorm.LT.ssfmin )
THEN
210 CALL dlascl(
'G', 0, 0, anorm, ssfmin, lend-l+1, 1, d( l ), n,
212 CALL dlascl(
'G', 0, 0, anorm, ssfmin, lend-l, 1, e( l ), n,
218 IF( abs( d( lend ) ).LT.abs( d( l ) ) )
THEN
233 tst = abs( e( m ) )**2
234 IF( tst.LE.( eps2*abs( d( m ) ) )*abs( d( m+1 ) )+
252 IF( icompz.GT.0 )
THEN
253 CALL dlaev2( d( l ), e( l ), d( l+1 ), rt1, rt2, c, s )
256 CALL dlasr(
'R',
'V',
'B', n, 2, work( l ),
257 $ work( n-1+l ), z( 1, l ), ldz )
259 CALL dlae2( d( l ), e( l ), d( l+1 ), rt1, rt2 )
276 g = ( d( l+1 )-p ) / ( two*e( l ) )
278 g = d( m ) - p + ( e( l ) / ( g+sign( r, g ) ) )
290 CALL dlartg( g, f, c, s, r )
294 r = ( d( i )-g )*s + two*c*b
301 IF( icompz.GT.0 )
THEN
310 IF( icompz.GT.0 )
THEN
312 CALL dlasr(
'R',
'V',
'B', n, mm, work( l ), work( n-1+l ),
339 DO 100 m = l, lendp1, -1
340 tst = abs( e( m-1 ) )**2
341 IF( tst.LE.( eps2*abs( d( m ) ) )*abs( d( m-1 ) )+
359 IF( icompz.GT.0 )
THEN
360 CALL dlaev2( d( l-1 ), e( l-1 ), d( l ), rt1, rt2, c, s )
363 CALL dlasr(
'R',
'V',
'F', n, 2, work( m ),
364 $ work( n-1+m ), z( 1, l-1 ), ldz )
366 CALL dlae2( d( l-1 ), e( l-1 ), d( l ), rt1, rt2 )
383 g = ( d( l-1 )-p ) / ( two*e( l-1 ) )
385 g = d( m ) - p + ( e( l-1 ) / ( g+sign( r, g ) ) )
397 CALL dlartg( g, f, c, s, r )
401 r = ( d( i+1 )-g )*s + two*c*b
408 IF( icompz.GT.0 )
THEN
417 IF( icompz.GT.0 )
THEN
419 CALL dlasr(
'R',
'V',
'F', n, mm, work( m ), work( n-1+m ),
442 IF( iscale.EQ.1 )
THEN
443 CALL dlascl(
'G', 0, 0, ssfmax, anorm, lendsv-lsv+1, 1,
444 $ d( lsv ), n, info )
445 CALL dlascl(
'G', 0, 0, ssfmax, anorm, lendsv-lsv, 1, e( lsv ),
447 ELSE IF( iscale.EQ.2 )
THEN
448 CALL dlascl(
'G', 0, 0, ssfmin, anorm, lendsv-lsv+1, 1,
449 $ d( lsv ), n, info )
450 CALL dlascl(
'G', 0, 0, ssfmin, anorm, lendsv-lsv, 1, e( lsv ),
468 IF( icompz.EQ.0 )
THEN
472 CALL dlasrt(
'I', n, d, info )
483 IF( d( j ).LT.p )
THEN
491 CALL dswap( n, z( 1, i ), 1, z( 1, k ), 1 )
subroutine dlae2(A, B, C, RT1, RT2)
subroutine dlaev2(A, B, C, RT1, RT2, CS1, SN1)
subroutine dlartg(F, G, CS, SN, R)
subroutine dlascl(TYPE, KL, KU, CFROM, CTO, M, N, A, LDA, INFO)
subroutine dlaset(UPLO, M, N, ALPHA, BETA, A, LDA)
subroutine dlasr(SIDE, PIVOT, DIRECT, M, N, C, S, A, LDA)
subroutine dlasrt(ID, N, D, INFO)
subroutine dsteqr(COMPZ, N, D, E, Z, LDZ, WORK, INFO)
subroutine dswap(n, dx, incx, dy, incy)
subroutine xerbla(SRNAME, INFO)