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

◆ dlarz()

subroutine dlarz ( character side,
integer m,
integer n,
integer l,
double precision, dimension( * ) v,
integer incv,
double precision tau,
double precision, dimension( ldc, * ) c,
integer ldc,
double precision, dimension( * ) work )

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

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

Purpose:
!>
!> DLARZ applies a real elementary reflector H to a real M-by-N
!> matrix C, from either the left or the right. H is represented in the
!> form
!>
!>       H = I - tau * v * v**T
!>
!> where tau is a real scalar and v is a real vector.
!>
!> If tau = 0, then H is taken to be the unit matrix.
!>
!>
!> H is a product of k elementary reflectors as returned by DTZRZF.
!> 
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 DOUBLE PRECISION array, dimension (1+(L-1)*abs(INCV))
!>          The vector v in the representation of H as returned by
!>          DTZRZF. V is not used if TAU = 0.
!> 
[in]INCV
!>          INCV is INTEGER
!>          The increment between elements of v. INCV <> 0.
!> 
[in]TAU
!>          TAU is DOUBLE PRECISION
!>          The value tau in the representation of H.
!> 
[in,out]C
!>          C is DOUBLE PRECISION 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 DOUBLE PRECISION 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 142 of file dlarz.f.

143*
144* -- LAPACK computational routine --
145* -- LAPACK is a software package provided by Univ. of Tennessee, --
146* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
147*
148* .. Scalar Arguments ..
149 CHARACTER SIDE
150 INTEGER INCV, L, LDC, M, N
151 DOUBLE PRECISION TAU
152* ..
153* .. Array Arguments ..
154 DOUBLE PRECISION C( LDC, * ), V( * ), WORK( * )
155* ..
156*
157* =====================================================================
158*
159* .. Parameters ..
160 DOUBLE PRECISION ONE, ZERO
161 parameter( one = 1.0d+0, zero = 0.0d+0 )
162* ..
163* .. External Subroutines ..
164 EXTERNAL daxpy, dcopy, dgemv, dger
165* ..
166* .. External Functions ..
167 LOGICAL LSAME
168 EXTERNAL lsame
169* ..
170* .. Executable Statements ..
171*
172 IF( lsame( side, 'L' ) ) THEN
173*
174* Form H * C
175*
176 IF( tau.NE.zero ) THEN
177*
178* w( 1:n ) = C( 1, 1:n )
179*
180 CALL dcopy( n, c, ldc, work, 1 )
181*
182* w( 1:n ) = w( 1:n ) + C( m-l+1:m, 1:n )**T * v( 1:l )
183*
184 CALL dgemv( 'Transpose', l, n, one, c( m-l+1, 1 ), ldc,
185 $ v,
186 $ incv, one, work, 1 )
187*
188* C( 1, 1:n ) = C( 1, 1:n ) - tau * w( 1:n )
189*
190 CALL daxpy( n, -tau, work, 1, c, ldc )
191*
192* C( m-l+1:m, 1:n ) = C( m-l+1:m, 1:n ) - ...
193* tau * v( 1:l ) * w( 1:n )**T
194*
195 CALL dger( l, n, -tau, v, incv, work, 1, c( m-l+1, 1 ),
196 $ ldc )
197 END IF
198*
199 ELSE
200*
201* Form C * H
202*
203 IF( tau.NE.zero ) THEN
204*
205* w( 1:m ) = C( 1:m, 1 )
206*
207 CALL dcopy( m, c, 1, work, 1 )
208*
209* w( 1:m ) = w( 1:m ) + C( 1:m, n-l+1:n, 1:n ) * v( 1:l )
210*
211 CALL dgemv( 'No transpose', m, l, one, c( 1, n-l+1 ),
212 $ ldc,
213 $ v, incv, one, work, 1 )
214*
215* C( 1:m, 1 ) = C( 1:m, 1 ) - tau * w( 1:m )
216*
217 CALL daxpy( m, -tau, work, 1, c, 1 )
218*
219* C( 1:m, n-l+1:n ) = C( 1:m, n-l+1:n ) - ...
220* tau * w( 1:m ) * v( 1:l )**T
221*
222 CALL dger( m, l, -tau, work, 1, v, incv, c( 1, n-l+1 ),
223 $ ldc )
224*
225 END IF
226*
227 END IF
228*
229 RETURN
230*
231* End of DLARZ
232*
subroutine daxpy(n, da, dx, incx, dy, incy)
DAXPY
Definition daxpy.f:89
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
Definition dcopy.f:82
subroutine dgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
DGEMV
Definition dgemv.f:158
subroutine dger(m, n, alpha, x, incx, y, incy, a, lda)
DGER
Definition dger.f:130
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: