5 * SUBROUTINE CGELQT( M, N, MB, A, LDA, T, LDT, WORK, INFO )
7 * .. Scalar Arguments ..
8 * INTEGER INFO, LDA, LDT, M, N, MB
10 * .. Array Arguments ..
11 * COMPLEX A( LDA, * ), T( LDT, * ), WORK( * )
20 *> CGELQT computes a blocked LQ factorization of a complex M-by-N matrix A
21 *> using the compact WY representation of Q.
30 *> The number of rows of the matrix A. M >= 0.
36 *> The number of columns of the matrix A. N >= 0.
42 *> The block size to be used in the blocked QR. MIN(M,N) >= MB >= 1.
47 *> A is COMPLEX array, dimension (LDA,N)
48 *> On entry, the M-by-N matrix A.
49 *> On exit, the elements on and below the diagonal of the array
50 *> contain the M-by-MIN(M,N) lower trapezoidal matrix L (L is
51 *> lower triangular if M <= N); the elements above the diagonal
58 *> The leading dimension of the array A. LDA >= max(1,M).
63 *> T is COMPLEX array, dimension (LDT,MIN(M,N))
64 *> The upper triangular block reflectors stored in compact form
65 *> as a sequence of upper triangular blocks. See below
66 *> for further details.
72 *> The leading dimension of the array T. LDT >= MB.
77 *> WORK is COMPLEX array, dimension (MB*N)
83 *> = 0: successful exit
84 *> < 0: if INFO = -i, the i-th argument had an illegal value
90 *> \author Univ. of Tennessee
91 *> \author Univ. of California Berkeley
92 *> \author Univ. of Colorado Denver
95 *> \date November 2013
97 *> \ingroup doubleGEcomputational
99 *> \par Further Details:
100 * =====================
104 *> The matrix V stores the elementary reflectors H(i) in the i-th column
105 *> below the diagonal. For example, if M=5 and N=3, the matrix V is
107 *> V = ( 1 v1 v1 v1 v1 )
112 *> where the vi's represent the vectors which define H(i), which are returned
113 *> in the matrix A. The 1's along the diagonal of V are not stored in A.
114 *> Let K=MIN(M,N). The number of blocks is B = ceiling(K/NB), where each
115 *> block is of order NB except for the last block, which is of order
116 *> IB = K - (B-1)*NB. For each of the B blocks, a upper triangular block
117 *> reflector factor is computed: T1, T2, ..., TB. The NB-by-NB (and IB-by-IB
118 *> for the last block) T's are stored in the NB-by-N matrix T as
120 *> T = (T1 T2 ... TB).
123 * =====================================================================
124 SUBROUTINE CGELQT( M, N, MB, A, LDA, T, LDT, WORK, INFO )
126 * -- LAPACK computational routine (version 3.5.0) --
127 * -- LAPACK is a software package provided by Univ. of Tennessee, --
128 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
131 * .. Scalar Arguments ..
132 INTEGER INFO, LDA, LDT, M, N, MB
134 * .. Array Arguments ..
135 COMPLEX A( LDA, * ), T( LDT, * ), WORK( * )
138 * =====================================================================
141 * .. Local Scalars ..
142 INTEGER I, IB, IINFO, K
144 * .. External Subroutines ..
145 EXTERNAL CGELQT3, CLARFB, XERBLA
147 * .. Executable Statements ..
149 * Test the input arguments
154 ELSE IF( N.LT.0 ) THEN
156 ELSE IF( MB.LT.1 .OR. (MB.GT.MIN(M,N) .AND. MIN(M,N).GT.0 ))THEN
158 ELSE IF( LDA.LT.MAX( 1, M ) ) THEN
160 ELSE IF( LDT.LT.MB ) THEN
164 CALL XERBLA( 'CGELQT', -INFO )
168 * Quick return if possible
173 * Blocked loop of length K
176 IB = MIN( K-I+1, MB )
178 * Compute the LQ factorization of the current block A(I:M,I:I+IB-1)
180 CALL CGELQT3( IB, N-I+1, A(I,I), LDA, T(1,I), LDT, IINFO )
183 * Update by applying H**T to A(I:M,I+IB:N) from the right
185 CALL CLARFB( 'R', 'N', 'F', 'R', M-I-IB+1, N-I+1, IB,
186 $ A( I, I ), LDA, T( 1, I ), LDT,
187 $ A( I+IB, I ), LDA, WORK , M-I-IB+1 )