LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches
ztplqt2.f
Go to the documentation of this file.
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.
2*
3* =========== DOCUMENTATION ===========
4*
5* Online html documentation available at
6* http://www.netlib.org/lapack/explore-html/
7*
8*> Download ZTPLQT2 + dependencies
9*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.tgz?format=tgz&filename=/lapack/lapack_routine/ztplqt2.f">
10*> [TGZ]</a>
11*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.zip?format=zip&filename=/lapack/lapack_routine/ztplqt2.f">
12*> [ZIP]</a>
13*> <a href="http://www.netlib.org/cgi-bin/netlibfiles.txt?format=txt&filename=/lapack/lapack_routine/ztplqt2.f">
14*> [TXT]</a>
15*
16* Definition:
17* ===========
18*
19* SUBROUTINE ZTPLQT2( M, N, L, A, LDA, B, LDB, T, LDT, INFO )
20*
21* .. Scalar Arguments ..
22* INTEGER INFO, LDA, LDB, LDT, N, M, L
23* ..
24* .. Array Arguments ..
25* COMPLEX*16 A( LDA, * ), B( LDB, * ), T( LDT, * )
26* ..
27*
28*
29*> \par Purpose:
30* =============
31*>
32*> \verbatim
33*>
34*> ZTPLQT2 computes a LQ a factorization of a complex "triangular-pentagonal"
35*> matrix C, which is composed of a triangular block A and pentagonal block B,
36*> using the compact WY representation for Q.
37*> \endverbatim
38*
39* Arguments:
40* ==========
41*
42*> \param[in] M
43*> \verbatim
44*> M is INTEGER
45*> The total number of rows of the matrix B.
46*> M >= 0.
47*> \endverbatim
48*>
49*> \param[in] N
50*> \verbatim
51*> N is INTEGER
52*> The number of columns of the matrix B, and the order of
53*> the triangular matrix A.
54*> N >= 0.
55*> \endverbatim
56*>
57*> \param[in] L
58*> \verbatim
59*> L is INTEGER
60*> The number of rows of the lower trapezoidal part of B.
61*> MIN(M,N) >= L >= 0. See Further Details.
62*> \endverbatim
63*>
64*> \param[in,out] A
65*> \verbatim
66*> A is COMPLEX*16 array, dimension (LDA,M)
67*> On entry, the lower triangular M-by-M matrix A.
68*> On exit, the elements on and below the diagonal of the array
69*> contain the lower triangular matrix L.
70*> \endverbatim
71*>
72*> \param[in] LDA
73*> \verbatim
74*> LDA is INTEGER
75*> The leading dimension of the array A. LDA >= max(1,M).
76*> \endverbatim
77*>
78*> \param[in,out] B
79*> \verbatim
80*> B is COMPLEX*16 array, dimension (LDB,N)
81*> On entry, the pentagonal M-by-N matrix B. The first N-L columns
82*> are rectangular, and the last L columns are lower trapezoidal.
83*> On exit, B contains the pentagonal matrix V. See Further Details.
84*> \endverbatim
85*>
86*> \param[in] LDB
87*> \verbatim
88*> LDB is INTEGER
89*> The leading dimension of the array B. LDB >= max(1,M).
90*> \endverbatim
91*>
92*> \param[out] T
93*> \verbatim
94*> T is COMPLEX*16 array, dimension (LDT,M)
95*> The N-by-N upper triangular factor T of the block reflector.
96*> See Further Details.
97*> \endverbatim
98*>
99*> \param[in] LDT
100*> \verbatim
101*> LDT is INTEGER
102*> The leading dimension of the array T. LDT >= max(1,M)
103*> \endverbatim
104*>
105*> \param[out] INFO
106*> \verbatim
107*> INFO is INTEGER
108*> = 0: successful exit
109*> < 0: if INFO = -i, the i-th argument had an illegal value
110*> \endverbatim
111*
112* Authors:
113* ========
114*
115*> \author Univ. of Tennessee
116*> \author Univ. of California Berkeley
117*> \author Univ. of Colorado Denver
118*> \author NAG Ltd.
119*
120*> \ingroup tplqt2
121*
122*> \par Further Details:
123* =====================
124*>
125*> \verbatim
126*>
127*> The input matrix C is a M-by-(M+N) matrix
128*>
129*> C = [ A ][ B ]
130*>
131*>
132*> where A is an lower triangular M-by-M matrix, and B is M-by-N pentagonal
133*> matrix consisting of a M-by-(N-L) rectangular matrix B1 left of a M-by-L
134*> upper trapezoidal matrix B2:
135*>
136*> B = [ B1 ][ B2 ]
137*> [ B1 ] <- M-by-(N-L) rectangular
138*> [ B2 ] <- M-by-L lower trapezoidal.
139*>
140*> The lower trapezoidal matrix B2 consists of the first L columns of a
141*> N-by-N lower triangular matrix, where 0 <= L <= MIN(M,N). If L=0,
142*> B is rectangular M-by-N; if M=L=N, B is lower triangular.
143*>
144*> The matrix W stores the elementary reflectors H(i) in the i-th row
145*> above the diagonal (of A) in the M-by-(M+N) input matrix C
146*>
147*> C = [ A ][ B ]
148*> [ A ] <- lower triangular M-by-M
149*> [ B ] <- M-by-N pentagonal
150*>
151*> so that W can be represented as
152*>
153*> W = [ I ][ V ]
154*> [ I ] <- identity, M-by-M
155*> [ V ] <- M-by-N, same form as B.
156*>
157*> Thus, all of information needed for W is contained on exit in B, which
158*> we call V above. Note that V has the same form as B; that is,
159*>
160*> W = [ V1 ][ V2 ]
161*> [ V1 ] <- M-by-(N-L) rectangular
162*> [ V2 ] <- M-by-L lower trapezoidal.
163*>
164*> The rows of V represent the vectors which define the H(i)'s.
165*> The (M+N)-by-(M+N) block reflector H is then given by
166*>
167*> H = I - W**T * T * W
168*>
169*> where W^H is the conjugate transpose of W and T is the upper triangular
170*> factor of the block reflector.
171*> \endverbatim
172*>
173* =====================================================================
174 SUBROUTINE ztplqt2( M, N, L, A, LDA, B, LDB, T, LDT, INFO )
175*
176* -- LAPACK computational routine --
177* -- LAPACK is a software package provided by Univ. of Tennessee, --
178* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
179*
180* .. Scalar Arguments ..
181 INTEGER INFO, LDA, LDB, LDT, N, M, L
182* ..
183* .. Array Arguments ..
184 COMPLEX*16 A( LDA, * ), B( LDB, * ), T( LDT, * )
185* ..
186*
187* =====================================================================
188*
189* .. Parameters ..
190 COMPLEX*16 ONE, ZERO
191 parameter( zero = ( 0.0d+0, 0.0d+0 ),one = ( 1.0d+0, 0.0d+0 ) )
192* ..
193* .. Local Scalars ..
194 INTEGER I, J, P, MP, NP
195 COMPLEX*16 ALPHA
196* ..
197* .. External Subroutines ..
198 EXTERNAL zlarfg, zgemv, zgerc, ztrmv, xerbla
199* ..
200* .. Intrinsic Functions ..
201 INTRINSIC max, min
202* ..
203* .. Executable Statements ..
204*
205* Test the input arguments
206*
207 info = 0
208 IF( m.LT.0 ) THEN
209 info = -1
210 ELSE IF( n.LT.0 ) THEN
211 info = -2
212 ELSE IF( l.LT.0 .OR. l.GT.min(m,n) ) THEN
213 info = -3
214 ELSE IF( lda.LT.max( 1, m ) ) THEN
215 info = -5
216 ELSE IF( ldb.LT.max( 1, m ) ) THEN
217 info = -7
218 ELSE IF( ldt.LT.max( 1, m ) ) THEN
219 info = -9
220 END IF
221 IF( info.NE.0 ) THEN
222 CALL xerbla( 'ZTPLQT2', -info )
223 RETURN
224 END IF
225*
226* Quick return if possible
227*
228 IF( n.EQ.0 .OR. m.EQ.0 ) RETURN
229*
230 DO i = 1, m
231*
232* Generate elementary reflector H(I) to annihilate B(I,:)
233*
234 p = n-l+min( l, i )
235 CALL zlarfg( p+1, a( i, i ), b( i, 1 ), ldb, t( 1, i ) )
236 t(1,i)=conjg(t(1,i))
237 IF( i.LT.m ) THEN
238 DO j = 1, p
239 b( i, j ) = conjg(b(i,j))
240 END DO
241*
242* W(M-I:1) := C(I+1:M,I:N) * C(I,I:N) [use W = T(M,:)]
243*
244 DO j = 1, m-i
245 t( m, j ) = (a( i+j, i ))
246 END DO
247 CALL zgemv( 'N', m-i, p, one, b( i+1, 1 ), ldb,
248 $ b( i, 1 ), ldb, one, t( m, 1 ), ldt )
249*
250* C(I+1:M,I:N) = C(I+1:M,I:N) + alpha * C(I,I:N)*W(M-1:1)^H
251*
252 alpha = -(t( 1, i ))
253 DO j = 1, m-i
254 a( i+j, i ) = a( i+j, i ) + alpha*(t( m, j ))
255 END DO
256 CALL zgerc( m-i, p, (alpha), t( m, 1 ), ldt,
257 $ b( i, 1 ), ldb, b( i+1, 1 ), ldb )
258 DO j = 1, p
259 b( i, j ) = conjg(b(i,j))
260 END DO
261 END IF
262 END DO
263*
264 DO i = 2, m
265*
266* T(I,1:I-1) := C(I:I-1,1:N)**H * (alpha * C(I,I:N))
267*
268 alpha = -(t( 1, i ))
269 DO j = 1, i-1
270 t( i, j ) = zero
271 END DO
272 p = min( i-1, l )
273 np = min( n-l+1, n )
274 mp = min( p+1, m )
275 DO j = 1, n-l+p
276 b(i,j)=conjg(b(i,j))
277 END DO
278*
279* Triangular part of B2
280*
281 DO j = 1, p
282 t( i, j ) = (alpha*b( i, n-l+j ))
283 END DO
284 CALL ztrmv( 'L', 'N', 'N', p, b( 1, np ), ldb,
285 $ t( i, 1 ), ldt )
286*
287* Rectangular part of B2
288*
289 CALL zgemv( 'N', i-1-p, l, alpha, b( mp, np ), ldb,
290 $ b( i, np ), ldb, zero, t( i,mp ), ldt )
291*
292* B1
293
294*
295 CALL zgemv( 'N', i-1, n-l, alpha, b, ldb, b( i, 1 ), ldb,
296 $ one, t( i, 1 ), ldt )
297*
298
299*
300* T(1:I-1,I) := T(1:I-1,1:I-1) * T(I,1:I-1)
301*
302 DO j = 1, i-1
303 t(i,j)=conjg(t(i,j))
304 END DO
305 CALL ztrmv( 'L', 'C', 'N', i-1, t, ldt, t( i, 1 ), ldt )
306 DO j = 1, i-1
307 t(i,j)=conjg(t(i,j))
308 END DO
309 DO j = 1, n-l+p
310 b(i,j)=conjg(b(i,j))
311 END DO
312*
313* T(I,I) = tau(I)
314*
315 t( i, i ) = t( 1, i )
316 t( 1, i ) = zero
317 END DO
318 DO i=1,m
319 DO j= i+1,m
320 t(i,j)=(t(j,i))
321 t(j,i)=zero
322 END DO
323 END DO
324
325*
326* End of ZTPLQT2
327*
328 END
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
Definition zgemv.f:160
subroutine zgerc(m, n, alpha, x, incx, y, incy, a, lda)
ZGERC
Definition zgerc.f:130
subroutine zlarfg(n, alpha, x, incx, tau)
ZLARFG generates an elementary reflector (Householder matrix).
Definition zlarfg.f:104
subroutine ztplqt2(m, n, l, a, lda, b, ldb, t, ldt, info)
ZTPLQT2 computes a LQ factorization of a real or complex "triangular-pentagonal" matrix,...
Definition ztplqt2.f:175
subroutine ztrmv(uplo, trans, diag, n, a, lda, x, incx)
ZTRMV
Definition ztrmv.f:147