LAPACK  3.7.1
LAPACK: Linear Algebra PACKage

◆ slamswlq()

subroutine slamswlq ( character  SIDE,
character  TRANS,
integer  M,
integer  N,
integer  K,
integer  MB,
integer  NB,
real, dimension( lda, * )  A,
integer  LDA,
real, dimension( ldt, * )  T,
integer  LDT,
real, dimension(ldc, * )  C,
integer  LDC,
real, dimension( * )  WORK,
integer  LWORK,
integer  INFO 
)
Purpose:

SLAMSWLQ 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 (SLASWLQ)

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 REAL 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
          SLASWLQ 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 REAL 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 REAL 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) REAL 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 204 of file slamswlq.f.

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