160 SUBROUTINE sgeqr( M, N, A, LDA, T, TSIZE, WORK, LWORK,
169 INTEGER INFO, LDA, M, N, TSIZE, LWORK
172 REAL A( lda, * ), T( * ), WORK( * )
179 LOGICAL LQUERY, LMINWS, MINT, MINW
180 INTEGER MB, NB, MINTSZ, NBLCKS
190 INTRINSIC max, min, mod
202 lquery = ( tsize.EQ.-1 .OR. tsize.EQ.-2 .OR.
203 $ lwork.EQ.-1 .OR. lwork.EQ.-2 )
207 IF( tsize.EQ.-2 .OR. lwork.EQ.-2 )
THEN
208 IF( tsize.NE.-1 ) mint = .true.
209 IF( lwork.NE.-1 ) minw = .true.
214 IF( min( m, n ).GT.0 )
THEN
215 mb = ilaenv( 1,
'SGEQR ',
' ', m, n, 1, -1 )
216 nb = ilaenv( 1,
'SGEQR ',
' ', m, n, 2, -1 )
221 IF( mb.GT.m .OR. mb.LE.n ) mb = m
222 IF( nb.GT.min( m, n ) .OR. nb.LT.1 ) nb = 1
224 IF ( mb.GT.n .AND. m.GT.n )
THEN
225 IF( mod( m - n, mb - n ).EQ.0 )
THEN
226 nblcks = ( m - n ) / ( mb - n )
228 nblcks = ( m - n ) / ( mb - n ) + 1
237 IF( ( tsize.LT.max( 1, nb*n*nblcks + 5 ) .OR. lwork.LT.nb*n )
238 $ .AND. ( lwork.GE.n ) .AND. ( tsize.GE.mintsz )
239 $ .AND. ( .NOT.lquery ) )
THEN
240 IF( tsize.LT.max( 1, nb*n*nblcks + 5 ) )
THEN
245 IF( lwork.LT.nb*n )
THEN
253 ELSE IF( n.LT.0 )
THEN
255 ELSE IF( lda.LT.max( 1, m ) )
THEN
257 ELSE IF( tsize.LT.max( 1, nb*n*nblcks + 5 )
258 $ .AND. ( .NOT.lquery ) .AND. ( .NOT.lminws ) )
THEN
260 ELSE IF( ( lwork.LT.max( 1, n*nb ) ) .AND. ( .NOT.lquery )
261 $ .AND. ( .NOT.lminws ) )
THEN
269 t( 1 ) = nb*n*nblcks + 5
274 work( 1 ) = max( 1, n )
276 work( 1 ) = max( 1, nb*n )
280 CALL xerbla(
'SGEQR', -info )
282 ELSE IF( lquery )
THEN
288 IF( min( m, n ).EQ.0 )
THEN
294 IF( ( m.LE.n ) .OR. ( mb.LE.n ) .OR. ( mb.GE.m ) )
THEN
295 CALL sgeqrt( m, n, nb, a, lda, t( 6 ), nb, work, info )
297 CALL slatsqr( m, n, mb, nb, a, lda, t( 6 ), nb, work,
301 work( 1 ) = max( 1, nb*n )
subroutine sgeqrt(M, N, NB, A, LDA, T, LDT, WORK, INFO)
SGEQRT
subroutine xerbla(SRNAME, INFO)
XERBLA
subroutine sgeqr(M, N, A, LDA, T, TSIZE, WORK, LWORK, INFO)
subroutine slatsqr(M, N, MB, NB, A, LDA, T, LDT, WORK, LWORK, INFO)