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

◆ ctplqt2()

subroutine ctplqt2 ( integer  m,
integer  n,
integer  l,
complex, dimension( lda, * )  a,
integer  lda,
complex, dimension( ldb, * )  b,
integer  ldb,
complex, dimension( ldt, * )  t,
integer  ldt,
integer  info 
)

CTPLQT2

Purpose:
 CTPLQT2 computes a LQ a factorization of a complex "triangular-pentagonal"
 matrix C, which is composed of a triangular block A and pentagonal block B,
 using the compact WY representation for Q.
Parameters
[in]M
          M is INTEGER
          The total number of rows of the matrix B.
          M >= 0.
[in]N
          N is INTEGER
          The number of columns of the matrix B, and the order of
          the triangular matrix A.
          N >= 0.
[in]L
          L is INTEGER
          The number of rows of the lower trapezoidal part of B.
          MIN(M,N) >= L >= 0.  See Further Details.
[in,out]A
          A is COMPLEX array, dimension (LDA,M)
          On entry, the lower triangular M-by-M matrix A.
          On exit, the elements on and below the diagonal of the array
          contain the lower triangular matrix L.
[in]LDA
          LDA is INTEGER
          The leading dimension of the array A.  LDA >= max(1,M).
[in,out]B
          B is COMPLEX array, dimension (LDB,N)
          On entry, the pentagonal M-by-N matrix B.  The first N-L columns
          are rectangular, and the last L columns are lower trapezoidal.
          On exit, B contains the pentagonal matrix V.  See Further Details.
[in]LDB
          LDB is INTEGER
          The leading dimension of the array B.  LDB >= max(1,M).
[out]T
          T is COMPLEX array, dimension (LDT,M)
          The N-by-N upper triangular factor T of the block reflector.
          See Further Details.
[in]LDT
          LDT is INTEGER
          The leading dimension of the array T.  LDT >= max(1,M)
[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:
  The input matrix C is a M-by-(M+N) matrix

               C = [ A ][ B ]


  where A is an lower triangular M-by-M matrix, and B is M-by-N pentagonal
  matrix consisting of a M-by-(N-L) rectangular matrix B1 left of a M-by-L
  upper trapezoidal matrix B2:

               B = [ B1 ][ B2 ]
                   [ B1 ]  <-     M-by-(N-L) rectangular
                   [ B2 ]  <-     M-by-L lower trapezoidal.

  The lower trapezoidal matrix B2 consists of the first L columns of a
  N-by-N lower triangular matrix, where 0 <= L <= MIN(M,N).  If L=0,
  B is rectangular M-by-N; if M=L=N, B is lower triangular.

  The matrix W stores the elementary reflectors H(i) in the i-th row
  above the diagonal (of A) in the M-by-(M+N) input matrix C

               C = [ A ][ B ]
                   [ A ]  <- lower triangular M-by-M
                   [ B ]  <- M-by-N pentagonal

  so that W can be represented as

               W = [ I ][ V ]
                   [ I ]  <- identity, M-by-M
                   [ V ]  <- M-by-N, same form as B.

  Thus, all of information needed for W is contained on exit in B, which
  we call V above.  Note that V has the same form as B; that is,

               W = [ V1 ][ V2 ]
                   [ V1 ] <-     M-by-(N-L) rectangular
                   [ V2 ] <-     M-by-L lower trapezoidal.

  The rows of V represent the vectors which define the H(i)'s.
  The (M+N)-by-(M+N) block reflector H is then given by

               H = I - W**T * T * W

  where W^H is the conjugate transpose of W and T is the upper triangular
  factor of the block reflector.

Definition at line 161 of file ctplqt2.f.

162*
163* -- LAPACK computational routine --
164* -- LAPACK is a software package provided by Univ. of Tennessee, --
165* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
166*
167* .. Scalar Arguments ..
168 INTEGER INFO, LDA, LDB, LDT, N, M, L
169* ..
170* .. Array Arguments ..
171 COMPLEX A( LDA, * ), B( LDB, * ), T( LDT, * )
172* ..
173*
174* =====================================================================
175*
176* .. Parameters ..
177 COMPLEX ONE, ZERO
178 parameter( zero = ( 0.0e+0, 0.0e+0 ),one = ( 1.0e+0, 0.0e+0 ) )
179* ..
180* .. Local Scalars ..
181 INTEGER I, J, P, MP, NP
182 COMPLEX ALPHA
183* ..
184* .. External Subroutines ..
185 EXTERNAL clarfg, cgemv, cgerc, ctrmv, xerbla
186* ..
187* .. Intrinsic Functions ..
188 INTRINSIC max, min
189* ..
190* .. Executable Statements ..
191*
192* Test the input arguments
193*
194 info = 0
195 IF( m.LT.0 ) THEN
196 info = -1
197 ELSE IF( n.LT.0 ) THEN
198 info = -2
199 ELSE IF( l.LT.0 .OR. l.GT.min(m,n) ) THEN
200 info = -3
201 ELSE IF( lda.LT.max( 1, m ) ) THEN
202 info = -5
203 ELSE IF( ldb.LT.max( 1, m ) ) THEN
204 info = -7
205 ELSE IF( ldt.LT.max( 1, m ) ) THEN
206 info = -9
207 END IF
208 IF( info.NE.0 ) THEN
209 CALL xerbla( 'CTPLQT2', -info )
210 RETURN
211 END IF
212*
213* Quick return if possible
214*
215 IF( n.EQ.0 .OR. m.EQ.0 ) RETURN
216*
217 DO i = 1, m
218*
219* Generate elementary reflector H(I) to annihilate B(I,:)
220*
221 p = n-l+min( l, i )
222 CALL clarfg( p+1, a( i, i ), b( i, 1 ), ldb, t( 1, i ) )
223 t(1,i)=conjg(t(1,i))
224 IF( i.LT.m ) THEN
225 DO j = 1, p
226 b( i, j ) = conjg(b(i,j))
227 END DO
228*
229* W(M-I:1) := C(I+1:M,I:N) * C(I,I:N) [use W = T(M,:)]
230*
231 DO j = 1, m-i
232 t( m, j ) = (a( i+j, i ))
233 END DO
234 CALL cgemv( 'N', m-i, p, one, b( i+1, 1 ), ldb,
235 $ b( i, 1 ), ldb, one, t( m, 1 ), ldt )
236*
237* C(I+1:M,I:N) = C(I+1:M,I:N) + alpha * C(I,I:N)*W(M-1:1)^H
238*
239 alpha = -(t( 1, i ))
240 DO j = 1, m-i
241 a( i+j, i ) = a( i+j, i ) + alpha*(t( m, j ))
242 END DO
243 CALL cgerc( m-i, p, (alpha), t( m, 1 ), ldt,
244 $ b( i, 1 ), ldb, b( i+1, 1 ), ldb )
245 DO j = 1, p
246 b( i, j ) = conjg(b(i,j))
247 END DO
248 END IF
249 END DO
250*
251 DO i = 2, m
252*
253* T(I,1:I-1) := C(I:I-1,1:N)**H * (alpha * C(I,I:N))
254*
255 alpha = -(t( 1, i ))
256 DO j = 1, i-1
257 t( i, j ) = zero
258 END DO
259 p = min( i-1, l )
260 np = min( n-l+1, n )
261 mp = min( p+1, m )
262 DO j = 1, n-l+p
263 b(i,j)=conjg(b(i,j))
264 END DO
265*
266* Triangular part of B2
267*
268 DO j = 1, p
269 t( i, j ) = (alpha*b( i, n-l+j ))
270 END DO
271 CALL ctrmv( 'L', 'N', 'N', p, b( 1, np ), ldb,
272 $ t( i, 1 ), ldt )
273*
274* Rectangular part of B2
275*
276 CALL cgemv( 'N', i-1-p, l, alpha, b( mp, np ), ldb,
277 $ b( i, np ), ldb, zero, t( i,mp ), ldt )
278*
279* B1
280
281*
282 CALL cgemv( 'N', i-1, n-l, alpha, b, ldb, b( i, 1 ), ldb,
283 $ one, t( i, 1 ), ldt )
284*
285
286*
287* T(1:I-1,I) := T(1:I-1,1:I-1) * T(I,1:I-1)
288*
289 DO j = 1, i-1
290 t(i,j)=conjg(t(i,j))
291 END DO
292 CALL ctrmv( 'L', 'C', 'N', i-1, t, ldt, t( i, 1 ), ldt )
293 DO j = 1, i-1
294 t(i,j)=conjg(t(i,j))
295 END DO
296 DO j = 1, n-l+p
297 b(i,j)=conjg(b(i,j))
298 END DO
299*
300* T(I,I) = tau(I)
301*
302 t( i, i ) = t( 1, i )
303 t( 1, i ) = zero
304 END DO
305 DO i=1,m
306 DO j= i+1,m
307 t(i,j)=(t(j,i))
308 t(j,i)=zero
309 END DO
310 END DO
311
312*
313* End of CTPLQT2
314*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
Definition cgemv.f:160
subroutine cgerc(m, n, alpha, x, incx, y, incy, a, lda)
CGERC
Definition cgerc.f:130
subroutine clarfg(n, alpha, x, incx, tau)
CLARFG generates an elementary reflector (Householder matrix).
Definition clarfg.f:106
subroutine ctrmv(uplo, trans, diag, n, a, lda, x, incx)
CTRMV
Definition ctrmv.f:147
Here is the call graph for this function:
Here is the caller graph for this function: