162 SUBROUTINE zlarft( DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT )
169 CHARACTER DIRECT, STOREV
170 INTEGER K, LDT, LDV, N
173 COMPLEX*16 T( LDT, * ), TAU( * ), V( LDV, * )
180 parameter( one = ( 1.0d+0, 0.0d+0 ),
181 $ zero = ( 0.0d+0, 0.0d+0 ) )
184 INTEGER I, J, PREVLASTV, LASTV
200 IF( lsame( direct,
'F' ) )
THEN
203 prevlastv = max( prevlastv, i )
204 IF( tau( i ).EQ.zero )
THEN
215 IF( lsame( storev,
'C' ) )
THEN
217 DO lastv = n, i+1, -1
218 IF( v( lastv, i ).NE.zero )
EXIT
221 t( j, i ) = -tau( i ) * conjg( v( i , j ) )
223 j = min( lastv, prevlastv )
227 CALL zgemv(
'Conjugate transpose', j-i, i-1,
228 $ -tau( i ), v( i+1, 1 ), ldv,
229 $ v( i+1, i ), 1, one, t( 1, i ), 1 )
232 DO lastv = n, i+1, -1
233 IF( v( i, lastv ).NE.zero )
EXIT
236 t( j, i ) = -tau( i ) * v( j , i )
238 j = min( lastv, prevlastv )
242 CALL zgemm(
'N',
'C', i-1, 1, j-i, -tau( i ),
243 $ v( 1, i+1 ), ldv, v( i, i+1 ), ldv,
244 $ one, t( 1, i ), ldt )
249 CALL ztrmv(
'Upper',
'No transpose',
'Non-unit', i-1, t,
250 $ ldt, t( 1, i ), 1 )
253 prevlastv = max( prevlastv, lastv )
262 IF( tau( i ).EQ.zero )
THEN
274 IF( lsame( storev,
'C' ) )
THEN
277 IF( v( lastv, i ).NE.zero )
EXIT
280 t( j, i ) = -tau( i ) * conjg( v( n-k+i , j ) )
282 j = max( lastv, prevlastv )
286 CALL zgemv(
'Conjugate transpose', n-k+i-j, k-i,
287 $ -tau( i ), v( j, i+1 ), ldv, v( j, i ),
288 $ 1, one, t( i+1, i ), 1 )
292 IF( v( i, lastv ).NE.zero )
EXIT
295 t( j, i ) = -tau( i ) * v( j, n-k+i )
297 j = max( lastv, prevlastv )
301 CALL zgemm(
'N',
'C', k-i, 1, n-k+i-j, -tau( i ),
302 $ v( i+1, j ), ldv, v( i, j ), ldv,
303 $ one, t( i+1, i ), ldt )
308 CALL ztrmv(
'Lower',
'No transpose',
'Non-unit', k-i,
309 $ t( i+1, i+1 ), ldt, t( i+1, i ), 1 )
311 prevlastv = min( prevlastv, lastv )
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
subroutine zlarft(direct, storev, n, k, v, ldv, tau, t, ldt)
ZLARFT forms the triangular factor T of a block reflector H = I - vtvH
subroutine ztrmv(uplo, trans, diag, n, a, lda, x, incx)
ZTRMV