164 SUBROUTINE dlarft( DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT )
172 CHARACTER direct, storev
173 INTEGER k, ldt, ldv, n
176 DOUBLE PRECISION t( ldt, * ), tau( * ), v( ldv, * )
182 DOUBLE PRECISION one, zero
183 parameter( one = 1.0d+0, zero = 0.0d+0 )
186 INTEGER i, j, prevlastv, lastv
202 IF(
lsame( direct,
'F' ) )
THEN
205 prevlastv = max( i, prevlastv )
206 IF( tau( i ).EQ.zero )
THEN
217 IF(
lsame( storev,
'C' ) )
THEN
219 DO lastv = n, i+1, -1
220 IF( v( lastv, i ).NE.zero ) exit
223 t( j, i ) = -tau( i ) * v( i , j )
225 j = min( lastv, prevlastv )
229 CALL
dgemv(
'Transpose', j-i, i-1, -tau( i ),
230 $ v( i+1, 1 ), ldv, v( i+1, i ), 1, one,
234 DO lastv = n, i+1, -1
235 IF( v( i, lastv ).NE.zero ) exit
238 t( j, i ) = -tau( i ) * v( j , i )
240 j = min( lastv, prevlastv )
244 CALL
dgemv(
'No transpose', i-1, j-i, -tau( i ),
245 $ v( 1, i+1 ), ldv, v( i, i+1 ), ldv, one,
251 CALL
dtrmv(
'Upper',
'No transpose',
'Non-unit', i-1, t,
252 $ ldt, t( 1, i ), 1 )
255 prevlastv = max( prevlastv, lastv )
264 IF( tau( i ).EQ.zero )
THEN
276 IF(
lsame( storev,
'C' ) )
THEN
279 IF( v( lastv, i ).NE.zero ) exit
282 t( j, i ) = -tau( i ) * v( n-k+i , j )
284 j = max( lastv, prevlastv )
288 CALL
dgemv(
'Transpose', n-k+i-j, k-i, -tau( i ),
289 $ v( j, i+1 ), ldv, v( j, i ), 1, one,
294 IF( v( i, lastv ).NE.zero ) exit
297 t( j, i ) = -tau( i ) * v( j, n-k+i )
299 j = max( lastv, prevlastv )
303 CALL
dgemv(
'No transpose', k-i, n-k+i-j,
304 $ -tau( i ), v( i+1, j ), ldv, v( i, j ), ldv,
305 $ one, t( i+1, i ), 1 )
310 CALL
dtrmv(
'Lower',
'No transpose',
'Non-unit', k-i,
311 $ t( i+1, i+1 ), ldt, t( i+1, i ), 1 )
313 prevlastv = min( prevlastv, lastv )