1 *> \brief \b ZTPLQT2 computes a LQ factorization of a real or complex "triangular-pentagonal" matrix, which is composed of a triangular block and a pentagonal block, using the compact WY representation for Q.
3 * =========== DOCUMENTATION ===========
5 * Online html documentation available at
6 * http://www.netlib.org/lapack/explore-html/
9 *> Download ZTPLQT2 + dependencies
10 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ztplqt2.f">
12 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ztplqt2.f">
14 *> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztplqt2.f">
21 * SUBROUTINE ZTPLQT2( M, N, L, A, LDA, B, LDB, T, LDT, INFO )
23 * .. Scalar Arguments ..
24 * INTEGER INFO, LDA, LDB, LDT, N, M, L
26 * .. Array Arguments ..
27 * COMPLEX*16 A( LDA, * ), B( LDB, * ), T( LDT, * )
36 *> ZTPLQT2 computes a LQ a factorization of a complex "triangular-pentagonal"
37 *> matrix C, which is composed of a triangular block A and pentagonal block B,
38 *> using the compact WY representation for Q.
47 *> The total number of rows of the matrix B.
54 *> The number of columns of the matrix B, and the order of
55 *> the triangular matrix A.
62 *> The number of rows of the lower trapezoidal part of B.
63 *> MIN(M,N) >= L >= 0. See Further Details.
68 *> A is COMPLEX*16 array, dimension (LDA,N)
69 *> On entry, the lower triangular M-by-M matrix A.
70 *> On exit, the elements on and below the diagonal of the array
71 *> contain the lower triangular matrix L.
77 *> The leading dimension of the array A. LDA >= max(1,N).
82 *> B is COMPLEX*16 array, dimension (LDB,N)
83 *> On entry, the pentagonal M-by-N matrix B. The first N-L columns
84 *> are rectangular, and the last L columns are lower trapezoidal.
85 *> On exit, B contains the pentagonal matrix V. See Further Details.
91 *> The leading dimension of the array B. LDB >= max(1,M).
96 *> T is COMPLEX*16 array, dimension (LDT,M)
97 *> The N-by-N upper triangular factor T of the block reflector.
98 *> See Further Details.
104 *> The leading dimension of the array T. LDT >= max(1,M)
110 *> = 0: successful exit
111 *> < 0: if INFO = -i, the i-th argument had an illegal value
117 *> \author Univ. of Tennessee
118 *> \author Univ. of California Berkeley
119 *> \author Univ. of Colorado Denver
122 *> \date September 2012
124 *> \ingroup doubleOTHERcomputational
126 *> \par Further Details:
127 * =====================
131 *> The input matrix C is a M-by-(M+N) matrix
136 *> where A is an lower triangular N-by-N matrix, and B is M-by-N pentagonal
137 *> matrix consisting of a M-by-(N-L) rectangular matrix B1 left of a M-by-L
138 *> upper trapezoidal matrix B2:
141 *> [ B1 ] <- M-by-(N-L) rectangular
142 *> [ B2 ] <- M-by-L lower trapezoidal.
144 *> The lower trapezoidal matrix B2 consists of the first L columns of a
145 *> N-by-N lower triangular matrix, where 0 <= L <= MIN(M,N). If L=0,
146 *> B is rectangular M-by-N; if M=L=N, B is lower triangular.
148 *> The matrix W stores the elementary reflectors H(i) in the i-th row
149 *> above the diagonal (of A) in the M-by-(M+N) input matrix C
152 *> [ A ] <- lower triangular N-by-N
153 *> [ B ] <- M-by-N pentagonal
155 *> so that W can be represented as
158 *> [ I ] <- identity, N-by-N
159 *> [ V ] <- M-by-N, same form as B.
161 *> Thus, all of information needed for W is contained on exit in B, which
162 *> we call V above. Note that V has the same form as B; that is,
165 *> [ V1 ] <- M-by-(N-L) rectangular
166 *> [ V2 ] <- M-by-L lower trapezoidal.
168 *> The rows of V represent the vectors which define the H(i)'s.
169 *> The (M+N)-by-(M+N) block reflector H is then given by
171 *> H = I - W**T * T * W
173 *> where W^H is the conjugate transpose of W and T is the upper triangular
174 *> factor of the block reflector.
177 * =====================================================================
178 SUBROUTINE ZTPLQT2( M, N, L, A, LDA, B, LDB, T, LDT, INFO )
180 * -- LAPACK computational routine (version 3.4.2) --
181 * -- LAPACK is a software package provided by Univ. of Tennessee, --
182 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
185 * .. Scalar Arguments ..
186 INTEGER INFO, LDA, LDB, LDT, N, M, L
188 * .. Array Arguments ..
189 COMPLEX*16 A( LDA, * ), B( LDB, * ), T( LDT, * )
192 * =====================================================================
196 PARAMETER( ZERO = ( 0.0D+0, 0.0D+0 ),ONE = ( 1.0D+0, 0.0D+0 ) )
198 * .. Local Scalars ..
199 INTEGER I, J, P, MP, NP
202 * .. External Subroutines ..
203 EXTERNAL ZLARFG, ZGEMV, ZGERC, ZTRMV, XERBLA
205 * .. Intrinsic Functions ..
208 * .. Executable Statements ..
210 * Test the input arguments
215 ELSE IF( N.LT.0 ) THEN
217 ELSE IF( L.LT.0 .OR. L.GT.MIN(M,N) ) THEN
219 ELSE IF( LDA.LT.MAX( 1, M ) ) THEN
221 ELSE IF( LDB.LT.MAX( 1, M ) ) THEN
223 ELSE IF( LDT.LT.MAX( 1, M ) ) THEN
227 CALL XERBLA( 'ZTPLQT2', -INFO )
231 * Quick return if possible
233 IF( N.EQ.0 .OR. M.EQ.0 ) RETURN
237 * Generate elementary reflector H(I) to annihilate B(I,:)
240 CALL ZLARFG( P+1, A( I, I ), B( I, 1 ), LDB, T( 1, I ) )
244 B( I, J ) = CONJG(B(I,J))
247 * W(M-I:1) := C(I+1:M,I:N) * C(I,I:N) [use W = T(M,:)]
250 T( M, J ) = (A( I+J, I ))
252 CALL ZGEMV( 'N', M-I, P, ONE, B( I+1, 1 ), LDB,
253 $ B( I, 1 ), LDB, ONE, T( M, 1 ), LDT )
255 * C(I+1:M,I:N) = C(I+1:M,I:N) + alpha * C(I,I:N)*W(M-1:1)^H
259 A( I+J, I ) = A( I+J, I ) + ALPHA*(T( M, J ))
261 CALL ZGERC( M-I, P, (ALPHA), T( M, 1 ), LDT,
262 $ B( I, 1 ), LDB, B( I+1, 1 ), LDB )
264 B( I, J ) = CONJG(B(I,J))
271 * T(I,1:I-1) := C(I:I-1,1:N)**H * (alpha * C(I,I:N))
284 * Triangular part of B2
287 T( I, J ) = (ALPHA*B( I, N-L+J ))
289 CALL ZTRMV( 'L', 'N', 'N', P, B( 1, NP ), LDB,
292 * Rectangular part of B2
294 CALL ZGEMV( 'N', I-1-P, L, ALPHA, B( MP, NP ), LDB,
295 $ B( I, NP ), LDB, ZERO, T( I,MP ), LDT )
300 CALL ZGEMV( 'N', I-1, N-L, ALPHA, B, LDB, B( I, 1 ), LDB,
301 $ ONE, T( I, 1 ), LDT )
305 * T(1:I-1,I) := T(1:I-1,1:I-1) * T(I,1:I-1)
310 CALL ZTRMV( 'L', 'C', 'N', I-1, T, LDT, T( I, 1 ), LDT )
320 T( I, I ) = T( 1, I )