LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ clarzb()

subroutine clarzb ( character side,
character trans,
character direct,
character storev,
integer m,
integer n,
integer k,
integer l,
complex, dimension( ldv, * ) v,
integer ldv,
complex, dimension( ldt, * ) t,
integer ldt,
complex, dimension( ldc, * ) c,
integer ldc,
complex, dimension( ldwork, * ) work,
integer ldwork )

CLARZB applies a block reflector or its conjugate-transpose to a general matrix.

Download CLARZB + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> CLARZB applies a complex block reflector H or its transpose H**H
!> to a complex distributed M-by-N  C from the left or the right.
!>
!> Currently, only STOREV = 'R' and DIRECT = 'B' are supported.
!> 
Parameters
[in]SIDE
!>          SIDE is CHARACTER*1
!>          = 'L': apply H or H**H from the Left
!>          = 'R': apply H or H**H from the Right
!> 
[in]TRANS
!>          TRANS is CHARACTER*1
!>          = 'N': apply H (No transpose)
!>          = 'C': apply H**H (Conjugate transpose)
!> 
[in]DIRECT
!>          DIRECT is CHARACTER*1
!>          Indicates how H is formed from a product of elementary
!>          reflectors
!>          = 'F': H = H(1) H(2) . . . H(k) (Forward, not supported yet)
!>          = 'B': H = H(k) . . . H(2) H(1) (Backward)
!> 
[in]STOREV
!>          STOREV is CHARACTER*1
!>          Indicates how the vectors which define the elementary
!>          reflectors are stored:
!>          = 'C': Columnwise                        (not supported yet)
!>          = 'R': Rowwise
!> 
[in]M
!>          M is INTEGER
!>          The number of rows of the matrix C.
!> 
[in]N
!>          N is INTEGER
!>          The number of columns of the matrix C.
!> 
[in]K
!>          K is INTEGER
!>          The order of the matrix T (= the number of elementary
!>          reflectors whose product defines the block reflector).
!> 
[in]L
!>          L is INTEGER
!>          The number of columns of the matrix V containing the
!>          meaningful part of the Householder reflectors.
!>          If SIDE = 'L', M >= L >= 0, if SIDE = 'R', N >= L >= 0.
!> 
[in]V
!>          V is COMPLEX array, dimension (LDV,NV).
!>          If STOREV = 'C', NV = K; if STOREV = 'R', NV = L.
!> 
[in]LDV
!>          LDV is INTEGER
!>          The leading dimension of the array V.
!>          If STOREV = 'C', LDV >= L; if STOREV = 'R', LDV >= K.
!> 
[in]T
!>          T is COMPLEX array, dimension (LDT,K)
!>          The triangular K-by-K matrix T in the representation of the
!>          block reflector.
!> 
[in]LDT
!>          LDT is INTEGER
!>          The leading dimension of the array T. LDT >= K.
!> 
[in,out]C
!>          C is COMPLEX array, dimension (LDC,N)
!>          On entry, the M-by-N matrix C.
!>          On exit, C is overwritten by H*C or H**H*C or C*H or C*H**H.
!> 
[in]LDC
!>          LDC is INTEGER
!>          The leading dimension of the array C. LDC >= max(1,M).
!> 
[out]WORK
!>          WORK is COMPLEX array, dimension (LDWORK,K)
!> 
[in]LDWORK
!>          LDWORK is INTEGER
!>          The leading dimension of the array WORK.
!>          If SIDE = 'L', LDWORK >= max(1,N);
!>          if SIDE = 'R', LDWORK >= max(1,M).
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
Further Details:
!> 

Definition at line 179 of file clarzb.f.

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 COMPLEX C( LDC, * ), T( LDT, * ), V( LDV, * ),
192 $ WORK( LDWORK, * )
193* ..
194*
195* =====================================================================
196*
197* .. Parameters ..
198 COMPLEX ONE
199 parameter( one = ( 1.0e+0, 0.0e+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 ccopy, cgemm, clacgv, ctrmm, 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( 'CLARZB', -info )
229 RETURN
230 END IF
231*
232 IF( lsame( trans, 'N' ) ) THEN
233 transt = 'C'
234 ELSE
235 transt = 'N'
236 END IF
237*
238 IF( lsame( side, 'L' ) ) THEN
239*
240* Form H * C or H**H * C
241*
242* W( 1:n, 1:k ) = C( 1:k, 1:n )**H
243*
244 DO 10 j = 1, k
245 CALL ccopy( 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 )**H * V( 1:k, 1:l )**T
250*
251 IF( l.GT.0 )
252 $ CALL cgemm( 'Transpose', 'Conjugate transpose', n, k, l,
253 $ one, c( m-l+1, 1 ), ldc, v, ldv, one, work,
254 $ ldwork )
255*
256* W( 1:n, 1:k ) = W( 1:n, 1:k ) * T**T or W( 1:m, 1:k ) * T
257*
258 CALL ctrmm( 'Right', 'Lower', transt, 'Non-unit', n, k, one,
259 $ t,
260 $ ldt, work, ldwork )
261*
262* C( 1:k, 1:n ) = C( 1:k, 1:n ) - W( 1:n, 1:k )**H
263*
264 DO 30 j = 1, n
265 DO 20 i = 1, k
266 c( i, j ) = c( i, j ) - work( j, i )
267 20 CONTINUE
268 30 CONTINUE
269*
270* C( m-l+1:m, 1:n ) = C( m-l+1:m, 1:n ) - ...
271* V( 1:k, 1:l )**H * W( 1:n, 1:k )**H
272*
273 IF( l.GT.0 )
274 $ CALL cgemm( 'Transpose', 'Transpose', l, n, k, -one, v,
275 $ ldv,
276 $ work, ldwork, one, c( m-l+1, 1 ), ldc )
277*
278 ELSE IF( lsame( side, 'R' ) ) THEN
279*
280* Form C * H or C * H**H
281*
282* W( 1:m, 1:k ) = C( 1:m, 1:k )
283*
284 DO 40 j = 1, k
285 CALL ccopy( m, c( 1, j ), 1, work( 1, j ), 1 )
286 40 CONTINUE
287*
288* W( 1:m, 1:k ) = W( 1:m, 1:k ) + ...
289* C( 1:m, n-l+1:n ) * V( 1:k, 1:l )**H
290*
291 IF( l.GT.0 )
292 $ CALL cgemm( 'No transpose', 'Transpose', m, k, l, one,
293 $ c( 1, n-l+1 ), ldc, v, ldv, one, work, ldwork )
294*
295* W( 1:m, 1:k ) = W( 1:m, 1:k ) * conjg( T ) or
296* W( 1:m, 1:k ) * T**H
297*
298 DO 50 j = 1, k
299 CALL clacgv( k-j+1, t( j, j ), 1 )
300 50 CONTINUE
301 CALL ctrmm( 'Right', 'Lower', trans, 'Non-unit', m, k, one,
302 $ t,
303 $ ldt, work, ldwork )
304 DO 60 j = 1, k
305 CALL clacgv( k-j+1, t( j, j ), 1 )
306 60 CONTINUE
307*
308* C( 1:m, 1:k ) = C( 1:m, 1:k ) - W( 1:m, 1:k )
309*
310 DO 80 j = 1, k
311 DO 70 i = 1, m
312 c( i, j ) = c( i, j ) - work( i, j )
313 70 CONTINUE
314 80 CONTINUE
315*
316* C( 1:m, n-l+1:n ) = C( 1:m, n-l+1:n ) - ...
317* W( 1:m, 1:k ) * conjg( V( 1:k, 1:l ) )
318*
319 DO 90 j = 1, l
320 CALL clacgv( k, v( 1, j ), 1 )
321 90 CONTINUE
322 IF( l.GT.0 )
323 $ CALL cgemm( 'No transpose', 'No transpose', m, l, k,
324 $ -one,
325 $ work, ldwork, v, ldv, one, c( 1, n-l+1 ), ldc )
326 DO 100 j = 1, l
327 CALL clacgv( k, v( 1, j ), 1 )
328 100 CONTINUE
329*
330 END IF
331*
332 RETURN
333*
334* End of CLARZB
335*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
Definition ccopy.f:81
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
Definition cgemm.f:188
subroutine clacgv(n, x, incx)
CLACGV conjugates a complex vector.
Definition clacgv.f:72
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine ctrmm(side, uplo, transa, diag, m, n, alpha, a, lda, b, ldb)
CTRMM
Definition ctrmm.f:177
Here is the call graph for this function:
Here is the caller graph for this function: