150 SUBROUTINE chptrd( UPLO, N, AP, D, E, TAU, INFO )
162 COMPLEX AP( * ), TAU( * )
168 COMPLEX ONE, ZERO, HALF
169 parameter( one = ( 1.0e+0, 0.0e+0 ),
170 $ zero = ( 0.0e+0, 0.0e+0 ),
171 $ half = ( 0.5e+0, 0.0e+0 ) )
175 INTEGER I, I1, I1I1, II
184 EXTERNAL lsame, cdotc
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(
'CHPTRD', -info )
215 i1 = n*( n-1 ) / 2 + 1
216 ap( i1+n-1 ) = real( ap( i1+n-1 ) )
217 DO 10 i = n - 1, 1, -1
223 CALL clarfg( i, alpha, ap( i1 ), 1, taui )
224 e( i ) = real( alpha )
226 IF( taui.NE.zero )
THEN
234 CALL chpmv( uplo, i, taui, ap, ap( i1 ), 1, zero, tau,
239 alpha = -half*taui*cdotc( i, tau, 1, ap( i1 ), 1 )
240 CALL caxpy( i, alpha, ap( i1 ), 1, tau, 1 )
245 CALL chpr2( uplo, i, -one, ap( i1 ), 1, tau, 1, ap )
248 ap( i1+i-1 ) = e( i )
249 d( i+1 ) = real( ap( i1+i ) )
253 d( 1 ) = real( ap( 1 ) )
260 ap( 1 ) = real( ap( 1 ) )
262 i1i1 = ii + n - i + 1
268 CALL clarfg( n-i, alpha, ap( ii+2 ), 1, taui )
269 e( i ) = real( alpha )
271 IF( taui.NE.zero )
THEN
279 CALL chpmv( uplo, n-i, taui, ap( i1i1 ), ap( ii+1 ), 1,
280 $ zero, tau( i ), 1 )
284 alpha = -half*taui*cdotc( n-i, tau( i ), 1, ap( ii+1 ),
286 CALL caxpy( n-i, alpha, ap( ii+1 ), 1, tau( i ), 1 )
291 CALL chpr2( uplo, n-i, -one, ap( ii+1 ), 1, tau( i ), 1,
296 d( i ) = real( ap( ii ) )
300 d( n ) = real( ap( ii ) )
subroutine xerbla(srname, info)
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine chpmv(uplo, n, alpha, ap, x, incx, beta, y, incy)
CHPMV
subroutine chpr2(uplo, n, alpha, x, incx, y, incy, ap)
CHPR2
subroutine chptrd(uplo, n, ap, d, e, tau, info)
CHPTRD
subroutine clarfg(n, alpha, x, incx, tau)
CLARFG generates an elementary reflector (Householder matrix).