dlarfb.f.html
来自「famous linear algebra library (LAPACK) p」· HTML 代码 · 共 612 行 · 第 1/3 页
HTML
612 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>dlarfb.f</title>
<meta name="generator" content="emacs 21.3.1; htmlfontify 0.20">
<style type="text/css"><!--
body { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.default a { background: rgb(255, 255, 255); color: rgb(0, 0, 0); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.string { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.string a { color: rgb(188, 143, 143); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
span.comment { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: none; }
span.comment a { color: rgb(178, 34, 34); background: rgb(255, 255, 255); font-style: normal; font-weight: 500; font-stretch: normal; font-family: adobe-courier; font-size: 11pt; text-decoration: underline; }
--></style>
</head>
<body>
<pre>
SUBROUTINE <a name="DLARFB.1"></a><a href="dlarfb.f.html#DLARFB.1">DLARFB</a>( SIDE, TRANS, DIRECT, STOREV, M, N, K, V, LDV,
$ T, LDT, C, LDC, WORK, LDWORK )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> -- LAPACK auxiliary routine (version 3.1) --
</span><span class="comment">*</span><span class="comment"> Univ. of Tennessee, Univ. of California Berkeley and NAG Ltd..
</span><span class="comment">*</span><span class="comment"> November 2006
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Scalar Arguments ..
</span> CHARACTER DIRECT, SIDE, STOREV, TRANS
INTEGER K, LDC, LDT, LDV, LDWORK, M, N
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Array Arguments ..
</span> DOUBLE PRECISION C( LDC, * ), T( LDT, * ), V( LDV, * ),
$ WORK( LDWORK, * )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Purpose
</span><span class="comment">*</span><span class="comment"> =======
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> <a name="DLARFB.20"></a><a href="dlarfb.f.html#DLARFB.1">DLARFB</a> applies a real block reflector H or its transpose H' to a
</span><span class="comment">*</span><span class="comment"> real m by n matrix C, from either the left or the right.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Arguments
</span><span class="comment">*</span><span class="comment"> =========
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> SIDE (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'L': apply H or H' from the Left
</span><span class="comment">*</span><span class="comment"> = 'R': apply H or H' from the Right
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> TRANS (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> = 'N': apply H (No transpose)
</span><span class="comment">*</span><span class="comment"> = 'T': apply H' (Transpose)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> DIRECT (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> Indicates how H is formed from a product of elementary
</span><span class="comment">*</span><span class="comment"> reflectors
</span><span class="comment">*</span><span class="comment"> = 'F': H = H(1) H(2) . . . H(k) (Forward)
</span><span class="comment">*</span><span class="comment"> = 'B': H = H(k) . . . H(2) H(1) (Backward)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> STOREV (input) CHARACTER*1
</span><span class="comment">*</span><span class="comment"> Indicates how the vectors which define the elementary
</span><span class="comment">*</span><span class="comment"> reflectors are stored:
</span><span class="comment">*</span><span class="comment"> = 'C': Columnwise
</span><span class="comment">*</span><span class="comment"> = 'R': Rowwise
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> M (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The number of rows of the matrix C.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> N (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The number of columns of the matrix C.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> K (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The order of the matrix T (= the number of elementary
</span><span class="comment">*</span><span class="comment"> reflectors whose product defines the block reflector).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> V (input) DOUBLE PRECISION array, dimension
</span><span class="comment">*</span><span class="comment"> (LDV,K) if STOREV = 'C'
</span><span class="comment">*</span><span class="comment"> (LDV,M) if STOREV = 'R' and SIDE = 'L'
</span><span class="comment">*</span><span class="comment"> (LDV,N) if STOREV = 'R' and SIDE = 'R'
</span><span class="comment">*</span><span class="comment"> The matrix V. See further details.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDV (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array V.
</span><span class="comment">*</span><span class="comment"> If STOREV = 'C' and SIDE = 'L', LDV >= max(1,M);
</span><span class="comment">*</span><span class="comment"> if STOREV = 'C' and SIDE = 'R', LDV >= max(1,N);
</span><span class="comment">*</span><span class="comment"> if STOREV = 'R', LDV >= K.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> T (input) DOUBLE PRECISION array, dimension (LDT,K)
</span><span class="comment">*</span><span class="comment"> The triangular k by k matrix T in the representation of the
</span><span class="comment">*</span><span class="comment"> block reflector.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDT (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array T. LDT >= K.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> C (input/output) DOUBLE PRECISION array, dimension (LDC,N)
</span><span class="comment">*</span><span class="comment"> On entry, the m by n matrix C.
</span><span class="comment">*</span><span class="comment"> On exit, C is overwritten by H*C or H'*C or C*H or C*H'.
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDC (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array C. LDA >= max(1,M).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> WORK (workspace) DOUBLE PRECISION array, dimension (LDWORK,K)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> LDWORK (input) INTEGER
</span><span class="comment">*</span><span class="comment"> The leading dimension of the array WORK.
</span><span class="comment">*</span><span class="comment"> If SIDE = 'L', LDWORK >= max(1,N);
</span><span class="comment">*</span><span class="comment"> if SIDE = 'R', LDWORK >= max(1,M).
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> =====================================================================
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> .. Parameters ..
</span> DOUBLE PRECISION ONE
PARAMETER ( ONE = 1.0D+0 )
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Local Scalars ..
</span> CHARACTER TRANST
INTEGER I, J
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Functions ..
</span> LOGICAL <a name="LSAME.100"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
EXTERNAL <a name="LSAME.101"></a><a href="lsame.f.html#LSAME.1">LSAME</a>
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. External Subroutines ..
</span> EXTERNAL DCOPY, DGEMM, DTRMM
<span class="comment">*</span><span class="comment"> ..
</span><span class="comment">*</span><span class="comment"> .. Executable Statements ..
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Quick return if possible
</span><span class="comment">*</span><span class="comment">
</span> IF( M.LE.0 .OR. N.LE.0 )
$ RETURN
<span class="comment">*</span><span class="comment">
</span> IF( <a name="LSAME.113"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( TRANS, <span class="string">'N'</span> ) ) THEN
TRANST = <span class="string">'T'</span>
ELSE
TRANST = <span class="string">'N'</span>
END IF
<span class="comment">*</span><span class="comment">
</span> IF( <a name="LSAME.119"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( STOREV, <span class="string">'C'</span> ) ) THEN
<span class="comment">*</span><span class="comment">
</span> IF( <a name="LSAME.121"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( DIRECT, <span class="string">'F'</span> ) ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Let V = ( V1 ) (first K rows)
</span><span class="comment">*</span><span class="comment"> ( V2 )
</span><span class="comment">*</span><span class="comment"> where V1 is unit lower triangular.
</span><span class="comment">*</span><span class="comment">
</span> IF( <a name="LSAME.127"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SIDE, <span class="string">'L'</span> ) ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Form H * C or H' * C where C = ( C1 )
</span><span class="comment">*</span><span class="comment"> ( C2 )
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> W := C' * V = (C1'*V1 + C2'*V2) (stored in WORK)
</span><span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> W := C1'
</span><span class="comment">*</span><span class="comment">
</span> DO 10 J = 1, K
CALL DCOPY( N, C( J, 1 ), LDC, WORK( 1, J ), 1 )
10 CONTINUE
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> W := W * V1
</span><span class="comment">*</span><span class="comment">
</span> CALL DTRMM( <span class="string">'Right'</span>, <span class="string">'Lower'</span>, <span class="string">'No transpose'</span>, <span class="string">'Unit'</span>, N,
$ K, ONE, V, LDV, WORK, LDWORK )
IF( M.GT.K ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> W := W + C2'*V2
</span><span class="comment">*</span><span class="comment">
</span> CALL DGEMM( <span class="string">'Transpose'</span>, <span class="string">'No transpose'</span>, N, K, M-K,
$ ONE, C( K+1, 1 ), LDC, V( K+1, 1 ), LDV,
$ ONE, WORK, LDWORK )
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> W := W * T' or W * T
</span><span class="comment">*</span><span class="comment">
</span> CALL DTRMM( <span class="string">'Right'</span>, <span class="string">'Upper'</span>, TRANST, <span class="string">'Non-unit'</span>, N, K,
$ ONE, T, LDT, WORK, LDWORK )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> C := C - V * W'
</span><span class="comment">*</span><span class="comment">
</span> IF( M.GT.K ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> C2 := C2 - V2 * W'
</span><span class="comment">*</span><span class="comment">
</span> CALL DGEMM( <span class="string">'No transpose'</span>, <span class="string">'Transpose'</span>, M-K, N, K,
$ -ONE, V( K+1, 1 ), LDV, WORK, LDWORK, ONE,
$ C( K+1, 1 ), LDC )
END IF
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> W := W * V1'
</span><span class="comment">*</span><span class="comment">
</span> CALL DTRMM( <span class="string">'Right'</span>, <span class="string">'Lower'</span>, <span class="string">'Transpose'</span>, <span class="string">'Unit'</span>, N, K,
$ ONE, V, LDV, WORK, LDWORK )
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> C1 := C1 - W'
</span><span class="comment">*</span><span class="comment">
</span> DO 30 J = 1, K
DO 20 I = 1, N
C( J, I ) = C( J, I ) - WORK( I, J )
20 CONTINUE
30 CONTINUE
<span class="comment">*</span><span class="comment">
</span> ELSE IF( <a name="LSAME.182"></a><a href="lsame.f.html#LSAME.1">LSAME</a>( SIDE, <span class="string">'R'</span> ) ) THEN
<span class="comment">*</span><span class="comment">
</span><span class="comment">*</span><span class="comment"> Form C * H or C * H' where C = ( C1 C2 )
</span><span class="comment">*</span><span class="comment">
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?