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

◆ zgemqr()

subroutine zgemqr ( character side,
character trans,
integer m,
integer n,
integer k,
complex*16, dimension( lda, * ) a,
integer lda,
complex*16, dimension( * ) t,
integer tsize,
complex*16, dimension( ldc, * ) c,
integer ldc,
complex*16, dimension( * ) work,
integer lwork,
integer info )

ZGEMQR

Purpose:
!>
!> ZGEMQR overwrites the general real M-by-N matrix C with
!>
!>                      SIDE = 'L'     SIDE = 'R'
!>      TRANS = 'N':      Q * C          C * Q
!>      TRANS = 'T':      Q**H * C       C * Q**H
!>
!> where Q is a complex unitary matrix defined as the product
!> of blocked elementary reflectors computed by tall skinny
!> QR factorization (ZGEQR)
!>
!> 
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':  No transpose, apply Q;
!>          = 'C':  Conjugate transpose, apply Q**H.
!> 
[in]M
!>          M is INTEGER
!>          The number of rows of the matrix A.  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]A
!>          A is COMPLEX*16 array, dimension (LDA,K)
!>          Part of the data structure to represent Q as returned by ZGEQR.
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.
!>          If SIDE = 'L', LDA >= max(1,M);
!>          if SIDE = 'R', LDA >= max(1,N).
!> 
[in]T
!>          T is COMPLEX*16 array, dimension (MAX(5,TSIZE)).
!>          Part of the data structure to represent Q as returned by ZGEQR.
!> 
[in]TSIZE
!>          TSIZE is INTEGER
!>          The dimension of the array T. TSIZE >= 5.
!> 
[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
!>          (workspace) COMPLEX*16 array, dimension (MAX(1,LWORK))
!>          On exit, if INFO = 0, WORK(1) returns the minimal LWORK.
!> 
[in]LWORK
!>          LWORK is INTEGER
!>          The dimension of the array WORK. LWORK >= 1.
!>          If LWORK = -1, then a workspace query is assumed. The routine
!>          only calculates the size of the WORK array, returns this
!>          value as WORK(1), and no error message related to WORK
!>          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.
Further Details
!>
!> These details are particular for this LAPACK implementation. Users should not
!> take them for granted. These details may change in the future, and are not likely
!> true for another LAPACK implementation. These details are relevant if one wants
!> to try to understand the code. They are not part of the interface.
!>
!> In this version,
!>
!>          T(2): row block size (MB)
!>          T(3): column block size (NB)
!>          T(6:TSIZE): data structure needed for Q, computed by
!>                           ZLATSQR or ZGEQRT
!>
!>  Depending on the matrix dimensions M and N, and row and column
!>  block sizes MB and NB returned by ILAENV, ZGEQR will use either
!>  ZLATSQR (if the matrix is tall-and-skinny) or ZGEQRT to compute
!>  the QR factorization.
!>  This version of ZGEMQR will use either ZLAMTSQR or ZGEMQRT to
!>  multiply matrix Q by another matrix.
!>  Further Details in ZLAMTSQR or ZGEMQRT.
!>
!> 

Definition at line 173 of file zgemqr.f.

175*
176* -- LAPACK computational routine --
177* -- LAPACK is a software package provided by Univ. of Tennessee, --
178* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
179*
180* .. Scalar Arguments ..
181 CHARACTER SIDE, TRANS
182 INTEGER INFO, LDA, M, N, K, TSIZE, LWORK, LDC
183* ..
184* .. Array Arguments ..
185 COMPLEX*16 A( LDA, * ), T( * ), C( LDC, * ), WORK( * )
186* ..
187*
188* =====================================================================
189*
190* ..
191* .. Local Scalars ..
192 LOGICAL LEFT, RIGHT, TRAN, NOTRAN, LQUERY
193 INTEGER MB, NB, LW, NBLCKS, MN, MINMNK, LWMIN
194* ..
195* .. External Functions ..
196 LOGICAL LSAME
197 EXTERNAL lsame
198* ..
199* .. External Subroutines ..
200 EXTERNAL zgemqrt, zlamtsqr, xerbla
201* ..
202* .. Intrinsic Functions ..
203 INTRINSIC int, max, min, mod
204* ..
205* .. Executable Statements ..
206*
207* Test the input arguments
208*
209 lquery = ( lwork.EQ.-1 )
210 notran = lsame( trans, 'N' )
211 tran = lsame( trans, 'C' )
212 left = lsame( side, 'L' )
213 right = lsame( side, 'R' )
214*
215 mb = int( t( 2 ) )
216 nb = int( t( 3 ) )
217 IF( left ) THEN
218 lw = n * nb
219 mn = m
220 ELSE
221 lw = mb * nb
222 mn = n
223 END IF
224*
225 minmnk = min( m, n, k )
226 IF( minmnk.EQ.0 ) THEN
227 lwmin = 1
228 ELSE
229 lwmin = max( 1, lw )
230 END IF
231*
232 IF( ( mb.GT.k ) .AND. ( mn.GT.k ) ) THEN
233 IF( mod( mn - k, mb - k ).EQ.0 ) THEN
234 nblcks = ( mn - k ) / ( mb - k )
235 ELSE
236 nblcks = ( mn - k ) / ( mb - k ) + 1
237 END IF
238 ELSE
239 nblcks = 1
240 END IF
241*
242 info = 0
243 IF( .NOT.left .AND. .NOT.right ) THEN
244 info = -1
245 ELSE IF( .NOT.tran .AND. .NOT.notran ) THEN
246 info = -2
247 ELSE IF( m.LT.0 ) THEN
248 info = -3
249 ELSE IF( n.LT.0 ) THEN
250 info = -4
251 ELSE IF( k.LT.0 .OR. k.GT.mn ) THEN
252 info = -5
253 ELSE IF( lda.LT.max( 1, mn ) ) THEN
254 info = -7
255 ELSE IF( tsize.LT.5 ) THEN
256 info = -9
257 ELSE IF( ldc.LT.max( 1, m ) ) THEN
258 info = -11
259 ELSE IF( lwork.LT.lwmin .AND. .NOT.lquery ) THEN
260 info = -13
261 END IF
262*
263 IF( info.EQ.0 ) THEN
264 work( 1 ) = lwmin
265 END IF
266*
267 IF( info.NE.0 ) THEN
268 CALL xerbla( 'ZGEMQR', -info )
269 RETURN
270 ELSE IF( lquery ) THEN
271 RETURN
272 END IF
273*
274* Quick return if possible
275*
276 IF( minmnk.EQ.0 ) THEN
277 RETURN
278 END IF
279*
280 IF( ( left .AND. m.LE.k ) .OR. ( right .AND. n.LE.k )
281 $ .OR. ( mb.LE.k ) .OR. ( mb.GE.max( m, n, k ) ) ) THEN
282 CALL zgemqrt( side, trans, m, n, k, nb, a, lda, t( 6 ),
283 $ nb, c, ldc, work, info )
284 ELSE
285 CALL zlamtsqr( side, trans, m, n, k, mb, nb, a, lda, t( 6 ),
286 $ nb, c, ldc, work, lwork, info )
287 END IF
288*
289 work( 1 ) = lwmin
290*
291 RETURN
292*
293* End of ZGEMQR
294*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zgemqrt(side, trans, m, n, k, nb, v, ldv, t, ldt, c, ldc, work, info)
ZGEMQRT
Definition zgemqrt.f:166
subroutine zlamtsqr(side, trans, m, n, k, mb, nb, a, lda, t, ldt, c, ldc, work, lwork, info)
ZLAMTSQR
Definition zlamtsqr.f:201
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: