164 SUBROUTINE zlarft( DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT )
172 CHARACTER direct, storev
173 INTEGER k, ldt, ldv, n
176 COMPLEX*16 t( ldt, * ), tau( * ), v( ldv, * )
183 parameter( one = ( 1.0d+0, 0.0d+0 ),
184 $ zero = ( 0.0d+0, 0.0d+0 ) )
187 INTEGER i, j, prevlastv, lastv
203 IF(
lsame( direct,
'F' ) )
THEN
206 prevlastv = max( prevlastv, i )
207 IF( tau( i ).EQ.zero )
THEN
218 IF(
lsame( storev,
'C' ) )
THEN
220 DO lastv = n, i+1, -1
221 IF( v( lastv, i ).NE.zero ) exit
224 t( j, i ) = -tau( i ) * conjg( v( i , j ) )
226 j = min( lastv, prevlastv )
230 CALL
zgemv(
'Conjugate transpose', j-i, i-1,
231 $ -tau( i ), v( i+1, 1 ), ldv,
232 $ v( i+1, i ), 1, one, t( 1, i ), 1 )
235 DO lastv = n, i+1, -1
236 IF( v( i, lastv ).NE.zero ) exit
239 t( j, i ) = -tau( i ) * v( j , i )
241 j = min( lastv, prevlastv )
245 CALL
zgemm(
'N',
'C', i-1, 1, j-i, -tau( i ),
246 $ v( 1, i+1 ), ldv, v( i, i+1 ), ldv,
247 $ one, t( 1, i ), ldt )
252 CALL
ztrmv(
'Upper',
'No transpose',
'Non-unit', i-1, t,
253 $ ldt, t( 1, i ), 1 )
256 prevlastv = max( prevlastv, lastv )
265 IF( tau( i ).EQ.zero )
THEN
277 IF(
lsame( storev,
'C' ) )
THEN
280 IF( v( lastv, i ).NE.zero ) exit
283 t( j, i ) = -tau( i ) * conjg( v( n-k+i , j ) )
285 j = max( lastv, prevlastv )
289 CALL
zgemv(
'Conjugate transpose', n-k+i-j, k-i,
290 $ -tau( i ), v( j, i+1 ), ldv, v( j, i ),
291 $ 1, one, t( i+1, i ), 1 )
295 IF( v( i, lastv ).NE.zero ) exit
298 t( j, i ) = -tau( i ) * v( j, n-k+i )
300 j = max( lastv, prevlastv )
304 CALL
zgemm(
'N',
'C', k-i, 1, n-k+i-j, -tau( i ),
305 $ v( i+1, j ), ldv, v( i, j ), ldv,
306 $ one, t( i+1, i ), ldt )
311 CALL
ztrmv(
'Lower',
'No transpose',
'Non-unit', k-i,
312 $ t( i+1, i+1 ), ldt, t( i+1, i ), 1 )
314 prevlastv = min( prevlastv, lastv )