LAPACK  3.10.0
LAPACK: Linear Algebra PACKage
cunmr3.f
Go to the documentation of this file.
1 *> \brief \b CUNMR3 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 *> \htmlonly
9 *> Download CUNMR3 + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/cunmr3.f">
11 *> [TGZ]</a>
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/cunmr3.f">
13 *> [ZIP]</a>
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/cunmr3.f">
15 *> [TXT]</a>
16 *> \endhtmlonly
17 *
18 * Definition:
19 * ===========
20 *
21 * SUBROUTINE CUNMR3( 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 * COMPLEX A( LDA, * ), C( LDC, * ), TAU( * ), WORK( * )
30 * ..
31 *
32 *
33 *> \par Purpose:
34 * =============
35 *>
36 *> \verbatim
37 *>
38 *> CUNMR3 overwrites the general complex m by n matrix C with
39 *>
40 *> Q * C if SIDE = 'L' and TRANS = 'N', or
41 *>
42 *> Q**H* C if SIDE = 'L' and TRANS = 'C', or
43 *>
44 *> C * Q if SIDE = 'R' and TRANS = 'N', or
45 *>
46 *> C * Q**H if SIDE = 'R' and TRANS = 'C',
47 *>
48 *> where Q is a complex unitary matrix defined as the product of k
49 *> elementary reflectors
50 *>
51 *> Q = H(1) H(2) . . . H(k)
52 *>
53 *> as returned by CTZRZF. 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**H from the Left
64 *> = 'R': apply Q or Q**H from the Right
65 *> \endverbatim
66 *>
67 *> \param[in] TRANS
68 *> \verbatim
69 *> TRANS is CHARACTER*1
70 *> = 'N': apply Q (No transpose)
71 *> = 'C': apply Q**H (Conjugate 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 COMPLEX 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 *> CTZRZF 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 COMPLEX array, dimension (K)
123 *> TAU(i) must contain the scalar factor of the elementary
124 *> reflector H(i), as returned by CTZRZF.
125 *> \endverbatim
126 *>
127 *> \param[in,out] C
128 *> \verbatim
129 *> C is COMPLEX array, dimension (LDC,N)
130 *> On entry, the m-by-n matrix C.
131 *> On exit, C is overwritten by Q*C or Q**H*C or C*Q**H 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 COMPLEX 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 *> \ingroup complexOTHERcomputational
163 *
164 *> \par Contributors:
165 * ==================
166 *>
167 *> A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
168 *
169 *> \par Further Details:
170 * =====================
171 *>
172 *> \verbatim
173 *> \endverbatim
174 *>
175 * =====================================================================
176  SUBROUTINE cunmr3( SIDE, TRANS, M, N, K, L, A, LDA, TAU, C, LDC,
177  $ WORK, INFO )
178 *
179 * -- LAPACK computational routine --
180 * -- LAPACK is a software package provided by Univ. of Tennessee, --
181 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
182 *
183 * .. Scalar Arguments ..
184  CHARACTER SIDE, TRANS
185  INTEGER INFO, K, L, LDA, LDC, M, N
186 * ..
187 * .. Array Arguments ..
188  COMPLEX A( LDA, * ), C( LDC, * ), TAU( * ), WORK( * )
189 * ..
190 *
191 * =====================================================================
192 *
193 * .. Local Scalars ..
194  LOGICAL LEFT, NOTRAN
195  INTEGER I, I1, I2, I3, IC, JA, JC, MI, NI, NQ
196  COMPLEX TAUI
197 * ..
198 * .. External Functions ..
199  LOGICAL LSAME
200  EXTERNAL lsame
201 * ..
202 * .. External Subroutines ..
203  EXTERNAL clarz, xerbla
204 * ..
205 * .. Intrinsic Functions ..
206  INTRINSIC conjg, max
207 * ..
208 * .. Executable Statements ..
209 *
210 * Test the input arguments
211 *
212  info = 0
213  left = lsame( side, 'L' )
214  notran = lsame( trans, 'N' )
215 *
216 * NQ is the order of Q
217 *
218  IF( left ) THEN
219  nq = m
220  ELSE
221  nq = n
222  END IF
223  IF( .NOT.left .AND. .NOT.lsame( side, 'R' ) ) THEN
224  info = -1
225  ELSE IF( .NOT.notran .AND. .NOT.lsame( trans, 'C' ) ) THEN
226  info = -2
227  ELSE IF( m.LT.0 ) THEN
228  info = -3
229  ELSE IF( n.LT.0 ) THEN
230  info = -4
231  ELSE IF( k.LT.0 .OR. k.GT.nq ) THEN
232  info = -5
233  ELSE IF( l.LT.0 .OR. ( left .AND. ( l.GT.m ) ) .OR.
234  $ ( .NOT.left .AND. ( l.GT.n ) ) ) THEN
235  info = -6
236  ELSE IF( lda.LT.max( 1, k ) ) THEN
237  info = -8
238  ELSE IF( ldc.LT.max( 1, m ) ) THEN
239  info = -11
240  END IF
241  IF( info.NE.0 ) THEN
242  CALL xerbla( 'CUNMR3', -info )
243  RETURN
244  END IF
245 *
246 * Quick return if possible
247 *
248  IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
249  $ RETURN
250 *
251  IF( ( left .AND. .NOT.notran .OR. .NOT.left .AND. notran ) ) THEN
252  i1 = 1
253  i2 = k
254  i3 = 1
255  ELSE
256  i1 = k
257  i2 = 1
258  i3 = -1
259  END IF
260 *
261  IF( left ) THEN
262  ni = n
263  ja = m - l + 1
264  jc = 1
265  ELSE
266  mi = m
267  ja = n - l + 1
268  ic = 1
269  END IF
270 *
271  DO 10 i = i1, i2, i3
272  IF( left ) THEN
273 *
274 * H(i) or H(i)**H is applied to C(i:m,1:n)
275 *
276  mi = m - i + 1
277  ic = i
278  ELSE
279 *
280 * H(i) or H(i)**H is applied to C(1:m,i:n)
281 *
282  ni = n - i + 1
283  jc = i
284  END IF
285 *
286 * Apply H(i) or H(i)**H
287 *
288  IF( notran ) THEN
289  taui = tau( i )
290  ELSE
291  taui = conjg( tau( i ) )
292  END IF
293  CALL clarz( side, mi, ni, l, a( i, ja ), lda, taui,
294  $ c( ic, jc ), ldc, work )
295 *
296  10 CONTINUE
297 *
298  RETURN
299 *
300 * End of CUNMR3
301 *
302  END
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
subroutine clarz(SIDE, M, N, L, V, INCV, TAU, C, LDC, WORK)
CLARZ applies an elementary reflector (as returned by stzrzf) to a general matrix.
Definition: clarz.f:147
subroutine cunmr3(SIDE, TRANS, M, N, K, L, A, LDA, TAU, C, LDC, WORK, INFO)
CUNMR3 multiplies a general matrix by the unitary matrix from a RZ factorization determined by ctzrzf...
Definition: cunmr3.f:178