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

◆ zunmhr()

subroutine zunmhr ( character side,
character trans,
integer m,
integer n,
integer ilo,
integer ihi,
complex*16, dimension( lda, * ) a,
integer lda,
complex*16, dimension( * ) tau,
complex*16, dimension( ldc, * ) c,
integer ldc,
complex*16, dimension( * ) work,
integer lwork,
integer info )

ZUNMHR

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

Purpose:
!>
!> ZUNMHR 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
!> IHI-ILO elementary reflectors, as returned by ZGEHRD:
!>
!> Q = H(ilo) H(ilo+1) . . . H(ihi-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]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]ILO
!>          ILO is INTEGER
!> 
[in]IHI
!>          IHI is INTEGER
!>
!>          ILO and IHI must have the same values as in the previous call
!>          of ZGEHRD. Q is equal to the unit matrix except in the
!>          submatrix Q(ilo+1:ihi,ilo+1:ihi).
!>          If SIDE = 'L', then 1 <= ILO <= IHI <= M, if M > 0, and
!>          ILO = 1 and IHI = 0, if M = 0;
!>          if SIDE = 'R', then 1 <= ILO <= IHI <= N, if N > 0, and
!>          ILO = 1 and IHI = 0, if N = 0.
!> 
[in]A
!>          A is COMPLEX*16 array, dimension
!>                               (LDA,M) if SIDE = 'L'
!>                               (LDA,N) if SIDE = 'R'
!>          The vectors which define the elementary reflectors, as
!>          returned by ZGEHRD.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.
!>          LDA >= max(1,M) if SIDE = 'L'; LDA >= max(1,N) if SIDE = 'R'.
!> 
[in]TAU
!>          TAU is COMPLEX*16 array, dimension
!>                               (M-1) if SIDE = 'L'
!>                               (N-1) if SIDE = 'R'
!>          TAU(i) must contain the scalar factor of the elementary
!>          reflector H(i), as returned by ZGEHRD.
!> 
[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 (MAX(1,LWORK))
!>          On exit, if INFO = 0, WORK(1) returns the optimal LWORK.
!> 
[in]LWORK
!>          LWORK is INTEGER
!>          The dimension of the array WORK.
!>          If SIDE = 'L', LWORK >= max(1,N);
!>          if SIDE = 'R', LWORK >= max(1,M).
!>          For optimum performance LWORK >= N*NB if SIDE = 'L', and
!>          LWORK >= M*NB if SIDE = 'R', where NB is the optimal
!>          blocksize.
!>
!>          If LWORK = -1, then a workspace query is assumed; the routine
!>          only calculates the optimal size of the WORK array, returns
!>          this value as the first entry of the WORK array, and no error
!>          message related to LWORK is issued by XERBLA.
!> 
[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 174 of file zunmhr.f.

176*
177* -- LAPACK computational routine --
178* -- LAPACK is a software package provided by Univ. of Tennessee, --
179* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
180*
181* .. Scalar Arguments ..
182 CHARACTER SIDE, TRANS
183 INTEGER IHI, ILO, INFO, LDA, LDC, LWORK, M, N
184* ..
185* .. Array Arguments ..
186 COMPLEX*16 A( LDA, * ), C( LDC, * ), TAU( * ), WORK( * )
187* ..
188*
189* =====================================================================
190*
191* .. Local Scalars ..
192 LOGICAL LEFT, LQUERY
193 INTEGER I1, I2, IINFO, LWKOPT, MI, NB, NH, NI, NQ, NW
194* ..
195* .. External Functions ..
196 LOGICAL LSAME
197 INTEGER ILAENV
198 EXTERNAL lsame, ilaenv
199* ..
200* .. External Subroutines ..
201 EXTERNAL xerbla, zunmqr
202* ..
203* .. Intrinsic Functions ..
204 INTRINSIC max, min
205* ..
206* .. Executable Statements ..
207*
208* Test the input arguments
209*
210 info = 0
211 nh = ihi - ilo
212 left = lsame( side, 'L' )
213 lquery = ( lwork.EQ.-1 )
214*
215* NQ is the order of Q and NW is the minimum dimension of WORK
216*
217 IF( left ) THEN
218 nq = m
219 nw = max( 1, n )
220 ELSE
221 nq = n
222 nw = max( 1, m )
223 END IF
224 IF( .NOT.left .AND. .NOT.lsame( side, 'R' ) ) THEN
225 info = -1
226 ELSE IF( .NOT.lsame( trans, 'N' ) .AND.
227 $ .NOT.lsame( trans, 'C' ) )
228 $ THEN
229 info = -2
230 ELSE IF( m.LT.0 ) THEN
231 info = -3
232 ELSE IF( n.LT.0 ) THEN
233 info = -4
234 ELSE IF( ilo.LT.1 .OR. ilo.GT.max( 1, nq ) ) THEN
235 info = -5
236 ELSE IF( ihi.LT.min( ilo, nq ) .OR. ihi.GT.nq ) THEN
237 info = -6
238 ELSE IF( lda.LT.max( 1, nq ) ) THEN
239 info = -8
240 ELSE IF( ldc.LT.max( 1, m ) ) THEN
241 info = -11
242 ELSE IF( lwork.LT.nw .AND. .NOT.lquery ) THEN
243 info = -13
244 END IF
245*
246 IF( info.EQ.0 ) THEN
247 IF( left ) THEN
248 nb = ilaenv( 1, 'ZUNMQR', side // trans, nh, n, nh, -1 )
249 ELSE
250 nb = ilaenv( 1, 'ZUNMQR', side // trans, m, nh, nh, -1 )
251 END IF
252 lwkopt = nw*nb
253 work( 1 ) = lwkopt
254 END IF
255*
256 IF( info.NE.0 ) THEN
257 CALL xerbla( 'ZUNMHR', -info )
258 RETURN
259 ELSE IF( lquery ) THEN
260 RETURN
261 END IF
262*
263* Quick return if possible
264*
265 IF( m.EQ.0 .OR. n.EQ.0 .OR. nh.EQ.0 ) THEN
266 work( 1 ) = 1
267 RETURN
268 END IF
269*
270 IF( left ) THEN
271 mi = nh
272 ni = n
273 i1 = ilo + 1
274 i2 = 1
275 ELSE
276 mi = m
277 ni = nh
278 i1 = 1
279 i2 = ilo + 1
280 END IF
281*
282 CALL zunmqr( side, trans, mi, ni, nh, a( ilo+1, ilo ), lda,
283 $ tau( ilo ), c( i1, i2 ), ldc, work, lwork, iinfo )
284*
285 work( 1 ) = lwkopt
286 RETURN
287*
288* End of ZUNMHR
289*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
integer function ilaenv(ispec, name, opts, n1, n2, n3, n4)
ILAENV
Definition ilaenv.f:160
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine zunmqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
ZUNMQR
Definition zunmqr.f:165
Here is the call graph for this function:
Here is the caller graph for this function: