1 SUBROUTINE dlarfb( SIDE, TRANS, DIRECT, STOREV, M, N, K, V, LDV,
2 $ T, LDT, C, LDC, WORK, LDWORK )
10 CHARACTER DIRECT, SIDE, STOREV, TRANS
11 INTEGER K, LDC, LDT, LDV, LDWORK, M, N
14 DOUBLE PRECISION C( LDC, * ), T( LDT, * ), V( LDV, * ),
94 parameter( one = 1.0d+0 )
111 IF( m.LE.0 .OR. n.LE.0 )
114 IF( lsame( trans,
'N' ) )
THEN
120 IF( lsame( storev,
'C' ) )
THEN
122 IF( lsame( direct,
'F' ) )
THEN
128 IF( lsame( side,
'L' ) )
THEN
138 CALL dcopy( n, c( j, 1 ), ldc, work( 1, j ), 1 )
143 CALL dtrmm(
'Right',
'Lower',
'No transpose',
'Unit', n,
144 $ k, one, v, ldv, work, ldwork )
149 CALL dgemm(
'Transpose',
'No transpose', n, k, m-k,
150 $ one, c( k+1, 1 ), ldc, v( k+1, 1 ), ldv,
151 $ one, work, ldwork )
156 CALL dtrmm(
'Right',
'Upper', transt,
'Non-unit', n, k,
157 $ one, t, ldt, work, ldwork )
165 CALL dgemm(
'No transpose',
'Transpose', m-k, n, k,
166 $ -one, v( k+1, 1 ), ldv, work, ldwork, one,
172 CALL dtrmm(
'Right',
'Lower',
'Transpose',
'Unit', n, k,
173 $ one, v, ldv, work, ldwork )
179 c( j, i ) = c( j, i ) - work( i, j )
183 ELSE IF( lsame( side,
'R' ) )
THEN
192 CALL dcopy( m, c( 1, j ), 1, work( 1, j ), 1 )
197 CALL dtrmm(
'Right',
'Lower',
'No transpose',
'Unit', m,
198 $ k, one, v, ldv, work, ldwork )
203 CALL dgemm(
'No transpose',
'No transpose', m, k, n-k,
204 $ one, c( 1, k+1 ), ldc, v( k+1, 1 ), ldv,
205 $ one, work, ldwork )
210 CALL dtrmm(
'Right',
'Upper', trans,
'Non-unit', m, k,
211 $ one, t, ldt, work, ldwork )
219 CALL dgemm(
'No transpose',
'Transpose', m, n-k, k,
220 $ -one, work, ldwork, v( k+1, 1 ), ldv, one,
226 CALL dtrmm(
'Right',
'Lower',
'Transpose',
'Unit', m, k,
227 $ one, v, ldv, work, ldwork )
233 c( i, j ) = c( i, j ) - work( i, j )
244 IF( lsame( side,
'L' ) )
THEN
254 CALL dcopy( n, c( m-k+j, 1 ), ldc, work( 1, j ), 1 )
259 CALL dtrmm(
'Right',
'Upper',
'No transpose',
'Unit', n,
260 $ k, one, v( m-k+1, 1 ), ldv, work, ldwork )
265 CALL dgemm(
'Transpose',
'No transpose', n, k, m-k,
266 $ one, c, ldc, v, ldv, one, work, ldwork )
271 CALL dtrmm(
'Right',
'Lower', transt,
'Non-unit', n, k,
272 $ one, t, ldt, work, ldwork )
280 CALL dgemm(
'No transpose',
'Transpose', m-k, n, k,
281 $ -one, v, ldv, work, ldwork, one, c, ldc )
286 CALL dtrmm(
'Right',
'Upper',
'Transpose',
'Unit', n, k,
287 $ one, v( m-k+1, 1 ), ldv, work, ldwork )
293 c( m-k+j, i ) = c( m-k+j, i ) - work( i, j )
297 ELSE IF( lsame( side,
'R' ) )
THEN
306 CALL dcopy( m, c( 1, n-k+j ), 1, work( 1, j ), 1 )
311 CALL dtrmm(
'Right',
'Upper',
'No transpose',
'Unit', m,
312 $ k, one, v( n-k+1, 1 ), ldv, work, ldwork )
317 CALL dgemm(
'No transpose',
'No transpose', m, k, n-k,
318 $ one, c, ldc, v, ldv, one, work, ldwork )
323 CALL dtrmm(
'Right',
'Lower', trans,
'Non-unit', m, k,
324 $ one, t, ldt, work, ldwork )
332 CALL dgemm(
'No transpose',
'Transpose', m, n-k, k,
333 $ -one, work, ldwork, v, ldv, one, c, ldc )
338 CALL dtrmm(
'Right',
'Upper',
'Transpose',
'Unit', m, k,
339 $ one, v( n-k+1, 1 ), ldv, work, ldwork )
345 c( i, n-k+j ) = c( i, n-k+j ) - work( i, j )
351 ELSE IF( lsame( storev,
'R' ) )
THEN
353 IF( lsame( direct,
'F' ) )
THEN
358 IF( lsame( side,
'L' ) )
THEN
368 CALL dcopy( n, c( j, 1 ), ldc, work( 1, j ), 1 )
373 CALL dtrmm(
'Right',
'Upper',
'Transpose',
'Unit', n, k,
374 $ one, v, ldv, work, ldwork )
379 CALL dgemm(
'Transpose',
'Transpose', n, k, m-k, one,
380 $ c( k+1, 1 ), ldc, v( 1, k+1 ), ldv, one,
386 CALL dtrmm(
'Right',
'Upper', transt,
'Non-unit', n, k,
387 $ one, t, ldt, work, ldwork )
395 CALL dgemm(
'Transpose',
'Transpose', m-k, n, k, -one,
396 $ v( 1, k+1 ), ldv, work, ldwork, one,
402 CALL dtrmm(
'Right',
'Upper',
'No transpose',
'Unit', n,
403 $ k, one, v, ldv, work, ldwork )
409 c( j, i ) = c( j, i ) - work( i, j )
413 ELSE IF( lsame( side,
'R' ) )
THEN
422 CALL dcopy( m, c( 1, j ), 1, work( 1, j ), 1 )
427 CALL dtrmm(
'Right',
'Upper',
'Transpose',
'Unit', m, k,
428 $ one, v, ldv, work, ldwork )
433 CALL dgemm(
'No transpose',
'Transpose', m, k, n-k,
434 $ one, c( 1, k+1 ), ldc, v( 1, k+1 ), ldv,
435 $ one, work, ldwork )
440 CALL dtrmm(
'Right',
'Upper', trans,
'Non-unit', m, k,
441 $ one, t, ldt, work, ldwork )
449 CALL dgemm(
'No transpose',
'No transpose', m, n-k, k,
450 $ -one, work, ldwork, v( 1, k+1 ), ldv, one,
456 CALL dtrmm(
'Right',
'Upper',
'No transpose',
'Unit', m,
457 $ k, one, v, ldv, work, ldwork )
463 c( i, j ) = c( i, j ) - work( i, j )
474 IF( lsame( side,
'L' ) )
THEN
484 CALL dcopy( n, c( m-k+j, 1 ), ldc, work( 1, j ), 1 )
489 CALL dtrmm(
'Right',
'Lower',
'Transpose',
'Unit', n, k,
490 $ one, v( 1, m-k+1 ), ldv, work, ldwork )
495 CALL dgemm(
'Transpose',
'Transpose', n, k, m-k, one,
496 $ c, ldc, v, ldv, one, work, ldwork )
501 CALL dtrmm(
'Right',
'Lower', transt,
'Non-unit', n, k,
502 $ one, t, ldt, work, ldwork )
510 CALL dgemm(
'Transpose',
'Transpose', m-k, n, k, -one,
511 $ v, ldv, work, ldwork, one, c, ldc )
516 CALL dtrmm(
'Right',
'Lower',
'No transpose',
'Unit', n,
517 $ k, one, v( 1, m-k+1 ), ldv, work, ldwork )
523 c( m-k+j, i ) = c( m-k+j, i ) - work( i, j )
527 ELSE IF( lsame( side,
'R' ) )
THEN
536 CALL dcopy( m, c( 1, n-k+j ), 1, work( 1, j ), 1 )
541 CALL dtrmm(
'Right',
'Lower',
'Transpose',
'Unit', m, k,
542 $ one, v( 1, n-k+1 ), ldv, work, ldwork )
547 CALL dgemm(
'No transpose',
'Transpose', m, k, n-k,
548 $ one, c, ldc, v, ldv, one, work, ldwork )
553 CALL dtrmm(
'Right',
'Lower', trans,
'Non-unit', m, k,
554 $ one, t, ldt, work, ldwork )
562 CALL dgemm(
'No transpose',
'No transpose', m, n-k, k,
563 $ -one, work, ldwork, v, ldv, one, c, ldc )
568 CALL dtrmm(
'Right',
'Lower',
'No transpose',
'Unit', m,
569 $ k, one, v( 1, n-k+1 ), ldv, work, ldwork )
575 c( i, n-k+j ) = c( i, n-k+j ) - work( i, j )
subroutine dcopy(n, dx, incx, dy, incy)
subroutine dgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
subroutine dlarfb(SIDE, TRANS, DIRECT, STOREV, M, N, K, V, LDV, T, LDT, C, LDC, WORK, LDWORK)
subroutine dtrmm(SIDE, UPLO, TRANSA, DIAG, M, N, ALPHA, A, LDA, B, LDB)