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

◆ zlaswlq()

subroutine zlaswlq ( integer m,
integer n,
integer mb,
integer nb,
complex*16, dimension( lda, * ) a,
integer lda,
complex*16, dimension( ldt, * ) t,
integer ldt,
complex*16, dimension( * ) work,
integer lwork,
integer info )

ZLASWLQ

Purpose:
!>
!> ZLASWLQ computes a blocked Tall-Skinny LQ factorization of
!> a complexx M-by-N matrix A for M <= N:
!>
!>    A = ( L 0 ) *  Q,
!>
!> where:
!>
!>    Q is a n-by-N orthogonal matrix, stored on exit in an implicit
!>    form in the elements above the diagonal of the array A and in
!>    the elements of the array T;
!>    L is a lower-triangular M-by-M matrix stored on exit in
!>    the elements on and below the diagonal of the array A.
!>    0 is a M-by-(N-M) zero matrix, if M < N, and is not stored.
!>
!> 
Parameters
[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 A.  N >= M >= 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 > 0.
!> 
[in,out]A
!>          A is COMPLEX*16 array, dimension (LDA,N)
!>          On entry, the M-by-N matrix A.
!>          On exit, the elements on and below the diagonal
!>          of the array contain the N-by-N lower triangular matrix L;
!>          the elements above the diagonal represent Q by the rows
!>          of blocked V (see Further Details).
!>
!> 
[in]LDA
!>          LDA is INTEGER
!>          The leading dimension of the array A.  LDA >= max(1,M).
!> 
[out]T
!>          T is COMPLEX*16 array,
!>          dimension (LDT, N * Number_of_row_blocks)
!>          where Number_of_row_blocks = CEIL((N-M)/(NB-M))
!>          The blocked upper triangular block reflectors stored in compact form
!>          as a sequence of upper triangular blocks.
!>          See Further Details below.
!> 
[in]LDT
!>          LDT is INTEGER
!>          The leading dimension of the array T.  LDT >= MB.
!> 
[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 MIN(M,N) = 0, and LWORK >= MB*M, otherwise.
!>
!>          If LWORK = -1, then a workspace query is assumed; the routine
!>          only calculates the minimal 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 166 of file zlaswlq.f.

168*
169* -- LAPACK computational routine --
170* -- LAPACK is a software package provided by Univ. of Tennessee, --
171* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd. --
172*
173* .. Scalar Arguments ..
174 INTEGER INFO, LDA, M, N, MB, NB, LWORK, LDT
175* ..
176* .. Array Arguments ..
177 COMPLEX*16 A( LDA, * ), WORK( * ), T( LDT, * )
178* ..
179*
180* =====================================================================
181*
182* ..
183* .. Local Scalars ..
184 LOGICAL LQUERY
185 INTEGER I, II, KK, CTR, MINMN, LWMIN
186* ..
187* .. EXTERNAL FUNCTIONS ..
188 LOGICAL LSAME
189 EXTERNAL lsame
190* ..
191* .. EXTERNAL SUBROUTINES ..
192 EXTERNAL zgelqt, ztplqt, xerbla
193* ..
194* .. INTRINSIC FUNCTIONS ..
195 INTRINSIC max, min, mod
196* ..
197* .. EXECUTABLE STATEMENTS ..
198*
199* TEST THE INPUT ARGUMENTS
200*
201 info = 0
202*
203 lquery = ( lwork.EQ.-1 )
204*
205 minmn = min( m, n )
206 IF( minmn.EQ.0 ) THEN
207 lwmin = 1
208 ELSE
209 lwmin = m*mb
210 END IF
211*
212 IF( m.LT.0 ) THEN
213 info = -1
214 ELSE IF( n.LT.0 .OR. n.LT.m ) THEN
215 info = -2
216 ELSE IF( mb.LT.1 .OR. ( mb.GT.m .AND. m.GT.0 ) ) THEN
217 info = -3
218 ELSE IF( nb.LE.0 ) THEN
219 info = -4
220 ELSE IF( lda.LT.max( 1, m ) ) THEN
221 info = -6
222 ELSE IF( ldt.LT.mb ) THEN
223 info = -8
224 ELSE IF( lwork.LT.lwmin .AND. (.NOT.lquery) ) THEN
225 info = -10
226 END IF
227*
228 IF( info.EQ.0 ) THEN
229 work( 1 ) = lwmin
230 END IF
231*
232 IF( info.NE.0 ) THEN
233 CALL xerbla( 'ZLASWLQ', -info )
234 RETURN
235 ELSE IF( lquery ) THEN
236 RETURN
237 END IF
238*
239* Quick return if possible
240*
241 IF( minmn.EQ.0 ) THEN
242 RETURN
243 END IF
244*
245* The LQ Decomposition
246*
247 IF( (m.GE.n) .OR. (nb.LE.m) .OR. (nb.GE.n) ) THEN
248 CALL zgelqt( m, n, mb, a, lda, t, ldt, work, info )
249 RETURN
250 END IF
251*
252 kk = mod((n-m),(nb-m))
253 ii = n-kk+1
254*
255* Compute the LQ factorization of the first block A(1:M,1:NB)
256*
257 CALL zgelqt( m, nb, mb, a(1,1), lda, t, ldt, work, info )
258 ctr = 1
259*
260 DO i = nb+1, ii-nb+m, (nb-m)
261*
262* Compute the QR factorization of the current block A(1:M,I:I+NB-M)
263*
264 CALL ztplqt( m, nb-m, 0, mb, a(1,1), lda, a( 1, i ),
265 $ lda, t(1, ctr * m + 1),
266 $ ldt, work, info )
267 ctr = ctr + 1
268 END DO
269*
270* Compute the QR factorization of the last block A(1:M,II:N)
271*
272 IF( ii.LE.n ) THEN
273 CALL ztplqt( m, kk, 0, mb, a(1,1), lda, a( 1, ii ),
274 $ lda, t(1, ctr * m + 1), ldt,
275 $ work, info )
276 END IF
277*
278 work( 1 ) = lwmin
279 RETURN
280*
281* End of ZLASWLQ
282*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zgelqt(m, n, mb, a, lda, t, ldt, work, info)
ZGELQT
Definition zgelqt.f:137
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
subroutine ztplqt(m, n, l, mb, a, lda, b, ldb, t, ldt, work, info)
ZTPLQT
Definition ztplqt.f:187
Here is the call graph for this function:
Here is the caller graph for this function: