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

◆ zlarz()

subroutine zlarz ( character  SIDE,
integer  M,
integer  N,
integer  L,
complex*16, dimension( * )  V,
integer  INCV,
complex*16  TAU,
complex*16, dimension( ldc, * )  C,
integer  LDC,
complex*16, dimension( * )  WORK 
)

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

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

Purpose:
 ZLARZ 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 ZTZRZF.
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*16 array, dimension (1+(L-1)*abs(INCV))
          The vector v in the representation of H as returned by
          ZTZRZF. 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*16
          The value tau in the representation of H.
[in,out]C
          C is COMPLEX*16 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*16 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 146 of file zlarz.f.

147*
148* -- LAPACK computational routine --
149* -- LAPACK is a software package provided by Univ. of Tennessee, --
150* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
151*
152* .. Scalar Arguments ..
153 CHARACTER SIDE
154 INTEGER INCV, L, LDC, M, N
155 COMPLEX*16 TAU
156* ..
157* .. Array Arguments ..
158 COMPLEX*16 C( LDC, * ), V( * ), WORK( * )
159* ..
160*
161* =====================================================================
162*
163* .. Parameters ..
164 COMPLEX*16 ONE, ZERO
165 parameter( one = ( 1.0d+0, 0.0d+0 ),
166 $ zero = ( 0.0d+0, 0.0d+0 ) )
167* ..
168* .. External Subroutines ..
169 EXTERNAL zaxpy, zcopy, zgemv, zgerc, zgeru, zlacgv
170* ..
171* .. External Functions ..
172 LOGICAL LSAME
173 EXTERNAL lsame
174* ..
175* .. Executable Statements ..
176*
177 IF( lsame( side, 'L' ) ) THEN
178*
179* Form H * C
180*
181 IF( tau.NE.zero ) THEN
182*
183* w( 1:n ) = conjg( C( 1, 1:n ) )
184*
185 CALL zcopy( n, c, ldc, work, 1 )
186 CALL zlacgv( n, work, 1 )
187*
188* w( 1:n ) = conjg( w( 1:n ) + C( m-l+1:m, 1:n )**H * v( 1:l ) )
189*
190 CALL zgemv( 'Conjugate transpose', l, n, one, c( m-l+1, 1 ),
191 $ ldc, v, incv, one, work, 1 )
192 CALL zlacgv( n, work, 1 )
193*
194* C( 1, 1:n ) = C( 1, 1:n ) - tau * w( 1:n )
195*
196 CALL zaxpy( 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 zgeru( 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 zcopy( 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 zgemv( 'No transpose', m, l, one, c( 1, n-l+1 ), ldc,
218 $ v, incv, one, work, 1 )
219*
220* C( 1:m, 1 ) = C( 1:m, 1 ) - tau * w( 1:m )
221*
222 CALL zaxpy( m, -tau, work, 1, c, 1 )
223*
224* C( 1:m, n-l+1:n ) = C( 1:m, n-l+1:n ) - ...
225* tau * w( 1:m ) * v( 1:l )**H
226*
227 CALL zgerc( m, l, -tau, work, 1, v, incv, c( 1, n-l+1 ),
228 $ ldc )
229*
230 END IF
231*
232 END IF
233*
234 RETURN
235*
236* End of ZLARZ
237*
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
subroutine zaxpy(N, ZA, ZX, INCX, ZY, INCY)
ZAXPY
Definition: zaxpy.f:88
subroutine zcopy(N, ZX, INCX, ZY, INCY)
ZCOPY
Definition: zcopy.f:81
subroutine zgeru(M, N, ALPHA, X, INCX, Y, INCY, A, LDA)
ZGERU
Definition: zgeru.f:130
subroutine zgerc(M, N, ALPHA, X, INCX, Y, INCY, A, LDA)
ZGERC
Definition: zgerc.f:130
subroutine zgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
ZGEMV
Definition: zgemv.f:158
subroutine zlacgv(N, X, INCX)
ZLACGV conjugates a complex vector.
Definition: zlacgv.f:74
Here is the call graph for this function:
Here is the caller graph for this function: