148 SUBROUTINE zhptrd( UPLO, N, AP, D, E, TAU, INFO )
159 DOUBLE PRECISION D( * ), E( * )
160 COMPLEX*16 AP( * ), TAU( * )
166 COMPLEX*16 ONE, ZERO, HALF
167 parameter( one = ( 1.0d+0, 0.0d+0 ),
168 $ zero = ( 0.0d+0, 0.0d+0 ),
169 $ half = ( 0.5d+0, 0.0d+0 ) )
173 INTEGER I, I1, I1I1, II
174 COMPLEX*16 ALPHA, TAUI
182 EXTERNAL lsame, zdotc
192 upper = lsame( uplo,
'U' )
193 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
195 ELSE IF( n.LT.0 )
THEN
199 CALL xerbla(
'ZHPTRD', -info )
213 i1 = n*( n-1 ) / 2 + 1
214 ap( i1+n-1 ) = dble( ap( i1+n-1 ) )
215 DO 10 i = n - 1, 1, -1
221 CALL zlarfg( i, alpha, ap( i1 ), 1, taui )
222 e( i ) = dble( alpha )
224 IF( taui.NE.zero )
THEN
232 CALL zhpmv( uplo, i, taui, ap, ap( i1 ), 1, zero, tau,
237 alpha = -half*taui*zdotc( i, tau, 1, ap( i1 ), 1 )
238 CALL zaxpy( i, alpha, ap( i1 ), 1, tau, 1 )
243 CALL zhpr2( uplo, i, -one, ap( i1 ), 1, tau, 1, ap )
246 ap( i1+i-1 ) = e( i )
247 d( i+1 ) = dble( ap( i1+i ) )
251 d( 1 ) = dble( ap( 1 ) )
258 ap( 1 ) = dble( ap( 1 ) )
260 i1i1 = ii + n - i + 1
266 CALL zlarfg( n-i, alpha, ap( ii+2 ), 1, taui )
267 e( i ) = dble( alpha )
269 IF( taui.NE.zero )
THEN
277 CALL zhpmv( uplo, n-i, taui, ap( i1i1 ), ap( ii+1 ),
279 $ zero, tau( i ), 1 )
283 alpha = -half*taui*zdotc( n-i, tau( i ), 1,
286 CALL zaxpy( n-i, alpha, ap( ii+1 ), 1, tau( i ), 1 )
291 CALL zhpr2( uplo, n-i, -one, ap( ii+1 ), 1, tau( i ),
297 d( i ) = dble( ap( ii ) )
301 d( n ) = dble( ap( ii ) )
subroutine zhpmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
ZHPMV
subroutine zhpr2(uplo, n, alpha, x, incx, y, incy, ap)
ZHPR2
subroutine zlarfg(n, alpha, x, incx, tau)
ZLARFG generates an elementary reflector (Householder matrix).