LAPACK  3.6.1
LAPACK: Linear Algebra PACKage
subroutine zupmtr ( character  SIDE,
character  UPLO,
character  TRANS,
integer  M,
integer  N,
complex*16, dimension( * )  AP,
complex*16, dimension( * )  TAU,
complex*16, dimension( ldc, * )  C,
integer  LDC,
complex*16, dimension( * )  WORK,
integer  INFO 
)

ZUPMTR

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

Purpose:
 ZUPMTR overwrites the general complex M-by-N matrix C with

                 SIDE = 'L'     SIDE = 'R'
 TRANS = 'N':      Q * C          C * Q
 TRANS = 'C':      Q**H * C       C * Q**H

 where Q is a complex unitary matrix of order nq, with nq = m if
 SIDE = 'L' and nq = n if SIDE = 'R'. Q is defined as the product of
 nq-1 elementary reflectors, as returned by ZHPTRD using packed
 storage:

 if UPLO = 'U', Q = H(nq-1) . . . H(2) H(1);

 if UPLO = 'L', Q = H(1) H(2) . . . H(nq-1).
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]UPLO
          UPLO is CHARACTER*1
          = 'U': Upper triangular packed storage used in previous
                 call to ZHPTRD;
          = 'L': Lower triangular packed storage used in previous
                 call to ZHPTRD.
[in]TRANS
          TRANS is CHARACTER*1
          = 'N':  No transpose, apply Q;
          = 'C':  Conjugate transpose, apply Q**H.
[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]AP
          AP is COMPLEX*16 array, dimension
                               (M*(M+1)/2) if SIDE = 'L'
                               (N*(N+1)/2) if SIDE = 'R'
          The vectors which define the elementary reflectors, as
          returned by ZHPTRD.  AP is modified by the routine but
          restored on exit.
[in]TAU
          TAU is COMPLEX*16 array, dimension (M-1) if SIDE = 'L'
                                     or (N-1) if SIDE = 'R'
          TAU(i) must contain the scalar factor of the elementary
          reflector H(i), as returned by ZHPTRD.
[in,out]C
          C is COMPLEX*16 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*16 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.
Date
November 2011

Definition at line 152 of file zupmtr.f.

152 *
153 * -- LAPACK computational routine (version 3.4.0) --
154 * -- LAPACK is a software package provided by Univ. of Tennessee, --
155 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
156 * November 2011
157 *
158 * .. Scalar Arguments ..
159  CHARACTER side, trans, uplo
160  INTEGER info, ldc, m, n
161 * ..
162 * .. Array Arguments ..
163  COMPLEX*16 ap( * ), c( ldc, * ), tau( * ), work( * )
164 * ..
165 *
166 * =====================================================================
167 *
168 * .. Parameters ..
169  COMPLEX*16 one
170  parameter ( one = ( 1.0d+0, 0.0d+0 ) )
171 * ..
172 * .. Local Scalars ..
173  LOGICAL forwrd, left, notran, upper
174  INTEGER i, i1, i2, i3, ic, ii, jc, mi, ni, nq
175  COMPLEX*16 aii, taui
176 * ..
177 * .. External Functions ..
178  LOGICAL lsame
179  EXTERNAL lsame
180 * ..
181 * .. External Subroutines ..
182  EXTERNAL xerbla, zlarf
183 * ..
184 * .. Intrinsic Functions ..
185  INTRINSIC dconjg, max
186 * ..
187 * .. Executable Statements ..
188 *
189 * Test the input arguments
190 *
191  info = 0
192  left = lsame( side, 'L' )
193  notran = lsame( trans, 'N' )
194  upper = lsame( uplo, 'U' )
195 *
196 * NQ is the order of Q
197 *
198  IF( left ) THEN
199  nq = m
200  ELSE
201  nq = n
202  END IF
203  IF( .NOT.left .AND. .NOT.lsame( side, 'R' ) ) THEN
204  info = -1
205  ELSE IF( .NOT.upper .AND. .NOT.lsame( uplo, 'L' ) ) THEN
206  info = -2
207  ELSE IF( .NOT.notran .AND. .NOT.lsame( trans, 'C' ) ) THEN
208  info = -3
209  ELSE IF( m.LT.0 ) THEN
210  info = -4
211  ELSE IF( n.LT.0 ) THEN
212  info = -5
213  ELSE IF( ldc.LT.max( 1, m ) ) THEN
214  info = -9
215  END IF
216  IF( info.NE.0 ) THEN
217  CALL xerbla( 'ZUPMTR', -info )
218  RETURN
219  END IF
220 *
221 * Quick return if possible
222 *
223  IF( m.EQ.0 .OR. n.EQ.0 )
224  $ RETURN
225 *
226  IF( upper ) THEN
227 *
228 * Q was determined by a call to ZHPTRD with UPLO = 'U'
229 *
230  forwrd = ( left .AND. notran ) .OR.
231  $ ( .NOT.left .AND. .NOT.notran )
232 *
233  IF( forwrd ) THEN
234  i1 = 1
235  i2 = nq - 1
236  i3 = 1
237  ii = 2
238  ELSE
239  i1 = nq - 1
240  i2 = 1
241  i3 = -1
242  ii = nq*( nq+1 ) / 2 - 1
243  END IF
244 *
245  IF( left ) THEN
246  ni = n
247  ELSE
248  mi = m
249  END IF
250 *
251  DO 10 i = i1, i2, i3
252  IF( left ) THEN
253 *
254 * H(i) or H(i)**H is applied to C(1:i,1:n)
255 *
256  mi = i
257  ELSE
258 *
259 * H(i) or H(i)**H is applied to C(1:m,1:i)
260 *
261  ni = i
262  END IF
263 *
264 * Apply H(i) or H(i)**H
265 *
266  IF( notran ) THEN
267  taui = tau( i )
268  ELSE
269  taui = dconjg( tau( i ) )
270  END IF
271  aii = ap( ii )
272  ap( ii ) = one
273  CALL zlarf( side, mi, ni, ap( ii-i+1 ), 1, taui, c, ldc,
274  $ work )
275  ap( ii ) = aii
276 *
277  IF( forwrd ) THEN
278  ii = ii + i + 2
279  ELSE
280  ii = ii - i - 1
281  END IF
282  10 CONTINUE
283  ELSE
284 *
285 * Q was determined by a call to ZHPTRD with UPLO = 'L'.
286 *
287  forwrd = ( left .AND. .NOT.notran ) .OR.
288  $ ( .NOT.left .AND. notran )
289 *
290  IF( forwrd ) THEN
291  i1 = 1
292  i2 = nq - 1
293  i3 = 1
294  ii = 2
295  ELSE
296  i1 = nq - 1
297  i2 = 1
298  i3 = -1
299  ii = nq*( nq+1 ) / 2 - 1
300  END IF
301 *
302  IF( left ) THEN
303  ni = n
304  jc = 1
305  ELSE
306  mi = m
307  ic = 1
308  END IF
309 *
310  DO 20 i = i1, i2, i3
311  aii = ap( ii )
312  ap( ii ) = one
313  IF( left ) THEN
314 *
315 * H(i) or H(i)**H is applied to C(i+1:m,1:n)
316 *
317  mi = m - i
318  ic = i + 1
319  ELSE
320 *
321 * H(i) or H(i)**H is applied to C(1:m,i+1:n)
322 *
323  ni = n - i
324  jc = i + 1
325  END IF
326 *
327 * Apply H(i) or H(i)**H
328 *
329  IF( notran ) THEN
330  taui = tau( i )
331  ELSE
332  taui = dconjg( tau( i ) )
333  END IF
334  CALL zlarf( side, mi, ni, ap( ii ), 1, taui, c( ic, jc ),
335  $ ldc, work )
336  ap( ii ) = aii
337 *
338  IF( forwrd ) THEN
339  ii = ii + nq - i + 1
340  ELSE
341  ii = ii - nq + i - 2
342  END IF
343  20 CONTINUE
344  END IF
345  RETURN
346 *
347 * End of ZUPMTR
348 *
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
subroutine zlarf(SIDE, M, N, V, INCV, TAU, C, LDC, WORK)
ZLARF applies an elementary reflector to a general rectangular matrix.
Definition: zlarf.f:130
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55

Here is the call graph for this function:

Here is the caller graph for this function: