150 SUBROUTINE zhptrd( UPLO, N, AP, D, E, TAU, INFO )
161 DOUBLE PRECISION D( * ), E( * )
162 COMPLEX*16 AP( * ), TAU( * )
168 COMPLEX*16 ONE, ZERO, HALF
169 parameter( one = ( 1.0d+0, 0.0d+0 ),
170 $ zero = ( 0.0d+0, 0.0d+0 ),
171 $ half = ( 0.5d+0, 0.0d+0 ) )
175 INTEGER I, I1, I1I1, II
176 COMPLEX*16 ALPHA, TAUI
184 EXTERNAL lsame, zdotc
194 upper = lsame( uplo,
'U' )
195 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
197 ELSE IF( n.LT.0 )
THEN
201 CALL xerbla(
'ZHPTRD', -info )
215 i1 = n*( n-1 ) / 2 + 1
216 ap( i1+n-1 ) = dble( ap( i1+n-1 ) )
217 DO 10 i = n - 1, 1, -1
223 CALL zlarfg( i, alpha, ap( i1 ), 1, taui )
224 e( i ) = dble( alpha )
226 IF( taui.NE.zero )
THEN
234 CALL zhpmv( uplo, i, taui, ap, ap( i1 ), 1, zero, tau,
239 alpha = -half*taui*zdotc( i, tau, 1, ap( i1 ), 1 )
240 CALL zaxpy( i, alpha, ap( i1 ), 1, tau, 1 )
245 CALL zhpr2( uplo, i, -one, ap( i1 ), 1, tau, 1, ap )
248 ap( i1+i-1 ) = e( i )
249 d( i+1 ) = dble( ap( i1+i ) )
253 d( 1 ) = dble( ap( 1 ) )
260 ap( 1 ) = dble( ap( 1 ) )
262 i1i1 = ii + n - i + 1
268 CALL zlarfg( n-i, alpha, ap( ii+2 ), 1, taui )
269 e( i ) = dble( alpha )
271 IF( taui.NE.zero )
THEN
279 CALL zhpmv( uplo, n-i, taui, ap( i1i1 ), ap( ii+1 ), 1,
280 $ zero, tau( i ), 1 )
284 alpha = -half*taui*zdotc( n-i, tau( i ), 1, ap( ii+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 ), 1,
296 d( i ) = dble( ap( ii ) )
300 d( n ) = dble( ap( ii ) )
subroutine xerbla(srname, info)
subroutine zaxpy(n, za, zx, incx, zy, incy)
ZAXPY
subroutine zhpmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
ZHPMV
subroutine zhpr2(uplo, n, alpha, x, incx, y, incy, ap)
ZHPR2
subroutine zhptrd(uplo, n, ap, d, e, tau, info)
ZHPTRD
subroutine zlarfg(n, alpha, x, incx, tau)
ZLARFG generates an elementary reflector (Householder matrix).