130 SUBROUTINE dsteqr( COMPZ, N, D, E, Z, LDZ, WORK, INFO )
141 DOUBLE PRECISION D( * ), E( * ), WORK( * ), Z( LDZ, * )
147 DOUBLE PRECISION ZERO, ONE, TWO, THREE
148 parameter( zero = 0.0d0, one = 1.0d0, two = 2.0d0,
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 DOUBLE PRECISION ANORM, B, C, EPS, EPS2, F, G, P, R, RT1, RT2,
158 $ S, SAFMAX, SAFMIN, SSFMAX, SSFMIN, TST
162 DOUBLE PRECISION DLAMCH, DLANST, DLAPY2
163 EXTERNAL lsame, dlamch, dlanst, dlapy2
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(
'DSTEQR', -info )
215 safmin = dlamch(
'S' )
216 safmax = one / safmin
217 ssfmax = sqrt( safmax ) / three
218 ssfmin = sqrt( safmin ) / eps2
224 $
CALL dlaset(
'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 = dlanst(
'M', lend-l+1, d( l ), e( l ) )
270 IF( anorm.GT.ssfmax )
THEN
272 CALL dlascl(
'G', 0, 0, anorm, ssfmax, lend-l+1, 1, d( l ), n,
274 CALL dlascl(
'G', 0, 0, anorm, ssfmax, lend-l, 1, e( l ), n,
276 ELSE IF( anorm.LT.ssfmin )
THEN
278 CALL dlascl(
'G', 0, 0, anorm, ssfmin, lend-l+1, 1, d( l ), n,
280 CALL dlascl(
'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 dlaev2( d( l ), e( l ), d( l+1 ), rt1, rt2, c, s )
324 CALL dlasr(
'R',
'V',
'B', n, 2, work( l ),
325 $ work( n-1+l ), z( 1, l ), ldz )
327 CALL dlae2( 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 dlartg( 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 dlasr(
'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 dlaev2( d( l-1 ), e( l-1 ), d( l ), rt1, rt2, c, s )
431 CALL dlasr(
'R',
'V',
'F', n, 2, work( m ),
432 $ work( n-1+m ), z( 1, l-1 ), ldz )
434 CALL dlae2( 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 dlartg( 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 dlasr(
'R',
'V',
'F', n, mm, work( m ), work( n-1+m ),
510 IF( iscale.EQ.1 )
THEN
511 CALL dlascl(
'G', 0, 0, ssfmax, anorm, lendsv-lsv+1, 1,
512 $ d( lsv ), n, info )
513 CALL dlascl(
'G', 0, 0, ssfmax, anorm, lendsv-lsv, 1, e( lsv ),
515 ELSE IF( iscale.EQ.2 )
THEN
516 CALL dlascl(
'G', 0, 0, ssfmin, anorm, lendsv-lsv+1, 1,
517 $ d( lsv ), n, info )
518 CALL dlascl(
'G', 0, 0, ssfmin, anorm, lendsv-lsv, 1, e( lsv ),
536 IF( icompz.EQ.0 )
THEN
540 CALL dlasrt(
'I', n, d, info )
551 IF( d( j ).LT.p )
THEN
559 CALL dswap( n, z( 1, i ), 1, z( 1, k ), 1 )
subroutine xerbla(srname, info)
subroutine dlae2(a, b, c, rt1, rt2)
DLAE2 computes the eigenvalues of a 2-by-2 symmetric matrix.
subroutine dlaev2(a, b, c, rt1, rt2, cs1, sn1)
DLAEV2 computes the eigenvalues and eigenvectors of a 2-by-2 symmetric/Hermitian matrix.
subroutine dlartg(f, g, c, s, r)
DLARTG generates a plane rotation with real cosine and real sine.
subroutine dlascl(type, kl, ku, cfrom, cto, m, n, a, lda, info)
DLASCL multiplies a general rectangular matrix by a real scalar defined as cto/cfrom.
subroutine dlaset(uplo, m, n, alpha, beta, a, lda)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine dlasr(side, pivot, direct, m, n, c, s, a, lda)
DLASR applies a sequence of plane rotations to a general rectangular matrix.
subroutine dlasrt(id, n, d, info)
DLASRT sorts numbers in increasing or decreasing order.
subroutine dsteqr(compz, n, d, e, z, ldz, work, info)
DSTEQR
subroutine dswap(n, dx, incx, dy, incy)
DSWAP