LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dlarzb.f
Go to the documentation of this file.
1*> \brief \b DLARZB applies a block reflector or its transpose to a general matrix.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download DLARZB + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dlarzb.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dlarzb.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dlarzb.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE DLARZB( SIDE, TRANS, DIRECT, STOREV, M, N, K, L, V,
20* LDV, T, LDT, C, LDC, WORK, LDWORK )
21*
22* .. Scalar Arguments ..
23* CHARACTER DIRECT, SIDE, STOREV, TRANS
24* INTEGER K, L, LDC, LDT, LDV, LDWORK, M, N
25* ..
26* .. Array Arguments ..
27* DOUBLE PRECISION C( LDC, * ), T( LDT, * ), V( LDV, * ),
28* $ WORK( LDWORK, * )
29* ..
30*
31*
32*> \par Purpose:
33* =============
34*>
35*> \verbatim
36*>
37*> DLARZB applies a real block reflector H or its transpose H**T to
38*> a real distributed M-by-N C from the left or the right.
39*>
40*> Currently, only STOREV = 'R' and DIRECT = 'B' are supported.
41*> \endverbatim
42*
43* Arguments:
44* ==========
45*
46*> \param[in] SIDE
47*> \verbatim
48*> SIDE is CHARACTER*1
49*> = 'L': apply H or H**T from the Left
50*> = 'R': apply H or H**T from the Right
51*> \endverbatim
52*>
53*> \param[in] TRANS
54*> \verbatim
55*> TRANS is CHARACTER*1
56*> = 'N': apply H (No transpose)
57*> = 'C': apply H**T (Transpose)
58*> \endverbatim
59*>
60*> \param[in] DIRECT
61*> \verbatim
62*> DIRECT is CHARACTER*1
63*> Indicates how H is formed from a product of elementary
64*> reflectors
65*> = 'F': H = H(1) H(2) . . . H(k) (Forward, not supported yet)
66*> = 'B': H = H(k) . . . H(2) H(1) (Backward)
67*> \endverbatim
68*>
69*> \param[in] STOREV
70*> \verbatim
71*> STOREV is CHARACTER*1
72*> Indicates how the vectors which define the elementary
73*> reflectors are stored:
74*> = 'C': Columnwise (not supported yet)
75*> = 'R': Rowwise
76*> \endverbatim
77*>
78*> \param[in] M
79*> \verbatim
80*> M is INTEGER
81*> The number of rows of the matrix C.
82*> \endverbatim
83*>
84*> \param[in] N
85*> \verbatim
86*> N is INTEGER
87*> The number of columns of the matrix C.
88*> \endverbatim
89*>
90*> \param[in] K
91*> \verbatim
92*> K is INTEGER
93*> The order of the matrix T (= the number of elementary
94*> reflectors whose product defines the block reflector).
95*> \endverbatim
96*>
97*> \param[in] L
98*> \verbatim
99*> L is INTEGER
100*> The number of columns of the matrix V containing the
101*> meaningful part of the Householder reflectors.
102*> If SIDE = 'L', M >= L >= 0, if SIDE = 'R', N >= L >= 0.
103*> \endverbatim
104*>
105*> \param[in] V
106*> \verbatim
107*> V is DOUBLE PRECISION array, dimension (LDV,NV).
108*> If STOREV = 'C', NV = K; if STOREV = 'R', NV = L.
109*> \endverbatim
110*>
111*> \param[in] LDV
112*> \verbatim
113*> LDV is INTEGER
114*> The leading dimension of the array V.
115*> If STOREV = 'C', LDV >= L; if STOREV = 'R', LDV >= K.
116*> \endverbatim
117*>
118*> \param[in] T
119*> \verbatim
120*> T is DOUBLE PRECISION array, dimension (LDT,K)
121*> The triangular K-by-K matrix T in the representation of the
122*> block reflector.
123*> \endverbatim
124*>
125*> \param[in] LDT
126*> \verbatim
127*> LDT is INTEGER
128*> The leading dimension of the array T. LDT >= K.
129*> \endverbatim
130*>
131*> \param[in,out] C
132*> \verbatim
133*> C is DOUBLE PRECISION array, dimension (LDC,N)
134*> On entry, the M-by-N matrix C.
135*> On exit, C is overwritten by H*C or H**T*C or C*H or C*H**T.
136*> \endverbatim
137*>
138*> \param[in] LDC
139*> \verbatim
140*> LDC is INTEGER
141*> The leading dimension of the array C. LDC >= max(1,M).
142*> \endverbatim
143*>
144*> \param[out] WORK
145*> \verbatim
146*> WORK is DOUBLE PRECISION array, dimension (LDWORK,K)
147*> \endverbatim
148*>
149*> \param[in] LDWORK
150*> \verbatim
151*> LDWORK is INTEGER
152*> The leading dimension of the array WORK.
153*> If SIDE = 'L', LDWORK >= max(1,N);
154*> if SIDE = 'R', LDWORK >= max(1,M).
155*> \endverbatim
156*
157* Authors:
158* ========
159*
160*> \author Univ. of Tennessee
161*> \author Univ. of California Berkeley
162*> \author Univ. of Colorado Denver
163*> \author NAG Ltd.
164*
165*> \ingroup larzb
166*
167*> \par Contributors:
168* ==================
169*>
170*> A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
171*
172*> \par Further Details:
173* =====================
174*>
175*> \verbatim
176*> \endverbatim
177*>
178* =====================================================================
179 SUBROUTINE dlarzb( SIDE, TRANS, DIRECT, STOREV, M, N, K, L, V,
180 $ LDV, T, LDT, C, LDC, WORK, LDWORK )
181*
182* -- LAPACK computational routine --
183* -- LAPACK is a software package provided by Univ. of Tennessee, --
184* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
185*
186* .. Scalar Arguments ..
187 CHARACTER DIRECT, SIDE, STOREV, TRANS
188 INTEGER K, L, LDC, LDT, LDV, LDWORK, M, N
189* ..
190* .. Array Arguments ..
191 DOUBLE PRECISION C( LDC, * ), T( LDT, * ), V( LDV, * ),
192 $ work( ldwork, * )
193* ..
194*
195* =====================================================================
196*
197* .. Parameters ..
198 DOUBLE PRECISION ONE
199 parameter( one = 1.0d+0 )
200* ..
201* .. Local Scalars ..
202 CHARACTER TRANST
203 INTEGER I, INFO, J
204* ..
205* .. External Functions ..
206 LOGICAL LSAME
207 EXTERNAL lsame
208* ..
209* .. External Subroutines ..
210 EXTERNAL dcopy, dgemm, dtrmm, xerbla
211* ..
212* .. Executable Statements ..
213*
214* Quick return if possible
215*
216 IF( m.LE.0 .OR. n.LE.0 )
217 $ RETURN
218*
219* Check for currently supported options
220*
221 info = 0
222 IF( .NOT.lsame( direct, 'B' ) ) THEN
223 info = -3
224 ELSE IF( .NOT.lsame( storev, 'R' ) ) THEN
225 info = -4
226 END IF
227 IF( info.NE.0 ) THEN
228 CALL xerbla( 'DLARZB', -info )
229 RETURN
230 END IF
231*
232 IF( lsame( trans, 'N' ) ) THEN
233 transt = 'T'
234 ELSE
235 transt = 'N'
236 END IF
237*
238 IF( lsame( side, 'L' ) ) THEN
239*
240* Form H * C or H**T * C
241*
242* W( 1:n, 1:k ) = C( 1:k, 1:n )**T
243*
244 DO 10 j = 1, k
245 CALL dcopy( n, c( j, 1 ), ldc, work( 1, j ), 1 )
246 10 CONTINUE
247*
248* W( 1:n, 1:k ) = W( 1:n, 1:k ) + ...
249* C( m-l+1:m, 1:n )**T * V( 1:k, 1:l )**T
250*
251 IF( l.GT.0 )
252 $ CALL dgemm( 'Transpose', 'Transpose', n, k, l, one,
253 $ c( m-l+1, 1 ), ldc, v, ldv, one, work, ldwork )
254*
255* W( 1:n, 1:k ) = W( 1:n, 1:k ) * T**T or W( 1:m, 1:k ) * T
256*
257 CALL dtrmm( 'Right', 'Lower', transt, 'Non-unit', n, k, one,
258 $ t,
259 $ ldt, work, ldwork )
260*
261* C( 1:k, 1:n ) = C( 1:k, 1:n ) - W( 1:n, 1:k )**T
262*
263 DO 30 j = 1, n
264 DO 20 i = 1, k
265 c( i, j ) = c( i, j ) - work( j, i )
266 20 CONTINUE
267 30 CONTINUE
268*
269* C( m-l+1:m, 1:n ) = C( m-l+1:m, 1:n ) - ...
270* V( 1:k, 1:l )**T * W( 1:n, 1:k )**T
271*
272 IF( l.GT.0 )
273 $ CALL dgemm( 'Transpose', 'Transpose', l, n, k, -one, v,
274 $ ldv,
275 $ work, ldwork, one, c( m-l+1, 1 ), ldc )
276*
277 ELSE IF( lsame( side, 'R' ) ) THEN
278*
279* Form C * H or C * H**T
280*
281* W( 1:m, 1:k ) = C( 1:m, 1:k )
282*
283 DO 40 j = 1, k
284 CALL dcopy( m, c( 1, j ), 1, work( 1, j ), 1 )
285 40 CONTINUE
286*
287* W( 1:m, 1:k ) = W( 1:m, 1:k ) + ...
288* C( 1:m, n-l+1:n ) * V( 1:k, 1:l )**T
289*
290 IF( l.GT.0 )
291 $ CALL dgemm( 'No transpose', 'Transpose', m, k, l, one,
292 $ c( 1, n-l+1 ), ldc, v, ldv, one, work, ldwork )
293*
294* W( 1:m, 1:k ) = W( 1:m, 1:k ) * T or W( 1:m, 1:k ) * T**T
295*
296 CALL dtrmm( 'Right', 'Lower', trans, 'Non-unit', m, k, one,
297 $ t,
298 $ ldt, work, ldwork )
299*
300* C( 1:m, 1:k ) = C( 1:m, 1:k ) - W( 1:m, 1:k )
301*
302 DO 60 j = 1, k
303 DO 50 i = 1, m
304 c( i, j ) = c( i, j ) - work( i, j )
305 50 CONTINUE
306 60 CONTINUE
307*
308* C( 1:m, n-l+1:n ) = C( 1:m, n-l+1:n ) - ...
309* W( 1:m, 1:k ) * V( 1:k, 1:l )
310*
311 IF( l.GT.0 )
312 $ CALL dgemm( 'No transpose', 'No transpose', m, l, k,
313 $ -one,
314 $ work, ldwork, v, ldv, one, c( 1, n-l+1 ), ldc )
315*
316 END IF
317*
318 RETURN
319*
320* End of DLARZB
321*
322 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
Definition dcopy.f:82
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
Definition dgemm.f:188
subroutine dlarzb(side, trans, direct, storev, m, n, k, l, v, ldv, t, ldt, c, ldc, work, ldwork)
DLARZB applies a block reflector or its transpose to a general matrix.
Definition dlarzb.f:181
subroutine dtrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
DTRMM
Definition dtrmm.f:177