174 SUBROUTINE zhetd2( UPLO, N, A, LDA, D, E, TAU, INFO )
185 DOUBLE PRECISION D( * ), E( * )
186 COMPLEX*16 A( LDA, * ), TAU( * )
192 COMPLEX*16 ONE, ZERO, HALF
193 parameter( one = ( 1.0d+0, 0.0d+0 ),
194 $ zero = ( 0.0d+0, 0.0d+0 ),
195 $ half = ( 0.5d+0, 0.0d+0 ) )
200 COMPLEX*16 ALPHA, TAUI
208 EXTERNAL lsame, zdotc
211 INTRINSIC dble, max, min
218 upper = lsame( uplo,
'U')
219 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
221 ELSE IF( n.LT.0 )
THEN
223 ELSE IF( lda.LT.max( 1, n ) )
THEN
227 CALL xerbla(
'ZHETD2', -info )
240 a( n, n ) = dble( a( n, n ) )
241 DO 10 i = n - 1, 1, -1
247 CALL zlarfg( i, alpha, a( 1, i+1 ), 1, taui )
248 e( i ) = dble( alpha )
250 IF( taui.NE.zero )
THEN
258 CALL zhemv( uplo, i, taui, a, lda, a( 1, i+1 ), 1, zero,
263 alpha = -half*taui*zdotc( i, tau, 1, a( 1, i+1 ), 1 )
264 CALL zaxpy( i, alpha, a( 1, i+1 ), 1, tau, 1 )
269 CALL zher2( uplo, i, -one, a( 1, i+1 ), 1, tau, 1, a,
273 a( i, i ) = dble( a( i, i ) )
276 d( i+1 ) = dble( a( i+1, i+1 ) )
279 d( 1 ) = dble( a( 1, 1 ) )
284 a( 1, 1 ) = dble( a( 1, 1 ) )
291 CALL zlarfg( n-i, alpha, a( min( i+2, n ), i ), 1, taui )
292 e( i ) = dble( alpha )
294 IF( taui.NE.zero )
THEN
302 CALL zhemv( uplo, n-i, taui, a( i+1, i+1 ), lda,
303 $ a( i+1, i ), 1, zero, tau( i ), 1 )
307 alpha = -half*taui*zdotc( n-i, tau( i ), 1, a( i+1, i ),
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 ), 1,
315 $ a( i+1, i+1 ), lda )
318 a( i+1, i+1 ) = dble( a( i+1, i+1 ) )
321 d( i ) = dble( a( i, i ) )
324 d( n ) = dble( a( n, n ) )
subroutine xerbla(srname, info)
subroutine zaxpy(n, za, zx, incx, zy, incy)
ZAXPY
subroutine zhemv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
ZHEMV
subroutine zher2(uplo, n, alpha, x, incx, y, incy, a, lda)
ZHER2
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...
subroutine zlarfg(n, alpha, x, incx, tau)
ZLARFG generates an elementary reflector (Householder matrix).