198 SUBROUTINE clatrd( UPLO, N, NB, A, LDA, E, TAU, W, LDW )
206 INTEGER LDA, LDW, N, NB
210 COMPLEX A( LDA, * ), TAU( * ), W( LDW, * )
216 COMPLEX ZERO, ONE, HALF
217 parameter( zero = ( 0.0e+0, 0.0e+0 ),
218 $ one = ( 1.0e+0, 0.0e+0 ),
219 $ half = ( 0.5e+0, 0.0e+0 ) )
231 EXTERNAL lsame, cdotc
243 IF( lsame( uplo,
'U' ) )
THEN
247 DO 10 i = n, n - nb + 1, -1
253 a( i, i ) = real( a( i, i ) )
254 CALL clacgv( n-i, w( i, iw+1 ), ldw )
255 CALL cgemv(
'No transpose', i, n-i, -one, a( 1, i+1 ),
256 $ lda, w( i, iw+1 ), ldw, one, a( 1, i ), 1 )
257 CALL clacgv( n-i, w( i, iw+1 ), ldw )
258 CALL clacgv( n-i, a( i, i+1 ), lda )
259 CALL cgemv(
'No transpose', i, n-i, -one, w( 1, iw+1 ),
260 $ ldw, a( i, i+1 ), lda, one, a( 1, i ), 1 )
261 CALL clacgv( n-i, a( i, i+1 ), lda )
262 a( i, i ) = real( a( i, i ) )
270 CALL clarfg( i-1, alpha, a( 1, i ), 1, tau( i-1 ) )
271 e( i-1 ) = real( alpha )
276 CALL chemv(
'Upper', i-1, one, a, lda, a( 1, i ), 1,
277 $ zero, w( 1, iw ), 1 )
279 CALL cgemv(
'Conjugate transpose', i-1, n-i, one,
280 $ w( 1, iw+1 ), ldw, a( 1, i ), 1, zero,
282 CALL cgemv(
'No transpose', i-1, n-i, -one,
283 $ a( 1, i+1 ), lda, w( i+1, iw ), 1, one,
285 CALL cgemv(
'Conjugate transpose', i-1, n-i, one,
286 $ a( 1, i+1 ), lda, a( 1, i ), 1, zero,
288 CALL cgemv(
'No transpose', i-1, n-i, -one,
289 $ w( 1, iw+1 ), ldw, w( i+1, iw ), 1, one,
292 CALL cscal( i-1, tau( i-1 ), w( 1, iw ), 1 )
293 alpha = -half*tau( i-1 )*cdotc( i-1, w( 1, iw ), 1,
295 CALL caxpy( i-1, alpha, a( 1, i ), 1, w( 1, iw ), 1 )
307 a( i, i ) = real( a( i, i ) )
308 CALL clacgv( i-1, w( i, 1 ), ldw )
309 CALL cgemv(
'No transpose', n-i+1, i-1, -one, a( i, 1 ),
310 $ lda, w( i, 1 ), ldw, one, a( i, i ), 1 )
311 CALL clacgv( i-1, w( i, 1 ), ldw )
312 CALL clacgv( i-1, a( i, 1 ), lda )
313 CALL cgemv(
'No transpose', n-i+1, i-1, -one, w( i, 1 ),
314 $ ldw, a( i, 1 ), lda, one, a( i, i ), 1 )
315 CALL clacgv( i-1, a( i, 1 ), lda )
316 a( i, i ) = real( a( i, i ) )
323 CALL clarfg( n-i, alpha, a( min( i+2, n ), i ), 1,
325 e( i ) = real( alpha )
330 CALL chemv(
'Lower', n-i, one, a( i+1, i+1 ), lda,
331 $ a( i+1, i ), 1, zero, w( i+1, i ), 1 )
332 CALL cgemv(
'Conjugate transpose', n-i, i-1, one,
333 $ w( i+1, 1 ), ldw, a( i+1, i ), 1, zero,
335 CALL cgemv(
'No transpose', n-i, i-1, -one, a( i+1, 1 ),
336 $ lda, w( 1, i ), 1, one, w( i+1, i ), 1 )
337 CALL cgemv(
'Conjugate transpose', n-i, i-1, one,
338 $ a( i+1, 1 ), lda, a( i+1, i ), 1, zero,
340 CALL cgemv(
'No transpose', n-i, i-1, -one, w( i+1, 1 ),
341 $ ldw, w( 1, i ), 1, one, w( i+1, i ), 1 )
342 CALL cscal( n-i, tau( i ), w( i+1, i ), 1 )
343 alpha = -half*tau( i )*cdotc( n-i, w( i+1, i ), 1,
345 CALL caxpy( n-i, alpha, a( i+1, i ), 1, w( i+1, i ), 1 )
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine chemv(uplo, n, alpha, a, lda, x, incx, beta, y, incy)
CHEMV
subroutine clacgv(n, x, incx)
CLACGV conjugates a complex vector.
subroutine clarfg(n, alpha, x, incx, tau)
CLARFG generates an elementary reflector (Householder matrix).
subroutine clatrd(uplo, n, nb, a, lda, e, tau, w, ldw)
CLATRD reduces the first nb rows and columns of a symmetric/Hermitian matrix A to real tridiagonal fo...
subroutine cscal(n, ca, cx, incx)
CSCAL