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