162 SUBROUTINE clarft( DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT )
169 CHARACTER DIRECT, STOREV
170 INTEGER K, LDT, LDV, N
173 COMPLEX T( LDT, * ), TAU( * ), V( LDV, * )
180 parameter( one = ( 1.0e+0, 0.0e+0 ),
181 $ zero = ( 0.0e+0, 0.0e+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 cgemv(
'Conjugate transpose', j-i, i-1,
228 $ -tau( i ), v( i+1, 1 ), ldv,
230 $ one, t( 1, i ), 1 )
233 DO lastv = n, i+1, -1
234 IF( v( i, lastv ).NE.zero )
EXIT
237 t( j, i ) = -tau( i ) * v( j , i )
239 j = min( lastv, prevlastv )
243 CALL cgemm(
'N',
'C', i-1, 1, j-i, -tau( i ),
244 $ v( 1, i+1 ), ldv, v( i, i+1 ), ldv,
245 $ one, t( 1, i ), ldt )
250 CALL ctrmv(
'Upper',
'No transpose',
'Non-unit', i-1, t,
251 $ ldt, t( 1, i ), 1 )
254 prevlastv = max( prevlastv, lastv )
263 IF( tau( i ).EQ.zero )
THEN
275 IF( lsame( storev,
'C' ) )
THEN
278 IF( v( lastv, i ).NE.zero )
EXIT
281 t( j, i ) = -tau( i ) * conjg( v( n-k+i , j ) )
283 j = max( lastv, prevlastv )
287 CALL cgemv(
'Conjugate transpose', n-k+i-j, k-i,
288 $ -tau( i ), v( j, i+1 ), ldv, v( j, i ),
289 $ 1, one, t( i+1, i ), 1 )
293 IF( v( i, lastv ).NE.zero )
EXIT
296 t( j, i ) = -tau( i ) * v( j, n-k+i )
298 j = max( lastv, prevlastv )
302 CALL cgemm(
'N',
'C', k-i, 1, n-k+i-j, -tau( i ),
303 $ v( i+1, j ), ldv, v( i, j ), ldv,
304 $ one, t( i+1, i ), ldt )
309 CALL ctrmv(
'Lower',
'No transpose',
'Non-unit', k-i,
310 $ t( i+1, i+1 ), ldt, t( i+1, i ), 1 )
312 prevlastv = min( prevlastv, lastv )
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine clarft(direct, storev, n, k, v, ldv, tau, t, ldt)
CLARFT forms the triangular factor T of a block reflector H = I - vtvH
subroutine ctrmv(uplo, trans, diag, n, a, lda, x, incx)
CTRMV