196 SUBROUTINE zlatrd( UPLO, N, NB, A, LDA, E, TAU, W, LDW )
204 INTEGER LDA, LDW, N, NB
207 DOUBLE PRECISION E( * )
208 COMPLEX*16 A( LDA, * ), TAU( * ), W( LDW, * )
214 COMPLEX*16 ZERO, ONE, HALF
215 parameter( zero = ( 0.0d+0, 0.0d+0 ),
216 $ one = ( 1.0d+0, 0.0d+0 ),
217 $ half = ( 0.5d+0, 0.0d+0 ) )
230 EXTERNAL lsame, zdotc
242 IF( lsame( uplo,
'U' ) )
THEN
246 DO 10 i = n, n - nb + 1, -1
252 a( i, i ) = dble( a( i, i ) )
253 CALL zlacgv( n-i, w( i, iw+1 ), ldw )
254 CALL zgemv(
'No transpose', i, n-i, -one, a( 1, i+1 ),
255 $ lda, w( i, iw+1 ), ldw, one, a( 1, i ), 1 )
256 CALL zlacgv( n-i, w( i, iw+1 ), ldw )
257 CALL zlacgv( n-i, a( i, i+1 ), lda )
258 CALL zgemv(
'No transpose', i, n-i, -one, w( 1,
260 $ ldw, a( i, i+1 ), lda, one, a( 1, i ), 1 )
261 CALL zlacgv( n-i, a( i, i+1 ), lda )
262 a( i, i ) = dble( a( i, i ) )
270 CALL zlarfg( i-1, alpha, a( 1, i ), 1, tau( i-1 ) )
271 e( i-1 ) = dble( alpha )
276 CALL zhemv(
'Upper', i-1, one, a, lda, a( 1, i ), 1,
277 $ zero, w( 1, iw ), 1 )
279 CALL zgemv(
'Conjugate transpose', i-1, n-i, one,
280 $ w( 1, iw+1 ), ldw, a( 1, i ), 1, zero,
282 CALL zgemv(
'No transpose', i-1, n-i, -one,
283 $ a( 1, i+1 ), lda, w( i+1, iw ), 1, one,
285 CALL zgemv(
'Conjugate transpose', i-1, n-i, one,
286 $ a( 1, i+1 ), lda, a( 1, i ), 1, zero,
288 CALL zgemv(
'No transpose', i-1, n-i, -one,
289 $ w( 1, iw+1 ), ldw, w( i+1, iw ), 1, one,
292 CALL zscal( i-1, tau( i-1 ), w( 1, iw ), 1 )
293 alpha = -half*tau( i-1 )*zdotc( i-1, w( 1, iw ), 1,
295 CALL zaxpy( i-1, alpha, a( 1, i ), 1, w( 1, iw ), 1 )
307 a( i, i ) = dble( a( i, i ) )
308 CALL zlacgv( i-1, w( i, 1 ), ldw )
309 CALL zgemv(
'No transpose', n-i+1, i-1, -one, a( i, 1 ),
310 $ lda, w( i, 1 ), ldw, one, a( i, i ), 1 )
311 CALL zlacgv( i-1, w( i, 1 ), ldw )
312 CALL zlacgv( i-1, a( i, 1 ), lda )
313 CALL zgemv(
'No transpose', n-i+1, i-1, -one, w( i, 1 ),
314 $ ldw, a( i, 1 ), lda, one, a( i, i ), 1 )
315 CALL zlacgv( i-1, a( i, 1 ), lda )
316 a( i, i ) = dble( a( i, i ) )
323 CALL zlarfg( n-i, alpha, a( min( i+2, n ), i ), 1,
325 e( i ) = dble( alpha )
330 CALL zhemv(
'Lower', n-i, one, a( i+1, i+1 ), lda,
331 $ a( i+1, i ), 1, zero, w( i+1, i ), 1 )
332 CALL zgemv(
'Conjugate transpose', n-i, i-1, one,
333 $ w( i+1, 1 ), ldw, a( i+1, i ), 1, zero,
335 CALL zgemv(
'No transpose', n-i, i-1, -one, a( i+1,
337 $ lda, w( 1, i ), 1, one, w( i+1, i ), 1 )
338 CALL zgemv(
'Conjugate transpose', n-i, i-1, one,
339 $ a( i+1, 1 ), lda, a( i+1, i ), 1, zero,
341 CALL zgemv(
'No transpose', n-i, i-1, -one, w( i+1,
343 $ ldw, w( 1, i ), 1, one, w( i+1, i ), 1 )
344 CALL zscal( n-i, tau( i ), w( i+1, i ), 1 )
345 alpha = -half*tau( i )*zdotc( n-i, w( i+1, i ), 1,
347 CALL zaxpy( n-i, alpha, a( i+1, i ), 1, w( i+1, i ),