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

◆ zupmtr()

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.

Definition at line 146 of file zupmtr.f.

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