192 SUBROUTINE clarfb( 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 COMPLEX C( LDC, * ), T( LDT, * ), V( LDV, * ),
213 PARAMETER ( ONE = ( 1.0e+0, 0.0e+0 ) )
233 IF( m.LE.0 .OR. n.LE.0 )
236 IF( lsame( trans,
'N' ) )
THEN
242 IF( lsame( storev,
'C' ) )
THEN
244 IF( lsame( direct,
'F' ) )
THEN
250 IF( lsame( side,
'L' ) )
THEN
260 CALL ccopy( n, c( j, 1 ), ldc, work( 1, j ), 1 )
261 CALL clacgv( n, work( 1, j ), 1 )
266 CALL ctrmm(
'Right',
'Lower',
'No transpose',
'Unit',
268 $ k, one, v, ldv, work, ldwork )
273 CALL cgemm(
'Conjugate transpose',
'No transpose',
275 $ k, m-k, one, c( k+1, 1 ), ldc,
276 $ v( k+1, 1 ), ldv, one, work, ldwork )
281 CALL ctrmm(
'Right',
'Upper', transt,
'Non-unit', n,
283 $ one, t, ldt, work, ldwork )
291 CALL cgemm(
'No transpose',
'Conjugate transpose',
292 $ m-k, n, k, -one, v( k+1, 1 ), ldv, work,
293 $ ldwork, one, c( k+1, 1 ), ldc )
298 CALL ctrmm(
'Right',
'Lower',
'Conjugate transpose',
299 $
'Unit', n, k, one, v, ldv, work, ldwork )
305 c( j, i ) = c( j, i ) - conjg( work( i, j ) )
309 ELSE IF( lsame( side,
'R' ) )
THEN
318 CALL ccopy( m, c( 1, j ), 1, work( 1, j ), 1 )
323 CALL ctrmm(
'Right',
'Lower',
'No transpose',
'Unit',
325 $ k, one, v, ldv, work, ldwork )
330 CALL cgemm(
'No transpose',
'No transpose', m, k,
332 $ one, c( 1, k+1 ), ldc, v( k+1, 1 ), ldv,
333 $ one, work, ldwork )
338 CALL ctrmm(
'Right',
'Upper', trans,
'Non-unit', m, k,
339 $ one, t, ldt, work, ldwork )
347 CALL cgemm(
'No transpose',
'Conjugate transpose',
349 $ n-k, k, -one, work, ldwork, v( k+1, 1 ),
350 $ ldv, one, c( 1, k+1 ), ldc )
355 CALL ctrmm(
'Right',
'Lower',
'Conjugate transpose',
356 $
'Unit', m, k, one, v, ldv, work, ldwork )
362 c( i, j ) = c( i, j ) - work( i, j )
373 IF( lsame( side,
'L' ) )
THEN
383 CALL ccopy( n, c( m-k+j, 1 ), ldc, work( 1, j ),
385 CALL clacgv( n, work( 1, j ), 1 )
390 CALL ctrmm(
'Right',
'Upper',
'No transpose',
'Unit',
392 $ k, one, v( m-k+1, 1 ), ldv, work, ldwork )
397 CALL cgemm(
'Conjugate transpose',
'No transpose',
399 $ k, m-k, one, c, ldc, v, ldv, one, work,
405 CALL ctrmm(
'Right',
'Lower', transt,
'Non-unit', n,
407 $ one, t, ldt, work, ldwork )
415 CALL cgemm(
'No transpose',
'Conjugate transpose',
416 $ m-k, n, k, -one, v, ldv, work, ldwork,
422 CALL ctrmm(
'Right',
'Upper',
'Conjugate transpose',
423 $
'Unit', n, k, one, v( m-k+1, 1 ), ldv, work,
430 c( m-k+j, i ) = c( m-k+j, i ) -
431 $ conjg( work( i, j ) )
435 ELSE IF( lsame( side,
'R' ) )
THEN
444 CALL ccopy( m, c( 1, n-k+j ), 1, work( 1, j ), 1 )
449 CALL ctrmm(
'Right',
'Upper',
'No transpose',
'Unit',
451 $ k, one, v( n-k+1, 1 ), ldv, work, ldwork )
456 CALL cgemm(
'No transpose',
'No transpose', m, k,
458 $ one, c, ldc, v, ldv, one, work, ldwork )
463 CALL ctrmm(
'Right',
'Lower', trans,
'Non-unit', m, k,
464 $ one, t, ldt, work, ldwork )
472 CALL cgemm(
'No transpose',
'Conjugate transpose',
474 $ n-k, k, -one, work, ldwork, v, ldv, one,
480 CALL ctrmm(
'Right',
'Upper',
'Conjugate transpose',
481 $
'Unit', m, k, one, v( n-k+1, 1 ), ldv, work,
488 c( i, n-k+j ) = c( i, n-k+j ) - work( i, j )
494 ELSE IF( lsame( storev,
'R' ) )
THEN
496 IF( lsame( direct,
'F' ) )
THEN
501 IF( lsame( side,
'L' ) )
THEN
511 CALL ccopy( n, c( j, 1 ), ldc, work( 1, j ), 1 )
512 CALL clacgv( n, work( 1, j ), 1 )
517 CALL ctrmm(
'Right',
'Upper',
'Conjugate transpose',
518 $
'Unit', n, k, one, v, ldv, work, ldwork )
523 CALL cgemm(
'Conjugate transpose',
524 $
'Conjugate transpose', n, k, m-k, one,
525 $ c( k+1, 1 ), ldc, v( 1, k+1 ), ldv, one,
531 CALL ctrmm(
'Right',
'Upper', transt,
'Non-unit', n,
533 $ one, t, ldt, work, ldwork )
541 CALL cgemm(
'Conjugate transpose',
542 $
'Conjugate transpose', m-k, n, k, -one,
543 $ v( 1, k+1 ), ldv, work, ldwork, one,
549 CALL ctrmm(
'Right',
'Upper',
'No transpose',
'Unit',
551 $ k, one, v, ldv, work, ldwork )
557 c( j, i ) = c( j, i ) - conjg( work( i, j ) )
561 ELSE IF( lsame( side,
'R' ) )
THEN
570 CALL ccopy( m, c( 1, j ), 1, work( 1, j ), 1 )
575 CALL ctrmm(
'Right',
'Upper',
'Conjugate transpose',
576 $
'Unit', m, k, one, v, ldv, work, ldwork )
581 CALL cgemm(
'No transpose',
'Conjugate transpose',
583 $ k, n-k, one, c( 1, k+1 ), ldc,
584 $ v( 1, k+1 ), ldv, one, work, ldwork )
589 CALL ctrmm(
'Right',
'Upper', trans,
'Non-unit', m, k,
590 $ one, t, ldt, work, ldwork )
598 CALL cgemm(
'No transpose',
'No transpose', m, n-k,
600 $ -one, work, ldwork, v( 1, k+1 ), ldv, one,
606 CALL ctrmm(
'Right',
'Upper',
'No transpose',
'Unit',
608 $ k, one, v, ldv, work, ldwork )
614 c( i, j ) = c( i, j ) - work( i, j )
625 IF( lsame( side,
'L' ) )
THEN
635 CALL ccopy( n, c( m-k+j, 1 ), ldc, work( 1, j ),
637 CALL clacgv( n, work( 1, j ), 1 )
642 CALL ctrmm(
'Right',
'Lower',
'Conjugate transpose',
643 $
'Unit', n, k, one, v( 1, m-k+1 ), ldv, work,
649 CALL cgemm(
'Conjugate transpose',
650 $
'Conjugate transpose', n, k, m-k, one, c,
651 $ ldc, v, ldv, one, work, ldwork )
656 CALL ctrmm(
'Right',
'Lower', transt,
'Non-unit', n,
658 $ one, t, ldt, work, ldwork )
666 CALL cgemm(
'Conjugate transpose',
667 $
'Conjugate transpose', m-k, n, k, -one, v,
668 $ ldv, work, ldwork, one, c, ldc )
673 CALL ctrmm(
'Right',
'Lower',
'No transpose',
'Unit',
675 $ k, one, v( 1, m-k+1 ), ldv, work, ldwork )
681 c( m-k+j, i ) = c( m-k+j, i ) -
682 $ conjg( work( i, j ) )
686 ELSE IF( lsame( side,
'R' ) )
THEN
695 CALL ccopy( m, c( 1, n-k+j ), 1, work( 1, j ), 1 )
700 CALL ctrmm(
'Right',
'Lower',
'Conjugate transpose',
701 $
'Unit', m, k, one, v( 1, n-k+1 ), ldv, work,
707 CALL cgemm(
'No transpose',
'Conjugate transpose',
709 $ k, n-k, one, c, ldc, v, ldv, one, work,
715 CALL ctrmm(
'Right',
'Lower', trans,
'Non-unit', m, k,
716 $ one, t, ldt, work, ldwork )
724 CALL cgemm(
'No transpose',
'No transpose', m, n-k,
726 $ -one, work, ldwork, v, ldv, one, c, ldc )
731 CALL ctrmm(
'Right',
'Lower',
'No transpose',
'Unit',
733 $ k, one, v( 1, n-k+1 ), ldv, work, ldwork )
739 c( i, n-k+j ) = c( i, n-k+j ) - work( i, j )