192 SUBROUTINE dlarfb( SIDE, TRANS, DIRECT, STOREV, M, N, K, V,
194 $ T, LDT, C, LDC, WORK, LDWORK )
201 CHARACTER DIRECT, SIDE, STOREV, TRANS
202 INTEGER K, LDC, LDT, LDV, LDWORK, M, N
205 DOUBLE PRECISION C( LDC, * ), T( LDT, * ), V( LDV, * ),
213 PARAMETER ( ONE = 1.0d+0 )
230 IF( m.LE.0 .OR. n.LE.0 )
233 IF( lsame( trans,
'N' ) )
THEN
239 IF( lsame( storev,
'C' ) )
THEN
241 IF( lsame( direct,
'F' ) )
THEN
247 IF( lsame( side,
'L' ) )
THEN
257 CALL dcopy( n, c( j, 1 ), ldc, work( 1, j ), 1 )
262 CALL dtrmm(
'Right',
'Lower',
'No transpose',
'Unit',
264 $ k, one, v, ldv, work, ldwork )
269 CALL dgemm(
'Transpose',
'No transpose', n, k, m-k,
270 $ one, c( k+1, 1 ), ldc, v( k+1, 1 ), ldv,
271 $ one, work, ldwork )
276 CALL dtrmm(
'Right',
'Upper', transt,
'Non-unit', n,
278 $ one, t, ldt, work, ldwork )
286 CALL dgemm(
'No transpose',
'Transpose', m-k, n, k,
287 $ -one, v( k+1, 1 ), ldv, work, ldwork, one,
293 CALL dtrmm(
'Right',
'Lower',
'Transpose',
'Unit', n,
295 $ one, v, ldv, work, ldwork )
301 c( j, i ) = c( j, i ) - work( i, j )
305 ELSE IF( lsame( side,
'R' ) )
THEN
314 CALL dcopy( m, c( 1, j ), 1, work( 1, j ), 1 )
319 CALL dtrmm(
'Right',
'Lower',
'No transpose',
'Unit',
321 $ k, one, v, ldv, work, ldwork )
326 CALL dgemm(
'No transpose',
'No transpose', m, k,
328 $ one, c( 1, k+1 ), ldc, v( k+1, 1 ), ldv,
329 $ one, work, ldwork )
334 CALL dtrmm(
'Right',
'Upper', trans,
'Non-unit', m, k,
335 $ one, t, ldt, work, ldwork )
343 CALL dgemm(
'No transpose',
'Transpose', m, n-k, k,
344 $ -one, work, ldwork, v( k+1, 1 ), ldv, one,
350 CALL dtrmm(
'Right',
'Lower',
'Transpose',
'Unit', m,
352 $ one, v, ldv, work, ldwork )
358 c( i, j ) = c( i, j ) - work( i, j )
369 IF( lsame( side,
'L' ) )
THEN
379 CALL dcopy( n, c( m-k+j, 1 ), ldc, work( 1, j ),
385 CALL dtrmm(
'Right',
'Upper',
'No transpose',
'Unit',
387 $ k, one, v( m-k+1, 1 ), ldv, work, ldwork )
392 CALL dgemm(
'Transpose',
'No transpose', n, k, m-k,
393 $ one, c, ldc, v, ldv, one, work, ldwork )
398 CALL dtrmm(
'Right',
'Lower', transt,
'Non-unit', n,
400 $ one, t, ldt, work, ldwork )
408 CALL dgemm(
'No transpose',
'Transpose', m-k, n, k,
409 $ -one, v, ldv, work, ldwork, one, c, ldc )
414 CALL dtrmm(
'Right',
'Upper',
'Transpose',
'Unit', n,
416 $ one, v( m-k+1, 1 ), ldv, work, ldwork )
422 c( m-k+j, i ) = c( m-k+j, i ) - work( i, j )
426 ELSE IF( lsame( side,
'R' ) )
THEN
435 CALL dcopy( m, c( 1, n-k+j ), 1, work( 1, j ), 1 )
440 CALL dtrmm(
'Right',
'Upper',
'No transpose',
'Unit',
442 $ k, one, v( n-k+1, 1 ), ldv, work, ldwork )
447 CALL dgemm(
'No transpose',
'No transpose', m, k,
449 $ one, c, ldc, v, ldv, one, work, ldwork )
454 CALL dtrmm(
'Right',
'Lower', trans,
'Non-unit', m, k,
455 $ one, t, ldt, work, ldwork )
463 CALL dgemm(
'No transpose',
'Transpose', m, n-k, k,
464 $ -one, work, ldwork, v, ldv, one, c, ldc )
469 CALL dtrmm(
'Right',
'Upper',
'Transpose',
'Unit', m,
471 $ one, v( n-k+1, 1 ), ldv, work, ldwork )
477 c( i, n-k+j ) = c( i, n-k+j ) - work( i, j )
483 ELSE IF( lsame( storev,
'R' ) )
THEN
485 IF( lsame( direct,
'F' ) )
THEN
490 IF( lsame( side,
'L' ) )
THEN
500 CALL dcopy( n, c( j, 1 ), ldc, work( 1, j ), 1 )
505 CALL dtrmm(
'Right',
'Upper',
'Transpose',
'Unit', n,
507 $ one, v, ldv, work, ldwork )
512 CALL dgemm(
'Transpose',
'Transpose', n, k, m-k,
514 $ c( k+1, 1 ), ldc, v( 1, k+1 ), ldv, one,
520 CALL dtrmm(
'Right',
'Upper', transt,
'Non-unit', n,
522 $ one, t, ldt, work, ldwork )
530 CALL dgemm(
'Transpose',
'Transpose', m-k, n, k,
532 $ v( 1, k+1 ), ldv, work, ldwork, one,
538 CALL dtrmm(
'Right',
'Upper',
'No transpose',
'Unit',
540 $ k, one, v, ldv, work, ldwork )
546 c( j, i ) = c( j, i ) - work( i, j )
550 ELSE IF( lsame( side,
'R' ) )
THEN
559 CALL dcopy( m, c( 1, j ), 1, work( 1, j ), 1 )
564 CALL dtrmm(
'Right',
'Upper',
'Transpose',
'Unit', m,
566 $ one, v, ldv, work, ldwork )
571 CALL dgemm(
'No transpose',
'Transpose', m, k, n-k,
572 $ one, c( 1, k+1 ), ldc, v( 1, k+1 ), ldv,
573 $ one, work, ldwork )
578 CALL dtrmm(
'Right',
'Upper', trans,
'Non-unit', m, k,
579 $ one, t, ldt, work, ldwork )
587 CALL dgemm(
'No transpose',
'No transpose', m, n-k,
589 $ -one, work, ldwork, v( 1, k+1 ), ldv, one,
595 CALL dtrmm(
'Right',
'Upper',
'No transpose',
'Unit',
597 $ k, one, v, ldv, work, ldwork )
603 c( i, j ) = c( i, j ) - work( i, j )
614 IF( lsame( side,
'L' ) )
THEN
624 CALL dcopy( n, c( m-k+j, 1 ), ldc, work( 1, j ),
630 CALL dtrmm(
'Right',
'Lower',
'Transpose',
'Unit', n,
632 $ one, v( 1, m-k+1 ), ldv, work, ldwork )
637 CALL dgemm(
'Transpose',
'Transpose', n, k, m-k,
639 $ c, ldc, v, ldv, one, work, ldwork )
644 CALL dtrmm(
'Right',
'Lower', transt,
'Non-unit', n,
646 $ one, t, ldt, work, ldwork )
654 CALL dgemm(
'Transpose',
'Transpose', m-k, n, k,
656 $ v, ldv, work, ldwork, one, c, ldc )
661 CALL dtrmm(
'Right',
'Lower',
'No transpose',
'Unit',
663 $ k, one, v( 1, m-k+1 ), ldv, work, ldwork )
669 c( m-k+j, i ) = c( m-k+j, i ) - work( i, j )
673 ELSE IF( lsame( side,
'R' ) )
THEN
682 CALL dcopy( m, c( 1, n-k+j ), 1, work( 1, j ), 1 )
687 CALL dtrmm(
'Right',
'Lower',
'Transpose',
'Unit', m,
689 $ one, v( 1, n-k+1 ), ldv, work, ldwork )
694 CALL dgemm(
'No transpose',
'Transpose', m, k, n-k,
695 $ one, c, ldc, v, ldv, one, work, ldwork )
700 CALL dtrmm(
'Right',
'Lower', trans,
'Non-unit', m, k,
701 $ one, t, ldt, work, ldwork )
709 CALL dgemm(
'No transpose',
'No transpose', m, n-k,
711 $ -one, work, ldwork, v, ldv, one, c, ldc )
716 CALL dtrmm(
'Right',
'Lower',
'No transpose',
'Unit',
718 $ k, one, v( 1, n-k+1 ), ldv, work, ldwork )
724 c( i, n-k+j ) = c( i, n-k+j ) - work( i, j )