159 SUBROUTINE zgelq( M, N, A, LDA, T, TSIZE, WORK, LWORK,
168 INTEGER INFO, LDA, M, N, TSIZE, LWORK
171 COMPLEX*16 A( lda, * ), T( * ), WORK( * )
178 LOGICAL LQUERY, LMINWS, MINT, MINW
179 INTEGER MB, NB, MINTSZ, NBLCKS
189 INTRINSIC max, min, mod
201 lquery = ( tsize.EQ.-1 .OR. tsize.EQ.-2 .OR.
202 $ lwork.EQ.-1 .OR. lwork.EQ.-2 )
206 IF( tsize.EQ.-2 .OR. lwork.EQ.-2 )
THEN
207 IF( tsize.NE.-1 ) mint = .true.
208 IF( lwork.NE.-1 ) minw = .true.
213 IF( min( m, n ).GT.0 )
THEN
214 mb = ilaenv( 1,
'ZGELQ ',
' ', m, n, 1, -1 )
215 nb = ilaenv( 1,
'ZGELQ ',
' ', m, n, 2, -1 )
220 IF( mb.GT.min( m, n ) .OR. mb.LT.1 ) mb = 1
221 IF( nb.GT.n .OR. nb.LE.m ) nb = n
223 IF ( nb.GT.m .AND. n.GT.m )
THEN
224 IF( mod( n - m, nb - m ).EQ.0 )
THEN
225 nblcks = ( n - m ) / ( nb - m )
227 nblcks = ( n - m ) / ( nb - m ) + 1
236 IF( ( tsize.LT.max( 1, mb*m*nblcks + 5 ) .OR. lwork.LT.mb*m )
237 $ .AND. ( lwork.GE.m ) .AND. ( tsize.GE.mintsz )
238 $ .AND. ( .NOT.lquery ) )
THEN
239 IF( tsize.LT.max( 1, mb*m*nblcks + 5 ) )
THEN
244 IF( lwork.LT.mb*m )
THEN
252 ELSE IF( n.LT.0 )
THEN
254 ELSE IF( lda.LT.max( 1, m ) )
THEN
256 ELSE IF( tsize.LT.max( 1, mb*m*nblcks + 5 )
257 $ .AND. ( .NOT.lquery ) .AND. ( .NOT.lminws ) )
THEN
259 ELSE IF( ( lwork.LT.max( 1, m*mb ) ) .and .( .NOT.lquery )
260 $ .AND. ( .NOT.lminws ) )
THEN
268 t( 1 ) = mb*m*nblcks + 5
273 work( 1 ) = max( 1, n )
275 work( 1 ) = max( 1, mb*m )
279 CALL xerbla(
'ZGELQ', -info )
281 ELSE IF( lquery )
THEN
287 IF( min( m, n ).EQ.0 )
THEN
293 IF( ( n.LE.m ) .OR. ( nb.LE.m ) .OR. ( nb.GE.n ) )
THEN
294 CALL zgelqt( m, n, mb, a, lda, t( 6 ), mb, work, info )
296 CALL zlaswlq( m, n, mb, nb, a, lda, t( 6 ), mb, work,
300 work( 1 ) = max( 1, mb*m )
subroutine zgelqt(M, N, MB, A, LDA, T, LDT, WORK, INFO)
ZGELQT
subroutine zlaswlq(M, N, MB, NB, A, LDA, T, LDT, WORK, LWORK, INFO)
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine zgelq(M, N, A, LDA, T, TSIZE, WORK, LWORK, INFO)