 LAPACK  3.8.0 LAPACK: Linear Algebra PACKage

## ◆ slarz()

 subroutine slarz ( character SIDE, integer M, integer N, integer L, real, dimension( * ) V, integer INCV, real TAU, real, dimension( ldc, * ) C, integer LDC, real, dimension( * ) WORK )

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

Purpose:
``` SLARZ 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 STZRZF.```
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 REAL array, dimension (1+(L-1)*abs(INCV)) The vector v in the representation of H as returned by STZRZF. V is not used if TAU = 0.``` [in] INCV ``` INCV is INTEGER The increment between elements of v. INCV <> 0.``` [in] TAU ``` TAU is REAL The value tau in the representation of H.``` [in,out] C ``` C is REAL 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 REAL array, dimension (N) if SIDE = 'L' or (M) if SIDE = 'R'```
Date
December 2016
Contributors:
A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
Further Details:
` `

Definition at line 147 of file slarz.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  REAL tau
157 * ..
158 * .. Array Arguments ..
159  REAL c( ldc, * ), v( * ), work( * )
160 * ..
161 *
162 * =====================================================================
163 *
164 * .. Parameters ..
165  REAL one, zero
166  parameter( one = 1.0e+0, zero = 0.0e+0 )
167 * ..
168 * .. External Subroutines ..
169  EXTERNAL saxpy, scopy, sgemv, sger
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 scopy( 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 sgemv( '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 saxpy( 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 sger( 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 scopy( 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 sgemv( '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 saxpy( 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 sger( 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 SLARZ
235 *
subroutine scopy(N, SX, INCX, SY, INCY)
SCOPY
Definition: scopy.f:84
subroutine saxpy(N, SA, SX, INCX, SY, INCY)
SAXPY
Definition: saxpy.f:91
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55
subroutine sger(M, N, ALPHA, X, INCX, Y, INCY, A, LDA)
SGER
Definition: sger.f:132
subroutine sgemv(TRANS, M, N, ALPHA, A, LDA, X, INCX, BETA, Y, INCY)
SGEMV
Definition: sgemv.f:158
Here is the call graph for this function:
Here is the caller graph for this function: