LAPACK  3.9.0
LAPACK: Linear Algebra PACKage

◆ dlamswlq()

subroutine dlamswlq ( character  SIDE,
character  TRANS,
integer  M,
integer  N,
integer  K,
integer  MB,
integer  NB,
double precision, dimension( lda, * )  A,
integer  LDA,
double precision, dimension( ldt, * )  T,
integer  LDT,
double precision, dimension(ldc, * )  C,
integer  LDC,
double precision, dimension( * )  WORK,
integer  LWORK,
integer  INFO 
)

DLAMSWLQ

Purpose:
    DLAMQRTS overwrites the general real M-by-N matrix C with


                    SIDE = 'L'     SIDE = 'R'
    TRANS = 'N':      Q * C          C * Q
    TRANS = 'T':      Q**T * C       C * Q**T
    where Q is a real orthogonal matrix defined as the product of blocked
    elementary reflectors computed by short wide LQ
    factorization (DLASWLQ)
Parameters
[in]SIDE
          SIDE is CHARACTER*1
          = 'L': apply Q or Q**T from the Left;
          = 'R': apply Q or Q**T from the Right.
[in]TRANS
          TRANS is CHARACTER*1
          = 'N':  No transpose, apply Q;
          = 'T':  Transpose, apply Q**T.
[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 >= M.
[in]K
          K is INTEGER
          The number of elementary reflectors whose product defines
          the matrix Q.
          M >= K >= 0;
[in]MB
          MB is INTEGER
          The row block size to be used in the blocked QR.
          M >= MB >= 1
[in]NB
          NB is INTEGER
          The column block size to be used in the blocked QR.
          NB > M.
[in]NB
          NB is INTEGER
          The block size to be used in the blocked QR.
                MB > M.
[in]A
          A is DOUBLE PRECISION array, dimension
                               (LDA,M) if SIDE = 'L',
                               (LDA,N) if SIDE = 'R'
          The i-th row must contain the vector which defines the blocked
          elementary reflector H(i), for i = 1,2,...,k, as returned by
          DLASWLQ in the first k rows of its array argument A.
[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 DOUBLE PRECISION array, dimension
          ( M * Number of blocks(CEIL(N-K/NB-K)),
          The blocked upper triangular block reflectors stored in compact form
          as a sequence of upper triangular blocks.  See below
          for further details.
[in]LDT
          LDT is INTEGER
          The leading dimension of the array T.  LDT >= MB.
[in,out]C
          C is DOUBLE PRECISION array, dimension (LDC,N)
          On entry, the M-by-N matrix C.
          On exit, C is overwritten by Q*C or Q**T*C or C*Q**T or C*Q.
[in]LDC
          LDC is INTEGER
          The leading dimension of the array C. LDC >= max(1,M).
[out]WORK
         (workspace) DOUBLE PRECISION array, dimension (MAX(1,LWORK))
[in]LWORK
          LWORK is INTEGER
          The dimension of the array WORK.
          If SIDE = 'L', LWORK >= max(1,NB) * MB;
          if SIDE = 'R', LWORK >= max(1,M) * MB.
          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.
Further Details:
 Short-Wide LQ (SWLQ) performs LQ by a sequence of orthogonal transformations,
 representing Q as a product of other orthogonal matrices
   Q = Q(1) * Q(2) * . . . * Q(k)
 where each Q(i) zeros out upper diagonal entries of a block of NB rows of A:
   Q(1) zeros out the upper diagonal entries of rows 1:NB of A
   Q(2) zeros out the bottom MB-N rows of rows [1:M,NB+1:2*NB-M] of A
   Q(3) zeros out the bottom MB-N rows of rows [1:M,2*NB-M+1:3*NB-2*M] of A
   . . .

 Q(1) is computed by GELQT, which represents Q(1) by Householder vectors
 stored under the diagonal of rows 1:MB of A, and by upper triangular
 block reflectors, stored in array T(1:LDT,1:N).
 For more information see Further Details in GELQT.

 Q(i) for i>1 is computed by TPLQT, which represents Q(i) by Householder vectors
 stored in columns [(i-1)*(NB-M)+M+1:i*(NB-M)+M] of A, and by upper triangular
 block reflectors, stored in array T(1:LDT,(i-1)*M+1:i*M).
 The last Q(k) may use fewer rows.
 For more information see Further Details in TPQRT.

 For more details of the overall algorithm, see the description of
 Sequential TSQR in Section 2.2 of [1].

 [1] “Communication-Optimal Parallel and Sequential QR and LU Factorizations,”
     J. Demmel, L. Grigori, M. Hoemmen, J. Langou,
     SIAM J. Sci. Comput, vol. 34, no. 1, 2012

Definition at line 205 of file dlamswlq.f.

205 *
206 * -- LAPACK computational routine (version 3.7.1) --
207 * -- LAPACK is a software package provided by Univ. of Tennessee, --
208 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
209 * June 2017
210 *
211 * .. Scalar Arguments ..
212  CHARACTER SIDE, TRANS
213  INTEGER INFO, LDA, M, N, K, MB, NB, LDT, LWORK, LDC
214 * ..
215 * .. Array Arguments ..
216  DOUBLE PRECISION A( LDA, * ), WORK( * ), C(LDC, * ),
217  $ T( LDT, * )
218 * ..
219 *
220 * =====================================================================
221 *
222 * ..
223 * .. Local Scalars ..
224  LOGICAL LEFT, RIGHT, TRAN, NOTRAN, LQUERY
225  INTEGER I, II, KK, CTR, LW
226 * ..
227 * .. External Functions ..
228  LOGICAL LSAME
229  EXTERNAL lsame
230 * .. External Subroutines ..
231  EXTERNAL dtpmlqt, dgemlqt, xerbla
232 * ..
233 * .. Executable Statements ..
234 *
235 * Test the input arguments
236 *
237  lquery = lwork.LT.0
238  notran = lsame( trans, 'N' )
239  tran = lsame( trans, 'T' )
240  left = lsame( side, 'L' )
241  right = lsame( side, 'R' )
242  IF (left) THEN
243  lw = n * mb
244  ELSE
245  lw = m * mb
246  END IF
247 *
248  info = 0
249  IF( .NOT.left .AND. .NOT.right ) THEN
250  info = -1
251  ELSE IF( .NOT.tran .AND. .NOT.notran ) THEN
252  info = -2
253  ELSE IF( m.LT.0 ) THEN
254  info = -3
255  ELSE IF( n.LT.0 ) THEN
256  info = -4
257  ELSE IF( k.LT.0 ) THEN
258  info = -5
259  ELSE IF( lda.LT.max( 1, k ) ) THEN
260  info = -9
261  ELSE IF( ldt.LT.max( 1, mb) ) THEN
262  info = -11
263  ELSE IF( ldc.LT.max( 1, m ) ) THEN
264  info = -13
265  ELSE IF(( lwork.LT.max(1,lw)).AND.(.NOT.lquery)) THEN
266  info = -15
267  END IF
268 *
269  IF( info.NE.0 ) THEN
270  CALL xerbla( 'DLAMSWLQ', -info )
271  work(1) = lw
272  RETURN
273  ELSE IF (lquery) THEN
274  work(1) = lw
275  RETURN
276  END IF
277 *
278 * Quick return if possible
279 *
280  IF( min(m,n,k).EQ.0 ) THEN
281  RETURN
282  END IF
283 *
284  IF((nb.LE.k).OR.(nb.GE.max(m,n,k))) THEN
285  CALL dgemlqt( side, trans, m, n, k, mb, a, lda,
286  $ t, ldt, c, ldc, work, info)
287  RETURN
288  END IF
289 *
290  IF(left.AND.tran) THEN
291 *
292 * Multiply Q to the last block of C
293 *
294  kk = mod((m-k),(nb-k))
295  ctr = (m-k)/(nb-k)
296  IF (kk.GT.0) THEN
297  ii=m-kk+1
298  CALL dtpmlqt('L','T',kk , n, k, 0, mb, a(1,ii), lda,
299  $ t(1,ctr*k+1), ldt, c(1,1), ldc,
300  $ c(ii,1), ldc, work, info )
301  ELSE
302  ii=m+1
303  END IF
304 *
305  DO i=ii-(nb-k),nb+1,-(nb-k)
306 *
307 * Multiply Q to the current block of C (1:M,I:I+NB)
308 *
309  ctr = ctr - 1
310  CALL dtpmlqt('L','T',nb-k , n, k, 0,mb, a(1,i), lda,
311  $ t(1, ctr*k+1),ldt, c(1,1), ldc,
312  $ c(i,1), ldc, work, info )
313 
314  END DO
315 *
316 * Multiply Q to the first block of C (1:M,1:NB)
317 *
318  CALL dgemlqt('L','T',nb , n, k, mb, a(1,1), lda, t
319  $ ,ldt ,c(1,1), ldc, work, info )
320 *
321  ELSE IF (left.AND.notran) THEN
322 *
323 * Multiply Q to the first block of C
324 *
325  kk = mod((m-k),(nb-k))
326  ii=m-kk+1
327  ctr = 1
328  CALL dgemlqt('L','N',nb , n, k, mb, a(1,1), lda, t
329  $ ,ldt ,c(1,1), ldc, work, info )
330 *
331  DO i=nb+1,ii-nb+k,(nb-k)
332 *
333 * Multiply Q to the current block of C (I:I+NB,1:N)
334 *
335  CALL dtpmlqt('L','N',nb-k , n, k, 0,mb, a(1,i), lda,
336  $ t(1,ctr*k+1), ldt, c(1,1), ldc,
337  $ c(i,1), ldc, work, info )
338  ctr = ctr + 1
339 *
340  END DO
341  IF(ii.LE.m) THEN
342 *
343 * Multiply Q to the last block of C
344 *
345  CALL dtpmlqt('L','N',kk , n, k, 0, mb, a(1,ii), lda,
346  $ t(1,ctr*k+1), ldt, c(1,1), ldc,
347  $ c(ii,1), ldc, work, info )
348 *
349  END IF
350 *
351  ELSE IF(right.AND.notran) THEN
352 *
353 * Multiply Q to the last block of C
354 *
355  kk = mod((n-k),(nb-k))
356  ctr = (n-k)/(nb-k)
357  IF (kk.GT.0) THEN
358  ii=n-kk+1
359  CALL dtpmlqt('R','N',m , kk, k, 0, mb, a(1, ii), lda,
360  $ t(1,ctr *k+1), ldt, c(1,1), ldc,
361  $ c(1,ii), ldc, work, info )
362  ELSE
363  ii=n+1
364  END IF
365 *
366  DO i=ii-(nb-k),nb+1,-(nb-k)
367 *
368 * Multiply Q to the current block of C (1:M,I:I+MB)
369 *
370  ctr = ctr - 1
371  CALL dtpmlqt('R','N', m, nb-k, k, 0, mb, a(1, i), lda,
372  $ t(1,ctr*k+1), ldt, c(1,1), ldc,
373  $ c(1,i), ldc, work, info )
374 *
375  END DO
376 *
377 * Multiply Q to the first block of C (1:M,1:MB)
378 *
379  CALL dgemlqt('R','N',m , nb, k, mb, a(1,1), lda, t
380  $ ,ldt ,c(1,1), ldc, work, info )
381 *
382  ELSE IF (right.AND.tran) THEN
383 *
384 * Multiply Q to the first block of C
385 *
386  kk = mod((n-k),(nb-k))
387  ctr = 1
388  ii=n-kk+1
389  CALL dgemlqt('R','T',m , nb, k, mb, a(1,1), lda, t
390  $ ,ldt ,c(1,1), ldc, work, info )
391 *
392  DO i=nb+1,ii-nb+k,(nb-k)
393 *
394 * Multiply Q to the current block of C (1:M,I:I+MB)
395 *
396  CALL dtpmlqt('R','T',m , nb-k, k, 0,mb, a(1,i), lda,
397  $ t(1,ctr*k+1), ldt, c(1,1), ldc,
398  $ c(1,i), ldc, work, info )
399  ctr = ctr + 1
400 *
401  END DO
402  IF(ii.LE.n) THEN
403 *
404 * Multiply Q to the last block of C
405 *
406  CALL dtpmlqt('R','T',m , kk, k, 0,mb, a(1,ii), lda,
407  $ t(1,ctr*k+1),ldt, c(1,1), ldc,
408  $ c(1,ii), ldc, work, info )
409 *
410  END IF
411 *
412  END IF
413 *
414  work(1) = lw
415  RETURN
416 *
417 * End of DLAMSWLQ
418 *
Here is the call graph for this function:
Here is the caller graph for this function:
dgemlqt
subroutine dgemlqt(SIDE, TRANS, M, N, K, MB, V, LDV, T, LDT, C, LDC, WORK, INFO)
DGEMLQT
Definition: dgemlqt.f:170
dtpmlqt
subroutine dtpmlqt(SIDE, TRANS, M, N, K, L, MB, V, LDV, T, LDT, A, LDA, B, LDB, WORK, INFO)
DTPMLQT
Definition: dtpmlqt.f:218
xerbla
subroutine xerbla(SRNAME, INFO)
XERBLA
Definition: xerbla.f:62
lsame
logical function lsame(CA, CB)
LSAME
Definition: lsame.f:55