195 SUBROUTINE slarfb( SIDE, TRANS, DIRECT, STOREV, M, N, K, V, LDV,
196 $ t, ldt, c, ldc, work, ldwork )
204 CHARACTER direct, side, storev, trans
205 INTEGER k, ldc, ldt, ldv, ldwork, m, n
208 REAL c( ldc, * ), t( ldt, * ), v( ldv, * ),
216 parameter( one = 1.0e+0 )
220 INTEGER i, j, lastv, lastc
234 IF( m.LE.0 .OR. n.LE.0 )
237 IF(
lsame( trans,
'N' ) )
THEN
243 IF(
lsame( storev,
'C' ) )
THEN
245 IF(
lsame( direct,
'F' ) )
THEN
251 IF(
lsame( side,
'L' ) )
THEN
256 lastv = max( k,
ilaslr( m, k, v, ldv ) )
257 lastc =
ilaslc( lastv, n, c, ldc )
264 CALL
scopy( lastc, c( j, 1 ), ldc, work( 1, j ), 1 )
269 CALL
strmm(
'Right',
'Lower',
'No transpose',
'Unit',
270 $ lastc, k, one, v, ldv, work, ldwork )
271 IF( lastv.GT.k )
THEN
275 CALL
sgemm(
'Transpose',
'No transpose',
277 $ one, c( k+1, 1 ), ldc, v( k+1, 1 ), ldv,
278 $ one, work, ldwork )
283 CALL
strmm(
'Right',
'Upper', transt,
'Non-unit',
284 $ lastc, k, one, t, ldt, work, ldwork )
288 IF( lastv.GT.k )
THEN
292 CALL
sgemm(
'No transpose',
'Transpose',
294 $ -one, v( k+1, 1 ), ldv, work, ldwork, one,
300 CALL
strmm(
'Right',
'Lower',
'Transpose',
'Unit',
301 $ lastc, k, one, v, ldv, work, ldwork )
307 c( j, i ) = c( j, i ) - work( i, j )
311 ELSE IF(
lsame( side,
'R' ) )
THEN
315 lastv = max( k,
ilaslr( n, k, v, ldv ) )
316 lastc =
ilaslr( m, lastv, c, ldc )
323 CALL
scopy( lastc, c( 1, j ), 1, work( 1, j ), 1 )
328 CALL
strmm(
'Right',
'Lower',
'No transpose',
'Unit',
329 $ lastc, k, one, v, ldv, work, ldwork )
330 IF( lastv.GT.k )
THEN
334 CALL
sgemm(
'No transpose',
'No transpose',
336 $ one, c( 1, k+1 ), ldc, v( k+1, 1 ), ldv,
337 $ one, work, ldwork )
342 CALL
strmm(
'Right',
'Upper', trans,
'Non-unit',
343 $ lastc, k, one, t, ldt, work, ldwork )
347 IF( lastv.GT.k )
THEN
351 CALL
sgemm(
'No transpose',
'Transpose',
353 $ -one, work, ldwork, v( k+1, 1 ), ldv, one,
359 CALL
strmm(
'Right',
'Lower',
'Transpose',
'Unit',
360 $ lastc, k, one, v, ldv, work, ldwork )
366 c( i, j ) = c( i, j ) - work( i, j )
377 IF(
lsame( side,
'L' ) )
THEN
382 lastc =
ilaslc( m, n, c, ldc )
389 CALL
scopy( lastc, c( m-k+j, 1 ), ldc,
395 CALL
strmm(
'Right',
'Upper',
'No transpose',
'Unit',
396 $ lastc, k, one, v( m-k+1, 1 ), ldv,
402 CALL
sgemm(
'Transpose',
'No transpose',
403 $ lastc, k, m-k, one, c, ldc, v, ldv,
404 $ one, work, ldwork )
409 CALL
strmm(
'Right',
'Lower', transt,
'Non-unit',
410 $ lastc, k, one, t, ldt, work, ldwork )
418 CALL
sgemm(
'No transpose',
'Transpose',
419 $ m-k, lastc, k, -one, v, ldv, work, ldwork,
425 CALL
strmm(
'Right',
'Upper',
'Transpose',
'Unit',
426 $ lastc, k, one, v( m-k+1, 1 ), ldv,
433 c( m-k+j, i ) = c( m-k+j, i ) - work(i, j)
437 ELSE IF(
lsame( side,
'R' ) )
THEN
441 lastc =
ilaslr( m, n, c, ldc )
448 CALL
scopy( lastc, c( 1, n-k+j ), 1, work( 1, j ), 1 )
453 CALL
strmm(
'Right',
'Upper',
'No transpose',
'Unit',
454 $ lastc, k, one, v( n-k+1, 1 ), ldv,
460 CALL
sgemm(
'No transpose',
'No transpose',
461 $ lastc, k, n-k, one, c, ldc, v, ldv,
462 $ one, work, ldwork )
467 CALL
strmm(
'Right',
'Lower', trans,
'Non-unit',
468 $ lastc, k, one, t, ldt, work, ldwork )
476 CALL
sgemm(
'No transpose',
'Transpose',
477 $ lastc, n-k, k, -one, work, ldwork, v, ldv,
483 CALL
strmm(
'Right',
'Upper',
'Transpose',
'Unit',
484 $ lastc, k, one, v( n-k+1, 1 ), ldv,
491 c( i, n-k+j ) = c( i, n-k+j ) - work(i, j)
497 ELSE IF(
lsame( storev,
'R' ) )
THEN
499 IF(
lsame( direct,
'F' ) )
THEN
504 IF(
lsame( side,
'L' ) )
THEN
509 lastv = max( k,
ilaslc( k, m, v, ldv ) )
510 lastc =
ilaslc( lastv, n, c, ldc )
517 CALL
scopy( lastc, c( j, 1 ), ldc, work( 1, j ), 1 )
522 CALL
strmm(
'Right',
'Upper',
'Transpose',
'Unit',
523 $ lastc, k, one, v, ldv, work, ldwork )
524 IF( lastv.GT.k )
THEN
528 CALL
sgemm(
'Transpose',
'Transpose',
530 $ one, c( k+1, 1 ), ldc, v( 1, k+1 ), ldv,
531 $ one, work, ldwork )
536 CALL
strmm(
'Right',
'Upper', transt,
'Non-unit',
537 $ lastc, k, one, t, ldt, work, ldwork )
541 IF( lastv.GT.k )
THEN
545 CALL
sgemm(
'Transpose',
'Transpose',
547 $ -one, v( 1, k+1 ), ldv, work, ldwork,
548 $ one, c( k+1, 1 ), ldc )
553 CALL
strmm(
'Right',
'Upper',
'No transpose',
'Unit',
554 $ lastc, k, one, v, ldv, work, ldwork )
560 c( j, i ) = c( j, i ) - work( i, j )
564 ELSE IF(
lsame( side,
'R' ) )
THEN
568 lastv = max( k,
ilaslc( k, n, v, ldv ) )
569 lastc =
ilaslr( m, lastv, c, ldc )
576 CALL
scopy( lastc, c( 1, j ), 1, work( 1, j ), 1 )
581 CALL
strmm(
'Right',
'Upper',
'Transpose',
'Unit',
582 $ lastc, k, one, v, ldv, work, ldwork )
583 IF( lastv.GT.k )
THEN
587 CALL
sgemm(
'No transpose',
'Transpose',
589 $ one, c( 1, k+1 ), ldc, v( 1, k+1 ), ldv,
590 $ one, work, ldwork )
595 CALL
strmm(
'Right',
'Upper', trans,
'Non-unit',
596 $ lastc, k, one, t, ldt, work, ldwork )
600 IF( lastv.GT.k )
THEN
604 CALL
sgemm(
'No transpose',
'No transpose',
606 $ -one, work, ldwork, v( 1, k+1 ), ldv,
607 $ one, c( 1, k+1 ), ldc )
612 CALL
strmm(
'Right',
'Upper',
'No transpose',
'Unit',
613 $ lastc, k, one, v, ldv, work, ldwork )
619 c( i, j ) = c( i, j ) - work( i, j )
630 IF(
lsame( side,
'L' ) )
THEN
635 lastc =
ilaslc( m, n, c, ldc )
642 CALL
scopy( lastc, c( m-k+j, 1 ), ldc,
648 CALL
strmm(
'Right',
'Lower',
'Transpose',
'Unit',
649 $ lastc, k, one, v( 1, m-k+1 ), ldv,
655 CALL
sgemm(
'Transpose',
'Transpose',
656 $ lastc, k, m-k, one, c, ldc, v, ldv,
657 $ one, work, ldwork )
662 CALL
strmm(
'Right',
'Lower', transt,
'Non-unit',
663 $ lastc, k, one, t, ldt, work, ldwork )
671 CALL
sgemm(
'Transpose',
'Transpose',
672 $ m-k, lastc, k, -one, v, ldv, work, ldwork,
678 CALL
strmm(
'Right',
'Lower',
'No transpose',
'Unit',
679 $ lastc, k, one, v( 1, m-k+1 ), ldv,
686 c( m-k+j, i ) = c( m-k+j, i ) - work(i, j)
690 ELSE IF(
lsame( side,
'R' ) )
THEN
694 lastc =
ilaslr( m, n, c, ldc )
701 CALL
scopy( lastc, c( 1, n-k+j ), 1,
707 CALL
strmm(
'Right',
'Lower',
'Transpose',
'Unit',
708 $ lastc, k, one, v( 1, n-k+1 ), ldv,
714 CALL
sgemm(
'No transpose',
'Transpose',
715 $ lastc, k, n-k, one, c, ldc, v, ldv,
716 $ one, work, ldwork )
721 CALL
strmm(
'Right',
'Lower', trans,
'Non-unit',
722 $ lastc, k, one, t, ldt, work, ldwork )
730 CALL
sgemm(
'No transpose',
'No transpose',
731 $ lastc, n-k, k, -one, work, ldwork, v, ldv,
737 CALL
strmm(
'Right',
'Lower',
'No transpose',
'Unit',
738 $ lastc, k, one, v( 1, n-k+1 ), ldv,
745 c( i, n-k+j ) = c( i, n-k+j ) - work( i, j )