3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download DGEQRT + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/dgelqt.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/dgelqt.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/dgelqt.f">
21 * SUBROUTINE DGELQT( M, N, MB, A, LDA, T, LDT, WORK, INFO )
23 * .. Scalar Arguments ..
24 * INTEGER INFO, LDA, LDT, M, N, MB
26 * .. Array Arguments ..
27 * DOUBLE PRECISION A( LDA, * ), T( LDT, * ), WORK( * )
36 *> DGELQT computes a blocked LQ factorization of a real M-by-N matrix A
37 *> using the compact WY representation of Q.
46 *> The number of rows of the matrix A. M >= 0.
52 *> The number of columns of the matrix A. N >= 0.
58 *> The block size to be used in the blocked QR. MIN(M,N) >= MB >= 1.
63 *> A is DOUBLE PRECISION array, dimension (LDA,N)
64 *> On entry, the M-by-N matrix A.
65 *> On exit, the elements on and below the diagonal of the array
66 *> contain the M-by-MIN(M,N) lower trapezoidal matrix L (L is
67 *> lower triangular if M <= N); the elements above the diagonal
74 *> The leading dimension of the array A. LDA >= max(1,M).
79 *> T is DOUBLE PRECISION array, dimension (LDT,MIN(M,N))
80 *> The upper triangular block reflectors stored in compact form
81 *> as a sequence of upper triangular blocks. See below
82 *> for further details.
88 *> The leading dimension of the array T. LDT >= MB.
93 *> WORK is DOUBLE PRECISION array, dimension (MB*N)
99 *> = 0: successful exit
100 *> < 0: if INFO = -i, the i-th argument had an illegal value
106 *> \author Univ. of Tennessee
107 *> \author Univ. of California Berkeley
108 *> \author Univ. of Colorado Denver
111 *> \date November 2013
113 *> \ingroup doubleGEcomputational
115 *> \par Further Details:
116 * =====================
120 *> The matrix V stores the elementary reflectors H(i) in the i-th column
121 *> below the diagonal. For example, if M=5 and N=3, the matrix V is
123 *> V = ( 1 v1 v1 v1 v1 )
128 *> where the vi's represent the vectors which define H(i), which are returned
129 *> in the matrix A. The 1's along the diagonal of V are not stored in A.
130 *> Let K=MIN(M,N). The number of blocks is B = ceiling(K/NB), where each
131 *> block is of order NB except for the last block, which is of order
132 *> IB = K - (B-1)*NB. For each of the B blocks, a upper triangular block
133 *> reflector factor is computed: T1, T2, ..., TB. The NB-by-NB (and IB-by-IB
134 *> for the last block) T's are stored in the NB-by-N matrix T as
136 *> T = (T1 T2 ... TB).
139 * =====================================================================
140 SUBROUTINE DGELQT( M, N, MB, A, LDA, T, LDT, WORK, INFO )
142 * -- LAPACK computational routine (version 3.5.0) --
143 * -- LAPACK is a software package provided by Univ. of Tennessee, --
144 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
147 * .. Scalar Arguments ..
148 INTEGER INFO, LDA, LDT, M, N, MB
150 * .. Array Arguments ..
151 DOUBLE PRECISION A( LDA, * ), T( LDT, * ), WORK( * )
154 * =====================================================================
157 * .. Local Scalars ..
158 INTEGER I, IB, IINFO, K
160 * .. External Subroutines ..
161 EXTERNAL DGEQRT2, DGEQRT3, DLARFB, XERBLA
163 * .. Executable Statements ..
165 * Test the input arguments
170 ELSE IF( N.LT.0 ) THEN
172 ELSE IF( MB.LT.1 .OR. ( MB.GT.MIN(M,N) .AND. MIN(M,N).GT.0 ) )THEN
174 ELSE IF( LDA.LT.MAX( 1, M ) ) THEN
176 ELSE IF( LDT.LT.MB ) THEN
180 CALL XERBLA( 'DGELQT', -INFO )
184 * Quick return if possible
189 * Blocked loop of length K
192 IB = MIN( K-I+1, MB )
194 * Compute the LQ factorization of the current block A(I:M,I:I+IB-1)
196 CALL DGELQT3( IB, N-I+1, A(I,I), LDA, T(1,I), LDT, IINFO )
199 * Update by applying H**T to A(I:M,I+IB:N) from the right
201 CALL DLARFB( 'R', 'N', 'F', 'R', M-I-IB+1, N-I+1, IB,
202 $ A( I, I ), LDA, T( 1, I ), LDT,
203 $ A( I+IB, I ), LDA, WORK , M-I-IB+1 )