172 SUBROUTINE zhetd2( UPLO, N, A, LDA, D, E, TAU, INFO )
183 DOUBLE PRECISION D( * ), E( * )
184 COMPLEX*16 A( LDA, * ), TAU( * )
190 COMPLEX*16 ONE, ZERO, HALF
191 parameter( one = ( 1.0d+0, 0.0d+0 ),
192 $ zero = ( 0.0d+0, 0.0d+0 ),
193 $ half = ( 0.5d+0, 0.0d+0 ) )
198 COMPLEX*16 ALPHA, TAUI
206 EXTERNAL lsame, zdotc
209 INTRINSIC dble, max, min
216 upper = lsame( uplo,
'U')
217 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
219 ELSE IF( n.LT.0 )
THEN
221 ELSE IF( lda.LT.max( 1, n ) )
THEN
225 CALL xerbla(
'ZHETD2', -info )
238 a( n, n ) = dble( a( n, n ) )
239 DO 10 i = n - 1, 1, -1
245 CALL zlarfg( i, alpha, a( 1, i+1 ), 1, taui )
246 e( i ) = dble( alpha )
248 IF( taui.NE.zero )
THEN
256 CALL zhemv( uplo, i, taui, a, lda, a( 1, i+1 ), 1,
262 alpha = -half*taui*zdotc( i, tau, 1, a( 1, i+1 ), 1 )
263 CALL zaxpy( i, alpha, a( 1, i+1 ), 1, tau, 1 )
268 CALL zher2( uplo, i, -one, a( 1, i+1 ), 1, tau, 1, a,
272 a( i, i ) = dble( a( i, i ) )
275 d( i+1 ) = dble( a( i+1, i+1 ) )
278 d( 1 ) = dble( a( 1, 1 ) )
283 a( 1, 1 ) = dble( a( 1, 1 ) )
290 CALL zlarfg( n-i, alpha, a( min( i+2, n ), i ), 1, taui )
291 e( i ) = dble( alpha )
293 IF( taui.NE.zero )
THEN
301 CALL zhemv( uplo, n-i, taui, a( i+1, i+1 ), lda,
302 $ a( i+1, i ), 1, zero, tau( i ), 1 )
306 alpha = -half*taui*zdotc( n-i, tau( i ), 1, a( i+1,
309 CALL zaxpy( n-i, alpha, a( i+1, i ), 1, tau( i ), 1 )
314 CALL zher2( uplo, n-i, -one, a( i+1, i ), 1, tau( i ),
316 $ a( i+1, i+1 ), lda )
319 a( i+1, i+1 ) = dble( a( i+1, i+1 ) )
322 d( i ) = dble( a( i, i ) )
325 d( n ) = dble( a( n, n ) )
subroutine zhetd2(uplo, n, a, lda, d, e, tau, info)
ZHETD2 reduces a Hermitian matrix to real symmetric tridiagonal form by an unitary similarity transfo...