172 SUBROUTINE chetd2( UPLO, N, A, LDA, D, E, TAU, INFO )
184 COMPLEX A( LDA, * ), TAU( * )
190 COMPLEX ONE, ZERO, HALF
191 parameter( one = ( 1.0e+0, 0.0e+0 ),
192 $ zero = ( 0.0e+0, 0.0e+0 ),
193 $ half = ( 0.5e+0, 0.0e+0 ) )
206 EXTERNAL lsame, cdotc
209 INTRINSIC max, min, real
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(
'CHETD2', -info )
238 a( n, n ) = real( a( n, n ) )
239 DO 10 i = n - 1, 1, -1
245 CALL clarfg( i, alpha, a( 1, i+1 ), 1, taui )
246 e( i ) = real( alpha )
248 IF( taui.NE.zero )
THEN
256 CALL chemv( uplo, i, taui, a, lda, a( 1, i+1 ), 1,
262 alpha = -half*taui*cdotc( i, tau, 1, a( 1, i+1 ), 1 )
263 CALL caxpy( i, alpha, a( 1, i+1 ), 1, tau, 1 )
268 CALL cher2( uplo, i, -one, a( 1, i+1 ), 1, tau, 1, a,
272 a( i, i ) = real( a( i, i ) )
275 d( i+1 ) = real( a( i+1, i+1 ) )
278 d( 1 ) = real( a( 1, 1 ) )
283 a( 1, 1 ) = real( a( 1, 1 ) )
290 CALL clarfg( n-i, alpha, a( min( i+2, n ), i ), 1, taui )
291 e( i ) = real( alpha )
293 IF( taui.NE.zero )
THEN
301 CALL chemv( uplo, n-i, taui, a( i+1, i+1 ), lda,
302 $ a( i+1, i ), 1, zero, tau( i ), 1 )
306 alpha = -half*taui*cdotc( n-i, tau( i ), 1, a( i+1,
309 CALL caxpy( n-i, alpha, a( i+1, i ), 1, tau( i ), 1 )
314 CALL cher2( uplo, n-i, -one, a( i+1, i ), 1, tau( i ),
316 $ a( i+1, i+1 ), lda )
319 a( i+1, i+1 ) = real( a( i+1, i+1 ) )
322 d( i ) = real( a( i, i ) )
325 d( n ) = real( a( n, n ) )
subroutine chetd2(uplo, n, a, lda, d, e, tau, info)
CHETD2 reduces a Hermitian matrix to real symmetric tridiagonal form by an unitary similarity transfo...