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, LWMIN, LWREQ
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 lwreq = max( 1, n*nb )
252 IF( ( tsize.LT.max( 1, nb*n*nblcks + 5 ) .OR. lwork.LT.lwreq )
253 $ .AND. ( lwork.GE.n ) .AND. ( tsize.GE.mintsz )
254 $ .AND. ( .NOT.lquery ) )
THEN
255 IF( tsize.LT.max( 1, nb*n*nblcks + 5 ) )
THEN
260 IF( lwork.LT.lwreq )
THEN
268 ELSE IF( n.LT.0 )
THEN
270 ELSE IF( lda.LT.max( 1, m ) )
THEN
272 ELSE IF( tsize.LT.max( 1, nb*n*nblcks + 5 )
273 $ .AND. ( .NOT.lquery ) .AND. ( .NOT.lminws ) )
THEN
275 ELSE IF( ( lwork.LT.lwreq ) .AND. ( .NOT.lquery )
276 $ .AND. ( .NOT.lminws ) )
THEN
284 t( 1 ) = nb*n*nblcks + 5
295 CALL xerbla(
'DGEQR', -info )
297 ELSE IF( lquery )
THEN
303 IF( min( m, n ).EQ.0 )
THEN
309 IF( ( m.LE.n ) .OR. ( mb.LE.n ) .OR. ( mb.GE.m ) )
THEN
310 CALL dgeqrt( m, n, nb, a, lda, t( 6 ), nb, work, info )
312 CALL dlatsqr( m, n, mb, nb, a, lda, t( 6 ), nb, work,
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