LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ cunmr3()

subroutine cunmr3 ( character side,
character trans,
integer m,
integer n,
integer k,
integer l,
complex, dimension( lda, * ) a,
integer lda,
complex, dimension( * ) tau,
complex, dimension( ldc, * ) c,
integer ldc,
complex, dimension( * ) work,
integer info )

CUNMR3 multiplies a general matrix by the unitary matrix from a RZ factorization determined by ctzrzf (unblocked algorithm).

Download CUNMR3 + dependencies [TGZ] [ZIP] [TXT]

Purpose:
!>
!> CUNMR3 overwrites the general complex m by n matrix C with
!>
!>       Q * C  if SIDE = 'L' and TRANS = 'N', or
!>
!>       Q**H* C  if SIDE = 'L' and TRANS = 'C', or
!>
!>       C * Q  if SIDE = 'R' and TRANS = 'N', or
!>
!>       C * Q**H if SIDE = 'R' and TRANS = 'C',
!>
!> where Q is a complex unitary matrix defined as the product of k
!> elementary reflectors
!>
!>       Q = H(1) H(2) . . . H(k)
!>
!> as returned by CTZRZF. Q is of order m if SIDE = 'L' and of order n
!> if SIDE = 'R'.
!> 
Parameters
[in]SIDE
!>          SIDE is CHARACTER*1
!>          = 'L': apply Q or Q**H from the Left
!>          = 'R': apply Q or Q**H from the Right
!> 
[in]TRANS
!>          TRANS is CHARACTER*1
!>          = 'N': apply Q  (No transpose)
!>          = 'C': apply Q**H (Conjugate transpose)
!> 
[in]M
!>          M is INTEGER
!>          The number of rows of the matrix C. M >= 0.
!> 
[in]N
!>          N is INTEGER
!>          The number of columns of the matrix C. N >= 0.
!> 
[in]K
!>          K is INTEGER
!>          The number of elementary reflectors whose product defines
!>          the matrix Q.
!>          If SIDE = 'L', M >= K >= 0;
!>          if SIDE = 'R', N >= K >= 0.
!> 
[in]L
!>          L is INTEGER
!>          The number of columns of the matrix A containing
!>          the meaningful part of the Householder reflectors.
!>          If SIDE = 'L', M >= L >= 0, if SIDE = 'R', N >= L >= 0.
!> 
[in]A
!>          A is COMPLEX array, dimension
!>                               (LDA,M) if SIDE = 'L',
!>                               (LDA,N) if SIDE = 'R'
!>          The i-th row must contain the vector which defines the
!>          elementary reflector H(i), for i = 1,2,...,k, as returned by
!>          CTZRZF in the last k rows of its array argument A.
!>          A is modified by the routine but restored on exit.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A. LDA >= max(1,K).
!> 
[in]TAU
!>          TAU is COMPLEX array, dimension (K)
!>          TAU(i) must contain the scalar factor of the elementary
!>          reflector H(i), as returned by CTZRZF.
!> 
[in,out]C
!>          C is COMPLEX array, dimension (LDC,N)
!>          On entry, the m-by-n matrix C.
!>          On exit, C is overwritten by Q*C or Q**H*C or C*Q**H or C*Q.
!> 
[in]LDC
!>          LDC is INTEGER
!>          The leading dimension of the array C. LDC >= max(1,M).
!> 
[out]WORK
!>          WORK is COMPLEX array, dimension
!>                                   (N) if SIDE = 'L',
!>                                   (M) if SIDE = 'R'
!> 
[out]INFO
!>          INFO is INTEGER
!>          = 0: successful exit
!>          < 0: if INFO = -i, the i-th argument had an illegal value
!> 
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Contributors:
A. Petitet, Computer Science Dept., Univ. of Tenn., Knoxville, USA
Further Details:
!> 

Definition at line 174 of file cunmr3.f.

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 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 TAUI
196* ..
197* .. External Functions ..
198 LOGICAL LSAME
199 EXTERNAL lsame
200* ..
201* .. External Subroutines ..
202 EXTERNAL clarz, xerbla
203* ..
204* .. Intrinsic Functions ..
205 INTRINSIC conjg, 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( 'CUNMR3', -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 = conjg( tau( i ) )
291 END IF
292 CALL clarz( 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 CUNMR3
300*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
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:145
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function:
Here is the caller graph for this function: