128 SUBROUTINE zunglq( M, N, K, A, LDA, TAU, WORK, LWORK, INFO )
136 INTEGER INFO, K, LDA, LWORK, M, N
139 COMPLEX*16 A( lda, * ), TAU( * ), WORK( * )
146 parameter ( zero = ( 0.0d+0, 0.0d+0 ) )
150 INTEGER I, IB, IINFO, IWS, J, KI, KK, L, LDWORK,
151 $ lwkopt, nb, nbmin, nx
168 nb = ilaenv( 1,
'ZUNGLQ',
' ', m, n, k, -1 )
169 lwkopt = max( 1, m )*nb
171 lquery = ( lwork.EQ.-1 )
174 ELSE IF( n.LT.m )
THEN
176 ELSE IF( k.LT.0 .OR. k.GT.m )
THEN
178 ELSE IF( lda.LT.max( 1, m ) )
THEN
180 ELSE IF( lwork.LT.max( 1, m ) .AND. .NOT.lquery )
THEN
184 CALL xerbla(
'ZUNGLQ', -info )
186 ELSE IF( lquery )
THEN
200 IF( nb.GT.1 .AND. nb.LT.k )
THEN
204 nx = max( 0, ilaenv( 3,
'ZUNGLQ',
' ', m, n, k, -1 ) )
211 IF( lwork.LT.iws )
THEN
217 nbmin = max( 2, ilaenv( 2,
'ZUNGLQ',
' ', m, n, k, -1 ) )
222 IF( nb.GE.nbmin .AND. nb.LT.k .AND. nx.LT.k )
THEN
227 ki = ( ( k-nx-1 ) / nb )*nb
244 $
CALL zungl2( m-kk, n-kk, k-kk, a( kk+1, kk+1 ), lda,
245 $ tau( kk+1 ), work, iinfo )
251 DO 50 i = ki + 1, 1, -nb
252 ib = min( nb, k-i+1 )
258 CALL zlarft(
'Forward',
'Rowwise', n-i+1, ib, a( i, i ),
259 $ lda, tau( i ), work, ldwork )
263 CALL zlarfb(
'Right',
'Conjugate transpose',
'Forward',
264 $
'Rowwise', m-i-ib+1, n-i+1, ib, a( i, i ),
265 $ lda, work, ldwork, a( i+ib, i ), lda,
266 $ work( ib+1 ), ldwork )
271 CALL zungl2( ib, n-i+1, ib, a( i, i ), lda, tau( i ), work,
277 DO 30 l = i, i + ib - 1
subroutine zunglq(M, N, K, A, LDA, TAU, WORK, LWORK, INFO)
ZUNGLQ
subroutine zungl2(M, N, K, A, LDA, TAU, WORK, INFO)
ZUNGL2 generates all or part of the unitary matrix Q from an LQ factorization determined by cgelqf (u...
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine zlarfb(SIDE, TRANS, DIRECT, STOREV, M, N, K, V, LDV, T, LDT, C, LDC, WORK, LDWORK)
ZLARFB applies a block reflector or its conjugate-transpose to a general rectangular matrix...
subroutine zlarft(DIRECT, STOREV, N, K, V, LDV, TAU, T, LDT)
ZLARFT forms the triangular factor T of a block reflector H = I - vtvH