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

◆ clarz()

subroutine clarz ( character side,
integer m,
integer n,
integer l,
complex, dimension( * ) v,
integer incv,
complex tau,
complex, dimension( ldc, * ) c,
integer ldc,
complex, dimension( * ) work )

CLARZ applies an elementary reflector (as returned by stzrzf) to a general matrix.

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

Purpose:
!>
!> CLARZ applies a complex elementary reflector H to a complex
!> M-by-N matrix C, from either the left or the right. H is represented
!> in the form
!>
!>       H = I - tau * v * v**H
!>
!> where tau is a complex scalar and v is a complex vector.
!>
!> If tau = 0, then H is taken to be the unit matrix.
!>
!> To apply H**H (the conjugate transpose of H), supply conjg(tau) instead
!> tau.
!>
!> H is a product of k elementary reflectors as returned by CTZRZF.
!> 
Parameters
[in]SIDE
!>          SIDE is CHARACTER*1
!>          = 'L': form  H * C
!>          = 'R': form  C * H
!> 
[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]L
!>          L is INTEGER
!>          The number of entries of the vector V containing
!>          the meaningful part of the Householder vectors.
!>          If SIDE = 'L', M >= L >= 0, if SIDE = 'R', N >= L >= 0.
!> 
[in]V
!>          V is COMPLEX array, dimension (1+(L-1)*abs(INCV))
!>          The vector v in the representation of H as returned by
!>          CTZRZF. V is not used if TAU = 0.
!> 
[in]INCV
!>          INCV is INTEGER
!>          The increment between elements of v. INCV <> 0.
!> 
[in]TAU
!>          TAU is COMPLEX
!>          The value tau in the representation of H.
!> 
[in,out]C
!>          C is COMPLEX array, dimension (LDC,N)
!>          On entry, the M-by-N matrix C.
!>          On exit, C is overwritten by the matrix H * C if SIDE = 'L',
!>          or C * H if SIDE = 'R'.
!> 
[in]LDC
!>          LDC is INTEGER
!>          The leading dimension of the array C. LDC >= max(1,M).
!> 
[out]WORK
!>          WORK is COMPLEX array, dimension
!>                         (N) if SIDE = 'L'
!>                      or (M) if SIDE = 'R'
!> 
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 144 of file clarz.f.

145*
146* -- LAPACK computational routine --
147* -- LAPACK is a software package provided by Univ. of Tennessee, --
148* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
149*
150* .. Scalar Arguments ..
151 CHARACTER SIDE
152 INTEGER INCV, L, LDC, M, N
153 COMPLEX TAU
154* ..
155* .. Array Arguments ..
156 COMPLEX C( LDC, * ), V( * ), WORK( * )
157* ..
158*
159* =====================================================================
160*
161* .. Parameters ..
162 COMPLEX ONE, ZERO
163 parameter( one = ( 1.0e+0, 0.0e+0 ),
164 $ zero = ( 0.0e+0, 0.0e+0 ) )
165* ..
166* .. External Subroutines ..
167 EXTERNAL caxpy, ccopy, cgemv, cgerc, cgeru,
168 $ clacgv
169* ..
170* .. External Functions ..
171 LOGICAL LSAME
172 EXTERNAL lsame
173* ..
174* .. Executable Statements ..
175*
176 IF( lsame( side, 'L' ) ) THEN
177*
178* Form H * C
179*
180 IF( tau.NE.zero ) THEN
181*
182* w( 1:n ) = conjg( C( 1, 1:n ) )
183*
184 CALL ccopy( n, c, ldc, work, 1 )
185 CALL clacgv( n, work, 1 )
186*
187* w( 1:n ) = conjg( w( 1:n ) + C( m-l+1:m, 1:n )**H * v( 1:l ) )
188*
189 CALL cgemv( 'Conjugate transpose', l, n, one, c( m-l+1,
190 $ 1 ),
191 $ ldc, v, incv, one, work, 1 )
192 CALL clacgv( n, work, 1 )
193*
194* C( 1, 1:n ) = C( 1, 1:n ) - tau * w( 1:n )
195*
196 CALL caxpy( n, -tau, work, 1, c, ldc )
197*
198* C( m-l+1:m, 1:n ) = C( m-l+1:m, 1:n ) - ...
199* tau * v( 1:l ) * w( 1:n )**H
200*
201 CALL cgeru( l, n, -tau, v, incv, work, 1, c( m-l+1, 1 ),
202 $ ldc )
203 END IF
204*
205 ELSE
206*
207* Form C * H
208*
209 IF( tau.NE.zero ) THEN
210*
211* w( 1:m ) = C( 1:m, 1 )
212*
213 CALL ccopy( m, c, 1, work, 1 )
214*
215* w( 1:m ) = w( 1:m ) + C( 1:m, n-l+1:n, 1:n ) * v( 1:l )
216*
217 CALL cgemv( 'No transpose', m, l, one, c( 1, n-l+1 ),
218 $ ldc,
219 $ v, incv, one, work, 1 )
220*
221* C( 1:m, 1 ) = C( 1:m, 1 ) - tau * w( 1:m )
222*
223 CALL caxpy( m, -tau, work, 1, c, 1 )
224*
225* C( 1:m, n-l+1:n ) = C( 1:m, n-l+1:n ) - ...
226* tau * w( 1:m ) * v( 1:l )**H
227*
228 CALL cgerc( m, l, -tau, work, 1, v, incv, c( 1, n-l+1 ),
229 $ ldc )
230*
231 END IF
232*
233 END IF
234*
235 RETURN
236*
237* End of CLARZ
238*
subroutine caxpy(n, ca, cx, incx, cy, incy)
CAXPY
Definition caxpy.f:88
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
Definition ccopy.f:81
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
Definition cgemv.f:160
subroutine cgerc(m, n, alpha, x, incx, y, incy, a, lda)
CGERC
Definition cgerc.f:130
subroutine cgeru(m, n, alpha, x, incx, y, incy, a, lda)
CGERU
Definition cgeru.f:130
subroutine clacgv(n, x, incx)
CLACGV conjugates a complex vector.
Definition clacgv.f:72
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function:
Here is the caller graph for this function: