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

◆ cgemlqt()

subroutine cgemlqt ( character  side,
character  trans,
integer  m,
integer  n,
integer  k,
integer  mb,
complex, dimension( ldv, * )  v,
integer  ldv,
complex, dimension( ldt, * )  t,
integer  ldt,
complex, dimension( ldc, * )  c,
integer  ldc,
complex, dimension( * )  work,
integer  info 
)

CGEMLQT

Purpose:
 CGEMLQT overwrites the general complex M-by-N matrix C with

                 SIDE = 'L'     SIDE = 'R'
 TRANS = 'N':      Q C            C Q
 TRANS = 'C':   Q**H C            C Q**H

 where Q is a complex unitary matrix defined as the product of K
 elementary reflectors:

       Q = H(1) H(2) . . . H(K) = I - V T V**H

 generated using the compact WY representation as returned by CGELQT.

 Q is of order M if SIDE = 'L' and of order N  if SIDE = 'R'.
Parameters
[in]SIDE
          SIDE is CHARACTER*1
          = 'L': apply Q or Q**H from the Left;
          = 'R': apply Q or Q**H from the Right.
[in]TRANS
          TRANS is CHARACTER*1
          = 'N':  No transpose, apply Q;
          = 'C':  Conjugate transpose, apply Q**H.
[in]M
          M is INTEGER
          The number of rows of the matrix C. M >= 0.
[in]N
          N is INTEGER
          The number of columns of the matrix C. N >= 0.
[in]K
          K is INTEGER
          The number of elementary reflectors whose product defines
          the matrix Q.
          If SIDE = 'L', M >= K >= 0;
          if SIDE = 'R', N >= K >= 0.
[in]MB
          MB is INTEGER
          The block size used for the storage of T.  K >= MB >= 1.
          This must be the same value of MB used to generate T
          in CGELQT.
[in]V
          V is COMPLEX array, dimension
                               (LDV,M) if SIDE = 'L',
                               (LDV,N) if SIDE = 'R'
          The i-th row must contain the vector which defines the
          elementary reflector H(i), for i = 1,2,...,k, as returned by
          CGELQT in the first K rows of its array argument A.
[in]LDV
          LDV is INTEGER
          The leading dimension of the array V. LDV >= max(1,K).
[in]T
          T is COMPLEX array, dimension (LDT,K)
          The upper triangular factors of the block reflectors
          as returned by CGELQT, stored as a MB-by-K matrix.
[in]LDT
          LDT is INTEGER
          The leading dimension of the array T.  LDT >= MB.
[in,out]C
          C is COMPLEX array, dimension (LDC,N)
          On entry, the M-by-N matrix C.
          On exit, C is overwritten by Q C, Q**H C, C Q**H or C Q.
[in]LDC
          LDC is INTEGER
          The leading dimension of the array C. LDC >= max(1,M).
[out]WORK
          WORK is COMPLEX array. The dimension of
          WORK is N*MB if SIDE = 'L', or  M*MB if SIDE = 'R'.
[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.

Definition at line 151 of file cgemlqt.f.

153*
154* -- LAPACK computational routine --
155* -- LAPACK is a software package provided by Univ. of Tennessee, --
156* -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
157*
158* .. Scalar Arguments ..
159 CHARACTER SIDE, TRANS
160 INTEGER INFO, K, LDV, LDC, M, N, MB, LDT
161* ..
162* .. Array Arguments ..
163 COMPLEX V( LDV, * ), C( LDC, * ), T( LDT, * ), WORK( * )
164* ..
165*
166* =====================================================================
167*
168* ..
169* .. Local Scalars ..
170 LOGICAL LEFT, RIGHT, TRAN, NOTRAN
171 INTEGER I, IB, LDWORK, KF, Q
172* ..
173* .. External Functions ..
174 LOGICAL LSAME
175 EXTERNAL lsame
176* ..
177* .. External Subroutines ..
178 EXTERNAL xerbla, clarfb
179* ..
180* .. Intrinsic Functions ..
181 INTRINSIC max, min
182* ..
183* .. Executable Statements ..
184*
185* .. Test the input arguments ..
186*
187 info = 0
188 left = lsame( side, 'L' )
189 right = lsame( side, 'R' )
190 tran = lsame( trans, 'C' )
191 notran = lsame( trans, 'N' )
192*
193 IF( left ) THEN
194 ldwork = max( 1, n )
195 q = m
196 ELSE IF ( right ) THEN
197 ldwork = max( 1, m )
198 q = n
199 END IF
200 IF( .NOT.left .AND. .NOT.right ) THEN
201 info = -1
202 ELSE IF( .NOT.tran .AND. .NOT.notran ) THEN
203 info = -2
204 ELSE IF( m.LT.0 ) THEN
205 info = -3
206 ELSE IF( n.LT.0 ) THEN
207 info = -4
208 ELSE IF( k.LT.0 .OR. k.GT.q ) THEN
209 info = -5
210 ELSE IF( mb.LT.1 .OR. (mb.GT.k .AND. k.GT.0)) THEN
211 info = -6
212 ELSE IF( ldv.LT.max( 1, k ) ) THEN
213 info = -8
214 ELSE IF( ldt.LT.mb ) THEN
215 info = -10
216 ELSE IF( ldc.LT.max( 1, m ) ) THEN
217 info = -12
218 END IF
219*
220 IF( info.NE.0 ) THEN
221 CALL xerbla( 'CGEMLQT', -info )
222 RETURN
223 END IF
224*
225* .. Quick return if possible ..
226*
227 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 ) RETURN
228*
229 IF( left .AND. notran ) THEN
230*
231 DO i = 1, k, mb
232 ib = min( mb, k-i+1 )
233 CALL clarfb( 'L', 'C', 'F', 'R', m-i+1, n, ib,
234 $ v( i, i ), ldv, t( 1, i ), ldt,
235 $ c( i, 1 ), ldc, work, ldwork )
236 END DO
237*
238 ELSE IF( right .AND. tran ) THEN
239*
240 DO i = 1, k, mb
241 ib = min( mb, k-i+1 )
242 CALL clarfb( 'R', 'N', 'F', 'R', m, n-i+1, ib,
243 $ v( i, i ), ldv, t( 1, i ), ldt,
244 $ c( 1, i ), ldc, work, ldwork )
245 END DO
246*
247 ELSE IF( left .AND. tran ) THEN
248*
249 kf = ((k-1)/mb)*mb+1
250 DO i = kf, 1, -mb
251 ib = min( mb, k-i+1 )
252 CALL clarfb( 'L', 'N', 'F', 'R', m-i+1, n, ib,
253 $ v( i, i ), ldv, t( 1, i ), ldt,
254 $ c( i, 1 ), ldc, work, ldwork )
255 END DO
256*
257 ELSE IF( right .AND. notran ) THEN
258*
259 kf = ((k-1)/mb)*mb+1
260 DO i = kf, 1, -mb
261 ib = min( mb, k-i+1 )
262 CALL clarfb( 'R', 'C', 'F', 'R', m, n-i+1, ib,
263 $ v( i, i ), ldv, t( 1, i ), ldt,
264 $ c( 1, i ), ldc, work, ldwork )
265 END DO
266*
267 END IF
268*
269 RETURN
270*
271* End of CGEMLQT
272*
subroutine xerbla(srname, info)
Definition cblat2.f:3285
subroutine clarfb(side, trans, direct, storev, m, n, k, v, ldv, t, ldt, c, ldc, work, ldwork)
CLARFB applies a block reflector or its conjugate-transpose to a general rectangular matrix.
Definition clarfb.f:197
logical function lsame(ca, cb)
LSAME
Definition lsame.f:48
Here is the call graph for this function:
Here is the caller graph for this function: