LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
zunmr3.f
Go to the documentation of this file.
1*> \brief \b ZUNMR3 multiplies a general matrix by the unitary matrix from a RZ factorization determined by ctzrzf (unblocked algorithm).
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZUNMR3 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/zunmr3.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/zunmr3.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/zunmr3.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZUNMR3( 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* COMPLEX*16 A( LDA, * ), C( LDC, * ), TAU( * ), WORK( * )
28* ..
29*
30*
31*> \par Purpose:
32* =============
33*>
34*> \verbatim
35*>
36*> ZUNMR3 overwrites the general complex m by n matrix C with
37*>
38*> Q * C if SIDE = 'L' and TRANS = 'N', or
39*>
40*> Q**H* C if SIDE = 'L' and TRANS = 'C', or
41*>
42*> C * Q if SIDE = 'R' and TRANS = 'N', or
43*>
44*> C * Q**H if SIDE = 'R' and TRANS = 'C',
45*>
46*> where Q is a complex unitary matrix defined as the product of k
47*> elementary reflectors
48*>
49*> Q = H(1) H(2) . . . H(k)
50*>
51*> as returned by ZTZRZF. 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**H from the Left
62*> = 'R': apply Q or Q**H from the Right
63*> \endverbatim
64*>
65*> \param[in] TRANS
66*> \verbatim
67*> TRANS is CHARACTER*1
68*> = 'N': apply Q (No transpose)
69*> = 'C': apply Q**H (Conjugate 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 COMPLEX*16 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*> ZTZRZF 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 COMPLEX*16 array, dimension (K)
121*> TAU(i) must contain the scalar factor of the elementary
122*> reflector H(i), as returned by ZTZRZF.
123*> \endverbatim
124*>
125*> \param[in,out] C
126*> \verbatim
127*> C is COMPLEX*16 array, dimension (LDC,N)
128*> On entry, the m-by-n matrix C.
129*> On exit, C is overwritten by Q*C or Q**H*C or C*Q**H 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 COMPLEX*16 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 zunmr3( 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 COMPLEX*16 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 COMPLEX*16 TAUI
196* ..
197* .. External Functions ..
198 LOGICAL LSAME
199 EXTERNAL LSAME
200* ..
201* .. External Subroutines ..
202 EXTERNAL xerbla, zlarz
203* ..
204* .. Intrinsic Functions ..
205 INTRINSIC dconjg, max
206* ..
207* .. Executable Statements ..
208*
209* Test the input arguments
210*
211 info = 0
212 left = lsame( side, 'L' )
213 notran = lsame( trans, 'N' )
214*
215* NQ is the order of Q
216*
217 IF( left ) THEN
218 nq = m
219 ELSE
220 nq = n
221 END IF
222 IF( .NOT.left .AND. .NOT.lsame( side, 'R' ) ) THEN
223 info = -1
224 ELSE IF( .NOT.notran .AND. .NOT.lsame( trans, 'C' ) ) THEN
225 info = -2
226 ELSE IF( m.LT.0 ) THEN
227 info = -3
228 ELSE IF( n.LT.0 ) THEN
229 info = -4
230 ELSE IF( k.LT.0 .OR. k.GT.nq ) THEN
231 info = -5
232 ELSE IF( l.LT.0 .OR. ( left .AND. ( l.GT.m ) ) .OR.
233 $ ( .NOT.left .AND. ( l.GT.n ) ) ) THEN
234 info = -6
235 ELSE IF( lda.LT.max( 1, k ) ) THEN
236 info = -8
237 ELSE IF( ldc.LT.max( 1, m ) ) THEN
238 info = -11
239 END IF
240 IF( info.NE.0 ) THEN
241 CALL xerbla( 'ZUNMR3', -info )
242 RETURN
243 END IF
244*
245* Quick return if possible
246*
247 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
248 $ RETURN
249*
250 IF( ( left .AND. .NOT.notran .OR. .NOT.left .AND. notran ) ) THEN
251 i1 = 1
252 i2 = k
253 i3 = 1
254 ELSE
255 i1 = k
256 i2 = 1
257 i3 = -1
258 END IF
259*
260 IF( left ) THEN
261 ni = n
262 ja = m - l + 1
263 jc = 1
264 ELSE
265 mi = m
266 ja = n - l + 1
267 ic = 1
268 END IF
269*
270 DO 10 i = i1, i2, i3
271 IF( left ) THEN
272*
273* H(i) or H(i)**H is applied to C(i:m,1:n)
274*
275 mi = m - i + 1
276 ic = i
277 ELSE
278*
279* H(i) or H(i)**H is applied to C(1:m,i:n)
280*
281 ni = n - i + 1
282 jc = i
283 END IF
284*
285* Apply H(i) or H(i)**H
286*
287 IF( notran ) THEN
288 taui = tau( i )
289 ELSE
290 taui = dconjg( tau( i ) )
291 END IF
292 CALL zlarz( side, mi, ni, l, a( i, ja ), lda, taui,
293 $ c( ic, jc ), ldc, work )
294*
295 10 CONTINUE
296*
297 RETURN
298*
299* End of ZUNMR3
300*
301 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zlarz(side, m, n, l, v, incv, tau, c, ldc, work)
ZLARZ applies an elementary reflector (as returned by stzrzf) to a general matrix.
Definition zlarz.f:145
subroutine zunmr3(side, trans, m, n, k, l, a, lda, tau, c, ldc, work, info)
ZUNMR3 multiplies a general matrix by the unitary matrix from a RZ factorization determined by ctzrzf...
Definition zunmr3.f:177