174 SUBROUTINE dgeqr( M, N, A, LDA, T, TSIZE, WORK, LWORK,
182 INTEGER INFO, LDA, M, N, TSIZE, LWORK
185 DOUBLE PRECISION A( LDA, * ), T( * ), WORK( * )
192 LOGICAL LQUERY, LMINWS, MINT, MINW
193 INTEGER MB, NB, MINTSZ, NBLCKS
203 INTRINSIC max, min, mod
215 lquery = ( tsize.EQ.-1 .OR. tsize.EQ.-2 .OR.
216 $ lwork.EQ.-1 .OR. lwork.EQ.-2 )
220 IF( tsize.EQ.-2 .OR. lwork.EQ.-2 )
THEN
221 IF( tsize.NE.-1 ) mint = .true.
222 IF( lwork.NE.-1 ) minw = .true.
227 IF( min( m, n ).GT.0 )
THEN
228 mb = ilaenv( 1,
'DGEQR ',
' ', m, n, 1, -1 )
229 nb = ilaenv( 1,
'DGEQR ',
' ', m, n, 2, -1 )
234 IF( mb.GT.m .OR. mb.LE.n ) mb = m
235 IF( nb.GT.min( m, n ) .OR. nb.LT.1 ) nb = 1
237 IF( mb.GT.n .AND. m.GT.n )
THEN
238 IF( mod( m - n, mb - n ).EQ.0 )
THEN
239 nblcks = ( m - n ) / ( mb - n )
241 nblcks = ( m - n ) / ( mb - n ) + 1
250 IF( ( tsize.LT.max( 1, nb*n*nblcks + 5 ) .OR. lwork.LT.nb*n )
251 $ .AND. ( lwork.GE.n ) .AND. ( tsize.GE.mintsz )
252 $ .AND. ( .NOT.lquery ) )
THEN
253 IF( tsize.LT.max( 1, nb*n*nblcks + 5 ) )
THEN
258 IF( lwork.LT.nb*n )
THEN
266 ELSE IF( n.LT.0 )
THEN
268 ELSE IF( lda.LT.max( 1, m ) )
THEN
270 ELSE IF( tsize.LT.max( 1, nb*n*nblcks + 5 )
271 $ .AND. ( .NOT.lquery ) .AND. ( .NOT.lminws ) )
THEN
273 ELSE IF( ( lwork.LT.max( 1, n*nb ) ) .AND. ( .NOT.lquery )
274 $ .AND. ( .NOT.lminws ) )
THEN
282 t( 1 ) = nb*n*nblcks + 5
287 work( 1 ) = max( 1, n )
289 work( 1 ) = max( 1, nb*n )
293 CALL xerbla(
'DGEQR', -info )
295 ELSE IF( lquery )
THEN
301 IF( min( m, n ).EQ.0 )
THEN
307 IF( ( m.LE.n ) .OR. ( mb.LE.n ) .OR. ( mb.GE.m ) )
THEN
308 CALL dgeqrt( m, n, nb, a, lda, t( 6 ), nb, work, info )
310 CALL dlatsqr( m, n, mb, nb, a, lda, t( 6 ), nb, work,
314 work( 1 ) = max( 1, nb*n )
subroutine xerbla(srname, info)
subroutine dgeqr(m, n, a, lda, t, tsize, work, lwork, info)
DGEQR
subroutine dgeqrt(m, n, nb, a, lda, t, ldt, work, info)
DGEQRT
subroutine dlatsqr(m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
DLATSQR