1 *> \brief \b SORMR3 multiplies a general matrix by the orthogonal matrix from a RZ factorization determined by stzrzf (unblocked algorithm).
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download SORMR3 + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/sormr3.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/sormr3.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/sormr3.f">
21 * SUBROUTINE SORMR3( SIDE, TRANS, M, N, K, L, A, LDA, TAU, C, LDC,
24 * .. Scalar Arguments ..
25 * CHARACTER SIDE, TRANS
26 * INTEGER INFO, K, L, LDA, LDC, M, N
28 * .. Array Arguments ..
29 * REAL A( LDA, * ), C( LDC, * ), TAU( * ), WORK( * )
38 *> SORMR3 overwrites the general real m by n matrix C with
40 *> Q * C if SIDE = 'L' and TRANS = 'N', or
42 *> Q**T* C if SIDE = 'L' and TRANS = 'C', or
44 *> C * Q if SIDE = 'R' and TRANS = 'N', or
46 *> C * Q**T if SIDE = 'R' and TRANS = 'C',
48 *> where Q is a real orthogonal matrix defined as the product of k
49 *> elementary reflectors
51 *> Q = H(1) H(2) . . . H(k)
53 *> as returned by STZRZF. Q is of order m if SIDE = 'L' and of order n
62 *> SIDE is CHARACTER*1
63 *> = 'L': apply Q or Q**T from the Left
64 *> = 'R': apply Q or Q**T from the Right
69 *> TRANS is CHARACTER*1
70 *> = 'N': apply Q (No transpose)
71 *> = 'T': apply Q**T (Transpose)
77 *> The number of rows of the matrix C. M >= 0.
83 *> The number of columns of the matrix C. N >= 0.
89 *> The number of elementary reflectors whose product defines
91 *> If SIDE = 'L', M >= K >= 0;
92 *> if SIDE = 'R', N >= K >= 0.
98 *> The number of columns of the matrix A containing
99 *> the meaningful part of the Householder reflectors.
100 *> If SIDE = 'L', M >= L >= 0, if SIDE = 'R', N >= L >= 0.
105 *> A is REAL array, dimension
106 *> (LDA,M) if SIDE = 'L',
107 *> (LDA,N) if SIDE = 'R'
108 *> The i-th row must contain the vector which defines the
109 *> elementary reflector H(i), for i = 1,2,...,k, as returned by
110 *> STZRZF in the last k rows of its array argument A.
111 *> A is modified by the routine but restored on exit.
117 *> The leading dimension of the array A. LDA >= max(1,K).
122 *> TAU is REAL array, dimension (K)
123 *> TAU(i) must contain the scalar factor of the elementary
124 *> reflector H(i), as returned by STZRZF.
129 *> C is REAL array, dimension (LDC,N)
130 *> On entry, the m-by-n matrix C.
131 *> On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.
137 *> The leading dimension of the array C. LDC >= max(1,M).
142 *> WORK is REAL array, dimension
143 *> (N) if SIDE = 'L',
150 *> = 0: successful exit
151 *> < 0: if INFO = -i, the i-th argument had an illegal value
157 *> \author Univ. of Tennessee
158 *> \author Univ. of California Berkeley
159 *> \author Univ. of Colorado Denver
162 *> \date September 2012
164 *> \ingroup realOTHERcomputational
166 *> \par Contributors:
169 *> A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
171 *> \par Further Details:
172 * =====================
177 * =====================================================================
178 SUBROUTINE SORMR3( SIDE, TRANS, M, N, K, L, A, LDA, TAU, C, LDC,
181 * -- LAPACK computational routine (version 3.4.2) --
182 * -- LAPACK is a software package provided by Univ. of Tennessee, --
183 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
186 * .. Scalar Arguments ..
187 CHARACTER SIDE, TRANS
188 INTEGER INFO, K, L, LDA, LDC, M, N
190 * .. Array Arguments ..
191 REAL A( LDA, * ), C( LDC, * ), TAU( * ), WORK( * )
194 * =====================================================================
196 * .. Local Scalars ..
198 INTEGER I, I1, I2, I3, IC, JA, JC, MI, NI, NQ
200 * .. External Functions ..
204 * .. External Subroutines ..
205 EXTERNAL SLARZ, XERBLA
207 * .. Intrinsic Functions ..
210 * .. Executable Statements ..
212 * Test the input arguments
215 LEFT = LSAME( SIDE, 'L' )
216 NOTRAN = LSAME( TRANS, 'N' )
218 * NQ is the order of Q
225 IF( .NOT.LEFT .AND. .NOT.LSAME( SIDE, 'R' ) ) THEN
227 ELSE IF( .NOT.NOTRAN .AND. .NOT.LSAME( TRANS, 'T' ) ) THEN
229 ELSE IF( M.LT.0 ) THEN
231 ELSE IF( N.LT.0 ) THEN
233 ELSE IF( K.LT.0 .OR. K.GT.NQ ) THEN
235 ELSE IF( L.LT.0 .OR. ( LEFT .AND. ( L.GT.M ) ) .OR.
236 $ ( .NOT.LEFT .AND. ( L.GT.N ) ) ) THEN
238 ELSE IF( LDA.LT.MAX( 1, K ) ) THEN
240 ELSE IF( LDC.LT.MAX( 1, M ) ) THEN
244 CALL XERBLA( 'SORMR3', -INFO )
248 * Quick return if possible
250 IF( M.EQ.0 .OR. N.EQ.0 .OR. K.EQ.0 )
253 IF( ( LEFT .AND. .NOT.NOTRAN .OR. .NOT.LEFT .AND. NOTRAN ) ) THEN
276 * H(i) or H(i)**T is applied to C(i:m,1:n)
282 * H(i) or H(i)**T is applied to C(1:m,i:n)
288 * Apply H(i) or H(i)**T
290 CALL SLARZ( SIDE, MI, NI, L, A( I, JA ), LDA, TAU( I ),
291 $ C( IC, JC ), LDC, WORK )