149 SUBROUTINE dsptrd( UPLO, N, AP, D, E, TAU, INFO )
160 DOUBLE PRECISION AP( * ), D( * ), E( * ), TAU( * )
166 DOUBLE PRECISION ONE, ZERO, HALF
167 parameter( one = 1.0d0, zero = 0.0d0,
168 $ half = 1.0d0 / 2.0d0 )
172 INTEGER I, I1, I1I1, II
173 DOUBLE PRECISION ALPHA, TAUI
180 DOUBLE PRECISION DDOT
188 upper = lsame( uplo,
'U' )
189 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
191 ELSE IF( n.LT.0 )
THEN
195 CALL xerbla(
'DSPTRD', -info )
209 i1 = n*( n-1 ) / 2 + 1
210 DO 10 i = n - 1, 1, -1
215 CALL dlarfg( i, ap( i1+i-1 ), ap( i1 ), 1, taui )
216 e( i ) = ap( i1+i-1 )
218 IF( taui.NE.zero )
THEN
226 CALL dspmv( uplo, i, taui, ap, ap( i1 ), 1, zero, tau,
231 alpha = -half*taui*ddot( i, tau, 1, ap( i1 ), 1 )
232 CALL daxpy( i, alpha, ap( i1 ), 1, tau, 1 )
237 CALL dspr2( uplo, i, -one, ap( i1 ), 1, tau, 1, ap )
239 ap( i1+i-1 ) = e( i )
241 d( i+1 ) = ap( i1+i )
253 i1i1 = ii + n - i + 1
258 CALL dlarfg( n-i, ap( ii+1 ), ap( ii+2 ), 1, taui )
261 IF( taui.NE.zero )
THEN
269 CALL dspmv( uplo, n-i, taui, ap( i1i1 ), ap( ii+1 ), 1,
270 $ zero, tau( i ), 1 )
274 alpha = -half*taui*ddot( n-i, tau( i ), 1, ap( ii+1 ),
276 CALL daxpy( n-i, alpha, ap( ii+1 ), 1, tau( i ), 1 )
281 CALL dspr2( uplo, n-i, -one, ap( ii+1 ), 1, tau( i ), 1,
subroutine xerbla(srname, info)
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
subroutine dspmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
DSPMV
subroutine dspr2(uplo, n, alpha, x, incx, y, incy, ap)
DSPR2
subroutine dsptrd(uplo, n, ap, d, e, tau, info)
DSPTRD
subroutine dlarfg(n, alpha, x, incx, tau)
DLARFG generates an elementary reflector (Householder matrix).