LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ 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.
Date
December 2016
Contributors:
A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
Further Details:
 

Definition at line 147 of file dlarz.f.

147 *
148 * -- LAPACK computational routine (version 3.7.0) --
149 * -- LAPACK is a software package provided by Univ. of Tennessee, --
150 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
151 * December 2016
152 *
153 * .. Scalar Arguments ..
154  CHARACTER side
155  INTEGER incv, l, ldc, m, n
156  DOUBLE PRECISION tau
157 * ..
158 * .. Array Arguments ..
159  DOUBLE PRECISION c( ldc, * ), v( * ), work( * )
160 * ..
161 *
162 * =====================================================================
163 *
164 * .. Parameters ..
165  DOUBLE PRECISION one, zero
166  parameter( one = 1.0d+0, zero = 0.0d+0 )
167 * ..
168 * .. External Subroutines ..
169  EXTERNAL daxpy, dcopy, dgemv, dger
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 ) = C( 1, 1:n )
184 *
185  CALL dcopy( n, c, ldc, work, 1 )
186 *
187 * w( 1:n ) = w( 1:n ) + C( m-l+1:m, 1:n )**T * v( 1:l )
188 *
189  CALL dgemv( 'Transpose', l, n, one, c( m-l+1, 1 ), ldc, v,
190  $ incv, one, work, 1 )
191 *
192 * C( 1, 1:n ) = C( 1, 1:n ) - tau * w( 1:n )
193 *
194  CALL daxpy( n, -tau, work, 1, c, ldc )
195 *
196 * C( m-l+1:m, 1:n ) = C( m-l+1:m, 1:n ) - ...
197 * tau * v( 1:l ) * w( 1:n )**T
198 *
199  CALL dger( l, n, -tau, v, incv, work, 1, c( m-l+1, 1 ),
200  $ ldc )
201  END IF
202 *
203  ELSE
204 *
205 * Form C * H
206 *
207  IF( tau.NE.zero ) THEN
208 *
209 * w( 1:m ) = C( 1:m, 1 )
210 *
211  CALL dcopy( m, c, 1, work, 1 )
212 *
213 * w( 1:m ) = w( 1:m ) + C( 1:m, n-l+1:n, 1:n ) * v( 1:l )
214 *
215  CALL dgemv( 'No transpose', m, l, one, c( 1, n-l+1 ), ldc,
216  $ v, incv, one, work, 1 )
217 *
218 * C( 1:m, 1 ) = C( 1:m, 1 ) - tau * w( 1:m )
219 *
220  CALL daxpy( m, -tau, work, 1, c, 1 )
221 *
222 * C( 1:m, n-l+1:n ) = C( 1:m, n-l+1:n ) - ...
223 * tau * w( 1:m ) * v( 1:l )**T
224 *
225  CALL dger( m, l, -tau, work, 1, v, incv, c( 1, n-l+1 ),
226  $ ldc )
227 *
228  END IF
229 *
230  END IF
231 *
232  RETURN
233 *
234 * End of DLARZ
235 *
subroutine dcopy(N, DX, INCX, DY, INCY)
DCOPY
Definition: dcopy.f:84
subroutine dgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
DGEMV
Definition: dgemv.f:158
subroutine daxpy(N, DA, DX, INCX, DY, INCY)
DAXPY
Definition: daxpy.f:91
subroutine dger(M, N, ALPHA, X, INCX, Y, INCY, A, LDA)
DGER
Definition: dger.f:132
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
Here is the call graph for this function:
Here is the caller graph for this function: