LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
dormr3.f
Go to the documentation of this file.
1*> \brief \b DORMR3 multiplies a general matrix by the orthogonal matrix from a RZ factorization determined by stzrzf (unblocked algorithm).
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download DORMR3 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dormr3.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dormr3.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dormr3.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE DORMR3( SIDE, TRANS, M, N, K, L, A, LDA, TAU, C, LDC,
20* WORK, INFO )
21*
22* .. Scalar Arguments ..
23* CHARACTER SIDE, TRANS
24* INTEGER INFO, K, L, LDA, LDC, M, N
25* ..
26* .. Array Arguments ..
27* DOUBLE PRECISION A( LDA, * ), C( LDC, * ), TAU( * ), WORK( * )
28* ..
29*
30*
31*> \par Purpose:
32* =============
33*>
34*> \verbatim
35*>
36*> DORMR3 overwrites the general real m by n matrix C with
37*>
38*> Q * C if SIDE = 'L' and TRANS = 'N', or
39*>
40*> Q**T* C if SIDE = 'L' and TRANS = 'C', or
41*>
42*> C * Q if SIDE = 'R' and TRANS = 'N', or
43*>
44*> C * Q**T if SIDE = 'R' and TRANS = 'C',
45*>
46*> where Q is a real orthogonal matrix defined as the product of k
47*> elementary reflectors
48*>
49*> Q = H(1) H(2) . . . H(k)
50*>
51*> as returned by DTZRZF. Q is of order m if SIDE = 'L' and of order n
52*> if SIDE = 'R'.
53*> \endverbatim
54*
55* Arguments:
56* ==========
57*
58*> \param[in] SIDE
59*> \verbatim
60*> SIDE is CHARACTER*1
61*> = 'L': apply Q or Q**T from the Left
62*> = 'R': apply Q or Q**T from the Right
63*> \endverbatim
64*>
65*> \param[in] TRANS
66*> \verbatim
67*> TRANS is CHARACTER*1
68*> = 'N': apply Q (No transpose)
69*> = 'T': apply Q**T (Transpose)
70*> \endverbatim
71*>
72*> \param[in] M
73*> \verbatim
74*> M is INTEGER
75*> The number of rows of the matrix C. M >= 0.
76*> \endverbatim
77*>
78*> \param[in] N
79*> \verbatim
80*> N is INTEGER
81*> The number of columns of the matrix C. N >= 0.
82*> \endverbatim
83*>
84*> \param[in] K
85*> \verbatim
86*> K is INTEGER
87*> The number of elementary reflectors whose product defines
88*> the matrix Q.
89*> If SIDE = 'L', M >= K >= 0;
90*> if SIDE = 'R', N >= K >= 0.
91*> \endverbatim
92*>
93*> \param[in] L
94*> \verbatim
95*> L is INTEGER
96*> The number of columns of the matrix A containing
97*> the meaningful part of the Householder reflectors.
98*> If SIDE = 'L', M >= L >= 0, if SIDE = 'R', N >= L >= 0.
99*> \endverbatim
100*>
101*> \param[in] A
102*> \verbatim
103*> A is DOUBLE PRECISION array, dimension
104*> (LDA,M) if SIDE = 'L',
105*> (LDA,N) if SIDE = 'R'
106*> The i-th row must contain the vector which defines the
107*> elementary reflector H(i), for i = 1,2,...,k, as returned by
108*> DTZRZF in the last k rows of its array argument A.
109*> A is modified by the routine but restored on exit.
110*> \endverbatim
111*>
112*> \param[in] LDA
113*> \verbatim
114*> LDA is INTEGER
115*> The leading dimension of the array A. LDA >= max(1,K).
116*> \endverbatim
117*>
118*> \param[in] TAU
119*> \verbatim
120*> TAU is DOUBLE PRECISION array, dimension (K)
121*> TAU(i) must contain the scalar factor of the elementary
122*> reflector H(i), as returned by DTZRZF.
123*> \endverbatim
124*>
125*> \param[in,out] C
126*> \verbatim
127*> C is DOUBLE PRECISION array, dimension (LDC,N)
128*> On entry, the m-by-n matrix C.
129*> On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.
130*> \endverbatim
131*>
132*> \param[in] LDC
133*> \verbatim
134*> LDC is INTEGER
135*> The leading dimension of the array C. LDC >= max(1,M).
136*> \endverbatim
137*>
138*> \param[out] WORK
139*> \verbatim
140*> WORK is DOUBLE PRECISION array, dimension
141*> (N) if SIDE = 'L',
142*> (M) if SIDE = 'R'
143*> \endverbatim
144*>
145*> \param[out] INFO
146*> \verbatim
147*> INFO is INTEGER
148*> = 0: successful exit
149*> < 0: if INFO = -i, the i-th argument had an illegal value
150*> \endverbatim
151*
152* Authors:
153* ========
154*
155*> \author Univ. of Tennessee
156*> \author Univ. of California Berkeley
157*> \author Univ. of Colorado Denver
158*> \author NAG Ltd.
159*
160*> \ingroup unmr3
161*
162*> \par Contributors:
163* ==================
164*>
165*> A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
166*
167*> \par Further Details:
168* =====================
169*>
170*> \verbatim
171*> \endverbatim
172*>
173* =====================================================================
174 SUBROUTINE dormr3( SIDE, TRANS, M, N, K, L, A, LDA, TAU, C,
175 $ LDC,
176 $ WORK, INFO )
177*
178* -- LAPACK computational routine --
179* -- LAPACK is a software package provided by Univ. of Tennessee, --
180* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
181*
182* .. Scalar Arguments ..
183 CHARACTER SIDE, TRANS
184 INTEGER INFO, K, L, LDA, LDC, M, N
185* ..
186* .. Array Arguments ..
187 DOUBLE PRECISION A( LDA, * ), C( LDC, * ), TAU( * ), WORK( * )
188* ..
189*
190* =====================================================================
191*
192* .. Local Scalars ..
193 LOGICAL LEFT, NOTRAN
194 INTEGER I, I1, I2, I3, IC, JA, JC, MI, NI, NQ
195* ..
196* .. External Functions ..
197 LOGICAL LSAME
198 EXTERNAL LSAME
199* ..
200* .. External Subroutines ..
201 EXTERNAL dlarz, xerbla
202* ..
203* .. Intrinsic Functions ..
204 INTRINSIC max
205* ..
206* .. Executable Statements ..
207*
208* Test the input arguments
209*
210 info = 0
211 left = lsame( side, 'L' )
212 notran = lsame( trans, 'N' )
213*
214* NQ is the order of Q
215*
216 IF( left ) THEN
217 nq = m
218 ELSE
219 nq = n
220 END IF
221 IF( .NOT.left .AND. .NOT.lsame( side, 'R' ) ) THEN
222 info = -1
223 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans, 'T' ) ) THEN
224 info = -2
225 ELSE IF( m.LT.0 ) THEN
226 info = -3
227 ELSE IF( n.LT.0 ) THEN
228 info = -4
229 ELSE IF( k.LT.0 .OR. k.GT.nq ) THEN
230 info = -5
231 ELSE IF( l.LT.0 .OR. ( left .AND. ( l.GT.m ) ) .OR.
232 $ ( .NOT.left .AND. ( l.GT.n ) ) ) THEN
233 info = -6
234 ELSE IF( lda.LT.max( 1, k ) ) THEN
235 info = -8
236 ELSE IF( ldc.LT.max( 1, m ) ) THEN
237 info = -11
238 END IF
239 IF( info.NE.0 ) THEN
240 CALL xerbla( 'DORMR3', -info )
241 RETURN
242 END IF
243*
244* Quick return if possible
245*
246 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
247 $ RETURN
248*
249 IF( ( left .AND. .NOT.notran .OR. .NOT.left .AND. notran ) ) THEN
250 i1 = 1
251 i2 = k
252 i3 = 1
253 ELSE
254 i1 = k
255 i2 = 1
256 i3 = -1
257 END IF
258*
259 IF( left ) THEN
260 ni = n
261 ja = m - l + 1
262 jc = 1
263 ELSE
264 mi = m
265 ja = n - l + 1
266 ic = 1
267 END IF
268*
269 DO 10 i = i1, i2, i3
270 IF( left ) THEN
271*
272* H(i) or H(i)**T is applied to C(i:m,1:n)
273*
274 mi = m - i + 1
275 ic = i
276 ELSE
277*
278* H(i) or H(i)**T is applied to C(1:m,i:n)
279*
280 ni = n - i + 1
281 jc = i
282 END IF
283*
284* Apply H(i) or H(i)**T
285*
286 CALL dlarz( side, mi, ni, l, a( i, ja ), lda, tau( i ),
287 $ c( ic, jc ), ldc, work )
288*
289 10 CONTINUE
290*
291 RETURN
292*
293* End of DORMR3
294*
295 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine dlarz(side, m, n, l, v, incv, tau, c, ldc, work)
DLARZ applies an elementary reflector (as returned by stzrzf) to a general matrix.
Definition dlarz.f:143
subroutine dormr3(side, trans, m, n, k, l, a, lda, tau, c, ldc, work, info)
DORMR3 multiplies a general matrix by the orthogonal matrix from a RZ factorization determined by stz...
Definition dormr3.f:177