1 *> \brief \b ZLARZ applies an elementary reflector (as returned by stzrzf) to a general matrix.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZLARZ + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zlarz.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zlarz.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zlarz.f">
21 * SUBROUTINE ZLARZ( SIDE, M, N, L, V, INCV, TAU, C, LDC, WORK )
23 * .. Scalar Arguments ..
25 * INTEGER INCV, L, LDC, M, N
28 * .. Array Arguments ..
29 * COMPLEX*16 C( LDC, * ), V( * ), WORK( * )
38 *> ZLARZ applies a complex elementary reflector H to a complex
39 *> M-by-N matrix C, from either the left or the right. H is represented
42 *> H = I - tau * v * v**H
44 *> where tau is a complex scalar and v is a complex vector.
46 *> If tau = 0, then H is taken to be the unit matrix.
48 *> To apply H**H (the conjugate transpose of H), supply conjg(tau) instead
51 *> H is a product of k elementary reflectors as returned by ZTZRZF.
59 *> SIDE is CHARACTER*1
67 *> The number of rows of the matrix C.
73 *> The number of columns of the matrix C.
79 *> The number of entries of the vector V containing
80 *> the meaningful part of the Householder vectors.
81 *> If SIDE = 'L', M >= L >= 0, if SIDE = 'R', N >= L >= 0.
86 *> V is COMPLEX*16 array, dimension (1+(L-1)*abs(INCV))
87 *> The vector v in the representation of H as returned by
88 *> ZTZRZF. V is not used if TAU = 0.
94 *> The increment between elements of v. INCV <> 0.
100 *> The value tau in the representation of H.
105 *> C is COMPLEX*16 array, dimension (LDC,N)
106 *> On entry, the M-by-N matrix C.
107 *> On exit, C is overwritten by the matrix H * C if SIDE = 'L',
108 *> or C * H if SIDE = 'R'.
114 *> The leading dimension of the array C. LDC >= max(1,M).
119 *> WORK is COMPLEX*16 array, dimension
121 *> or (M) if SIDE = 'R'
127 *> \author Univ. of Tennessee
128 *> \author Univ. of California Berkeley
129 *> \author Univ. of Colorado Denver
132 *> \date September 2012
134 *> \ingroup complex16OTHERcomputational
136 *> \par Contributors:
139 *> A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
141 *> \par Further Details:
142 * =====================
147 * =====================================================================
148 SUBROUTINE ZLARZ( SIDE, M, N, L, V, INCV, TAU, C, LDC, WORK )
150 * -- LAPACK computational routine (version 3.4.2) --
151 * -- LAPACK is a software package provided by Univ. of Tennessee, --
152 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
155 * .. Scalar Arguments ..
157 INTEGER INCV, L, LDC, M, N
160 * .. Array Arguments ..
161 COMPLEX*16 C( LDC, * ), V( * ), WORK( * )
164 * =====================================================================
168 PARAMETER ( ONE = ( 1.0D+0, 0.0D+0 ),
169 $ ZERO = ( 0.0D+0, 0.0D+0 ) )
171 * .. External Subroutines ..
172 EXTERNAL ZAXPY, ZCOPY, ZGEMV, ZGERC, ZGERU, ZLACGV
174 * .. External Functions ..
178 * .. Executable Statements ..
180 IF( LSAME( SIDE, 'L' ) ) THEN
184 IF( TAU.NE.ZERO ) THEN
186 * w( 1:n ) = conjg( C( 1, 1:n ) )
188 CALL ZCOPY( N, C, LDC, WORK, 1 )
189 CALL ZLACGV( N, WORK, 1 )
191 * w( 1:n ) = conjg( w( 1:n ) + C( m-l+1:m, 1:n )**H * v( 1:l ) )
193 CALL ZGEMV( 'Conjugate transpose', L, N, ONE, C( M-L+1, 1 ),
194 $ LDC, V, INCV, ONE, WORK, 1 )
195 CALL ZLACGV( N, WORK, 1 )
197 * C( 1, 1:n ) = C( 1, 1:n ) - tau * w( 1:n )
199 CALL ZAXPY( N, -TAU, WORK, 1, C, LDC )
201 * C( m-l+1:m, 1:n ) = C( m-l+1:m, 1:n ) - ...
202 * tau * v( 1:l ) * w( 1:n )**H
204 CALL ZGERU( L, N, -TAU, V, INCV, WORK, 1, C( M-L+1, 1 ),
212 IF( TAU.NE.ZERO ) THEN
214 * w( 1:m ) = C( 1:m, 1 )
216 CALL ZCOPY( M, C, 1, WORK, 1 )
218 * w( 1:m ) = w( 1:m ) + C( 1:m, n-l+1:n, 1:n ) * v( 1:l )
220 CALL ZGEMV( 'No transpose', M, L, ONE, C( 1, N-L+1 ), LDC,
221 $ V, INCV, ONE, WORK, 1 )
223 * C( 1:m, 1 ) = C( 1:m, 1 ) - tau * w( 1:m )
225 CALL ZAXPY( M, -TAU, WORK, 1, C, 1 )
227 * C( 1:m, n-l+1:n ) = C( 1:m, n-l+1:n ) - ...
228 * tau * w( 1:m ) * v( 1:l )**H
230 CALL ZGERC( M, L, -TAU, WORK, 1, V, INCV, C( 1, N-L+1 ),