LAPACK  3.10.0
LAPACK: Linear Algebra PACKage

◆ 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 176 of file cunmr3.f.

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 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:60
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:53
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
Here is the call graph for this function:
Here is the caller graph for this function: