1 *> \brief \b SLARZ 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 SLARZ + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/slarz.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/slarz.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/slarz.f">
21 * SUBROUTINE SLARZ( SIDE, M, N, L, V, INCV, TAU, C, LDC, WORK )
23 * .. Scalar Arguments ..
25 * INTEGER INCV, L, LDC, M, N
28 * .. Array Arguments ..
29 * REAL C( LDC, * ), V( * ), WORK( * )
38 *> SLARZ applies a real elementary reflector H to a real M-by-N
39 *> matrix C, from either the left or the right. H is represented in the
42 *> H = I - tau * v * v**T
44 *> where tau is a real scalar and v is a real vector.
46 *> If tau = 0, then H is taken to be the unit matrix.
49 *> H is a product of k elementary reflectors as returned by STZRZF.
57 *> SIDE is CHARACTER*1
65 *> The number of rows of the matrix C.
71 *> The number of columns of the matrix C.
77 *> The number of entries of the vector V containing
78 *> the meaningful part of the Householder vectors.
79 *> If SIDE = 'L', M >= L >= 0, if SIDE = 'R', N >= L >= 0.
84 *> V is REAL array, dimension (1+(L-1)*abs(INCV))
85 *> The vector v in the representation of H as returned by
86 *> STZRZF. V is not used if TAU = 0.
92 *> The increment between elements of v. INCV <> 0.
98 *> The value tau in the representation of H.
103 *> C is REAL array, dimension (LDC,N)
104 *> On entry, the M-by-N matrix C.
105 *> On exit, C is overwritten by the matrix H * C if SIDE = 'L',
106 *> or C * H if SIDE = 'R'.
112 *> The leading dimension of the array C. LDC >= max(1,M).
117 *> WORK is REAL array, dimension
119 *> or (M) if SIDE = 'R'
125 *> \author Univ. of Tennessee
126 *> \author Univ. of California Berkeley
127 *> \author Univ. of Colorado Denver
130 *> \date September 2012
132 *> \ingroup realOTHERcomputational
134 *> \par Contributors:
137 *> A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
139 *> \par Further Details:
140 * =====================
145 * =====================================================================
146 SUBROUTINE SLARZ( SIDE, M, N, L, V, INCV, TAU, C, LDC, WORK )
148 * -- LAPACK computational routine (version 3.4.2) --
149 * -- LAPACK is a software package provided by Univ. of Tennessee, --
150 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
153 * .. Scalar Arguments ..
155 INTEGER INCV, L, LDC, M, N
158 * .. Array Arguments ..
159 REAL C( LDC, * ), V( * ), WORK( * )
162 * =====================================================================
166 PARAMETER ( ONE = 1.0E+0, ZERO = 0.0E+0 )
168 * .. External Subroutines ..
169 EXTERNAL SAXPY, SCOPY, SGEMV, SGER
171 * .. External Functions ..
175 * .. Executable Statements ..
177 IF( LSAME( SIDE, 'L' ) ) THEN
181 IF( TAU.NE.ZERO ) THEN
183 * w( 1:n ) = C( 1, 1:n )
185 CALL SCOPY( N, C, LDC, WORK, 1 )
187 * w( 1:n ) = w( 1:n ) + C( m-l+1:m, 1:n )**T * v( 1:l )
189 CALL SGEMV( 'Transpose', L, N, ONE, C( M-L+1, 1 ), LDC, V,
190 $ INCV, ONE, WORK, 1 )
192 * C( 1, 1:n ) = C( 1, 1:n ) - tau * w( 1:n )
194 CALL SAXPY( N, -TAU, WORK, 1, C, LDC )
196 * C( m-l+1:m, 1:n ) = C( m-l+1:m, 1:n ) - ...
197 * tau * v( 1:l ) * w( 1:n )**T
199 CALL SGER( L, N, -TAU, V, INCV, WORK, 1, C( M-L+1, 1 ),
207 IF( TAU.NE.ZERO ) THEN
209 * w( 1:m ) = C( 1:m, 1 )
211 CALL SCOPY( M, C, 1, WORK, 1 )
213 * w( 1:m ) = w( 1:m ) + C( 1:m, n-l+1:n, 1:n ) * v( 1:l )
215 CALL SGEMV( 'No transpose', M, L, ONE, C( 1, N-L+1 ), LDC,
216 $ V, INCV, ONE, WORK, 1 )
218 * C( 1:m, 1 ) = C( 1:m, 1 ) - tau * w( 1:m )
220 CALL SAXPY( M, -TAU, WORK, 1, C, 1 )
222 * C( 1:m, n-l+1:n ) = C( 1:m, n-l+1:n ) - ...
223 * tau * w( 1:m ) * v( 1:l )**T
225 CALL SGER( M, L, -TAU, WORK, 1, V, INCV, C( 1, N-L+1 ),