176 SUBROUTINE chetd2( UPLO, N, A, LDA, D, E, TAU, INFO )
189 COMPLEX A( lda, * ), TAU( * )
195 COMPLEX ONE, ZERO, HALF
196 parameter ( one = ( 1.0e+0, 0.0e+0 ),
197 $ zero = ( 0.0e+0, 0.0e+0 ),
198 $ half = ( 0.5e+0, 0.0e+0 ) )
211 EXTERNAL lsame, cdotc
214 INTRINSIC max, min, real
221 upper = lsame( uplo,
'U' )
222 IF( .NOT.upper .AND. .NOT.lsame( uplo,
'L' ) )
THEN
224 ELSE IF( n.LT.0 )
THEN
226 ELSE IF( lda.LT.max( 1, n ) )
THEN
230 CALL xerbla(
'CHETD2', -info )
243 a( n, n ) =
REAL( A( N, N ) )
244 DO 10 i = n - 1, 1, -1
250 CALL clarfg( i, alpha, a( 1, i+1 ), 1, taui )
253 IF( taui.NE.zero )
THEN
261 CALL chemv( uplo, i, taui, a, lda, a( 1, i+1 ), 1, zero,
266 alpha = -half*taui*cdotc( i, tau, 1, a( 1, i+1 ), 1 )
267 CALL caxpy( i, alpha, a( 1, i+1 ), 1, tau, 1 )
272 CALL cher2( uplo, i, -one, a( 1, i+1 ), 1, tau, 1, a,
276 a( i, i ) =
REAL( A( I, I ) )
279 d( i+1 ) = a( i+1, i+1 )
287 a( 1, 1 ) =
REAL( A( 1, 1 ) )
294 CALL clarfg( n-i, alpha, a( min( i+2, n ), i ), 1, taui )
297 IF( taui.NE.zero )
THEN
305 CALL chemv( uplo, n-i, taui, a( i+1, i+1 ), lda,
306 $ a( i+1, i ), 1, zero, tau( i ), 1 )
310 alpha = -half*taui*cdotc( n-i, tau( i ), 1, a( i+1, i ),
312 CALL caxpy( n-i, alpha, a( i+1, i ), 1, tau( i ), 1 )
317 CALL cher2( uplo, n-i, -one, a( i+1, i ), 1, tau( i ), 1,
318 $ a( i+1, i+1 ), lda )
321 a( i+1, i+1 ) =
REAL( A( I+1, I+1 ) )
subroutine xerbla(SRNAME, INFO)
XERBLA
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...
subroutine chemv(UPLO, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
CHEMV
subroutine cher2(UPLO, N, ALPHA, X, INCX, Y, INCY, A, LDA)
CHER2
subroutine caxpy(N, CA, CX, INCX, CY, INCY)
CAXPY
subroutine clarfg(N, ALPHA, X, INCX, TAU)
CLARFG generates an elementary reflector (Householder matrix).