172 SUBROUTINE sgelq( M, N, A, LDA, T, TSIZE, WORK, LWORK,
180 INTEGER INFO, LDA, M, N, TSIZE, LWORK
183 REAL A( LDA, * ), T( * ), WORK( * )
190 LOGICAL LQUERY, LMINWS, MINT, MINW
191 INTEGER MB, NB, MINTSZ, NBLCKS, LWMIN, LWOPT, LWREQ
196 EXTERNAL lsame, sroundup_lwork
202 INTRINSIC max, min, mod
214 lquery = ( tsize.EQ.-1 .OR. tsize.EQ.-2 .OR.
215 $ lwork.EQ.-1 .OR. lwork.EQ.-2 )
219 IF( tsize.EQ.-2 .OR. lwork.EQ.-2 )
THEN
220 IF( tsize.NE.-1 ) mint = .true.
221 IF( lwork.NE.-1 ) minw = .true.
226 IF( min( m, n ).GT.0 )
THEN
227 mb = ilaenv( 1,
'SGELQ ',
' ', m, n, 1, -1 )
228 nb = ilaenv( 1,
'SGELQ ',
' ', m, n, 2, -1 )
233 IF( mb.GT.min( m, n ) .OR. mb.LT.1 ) mb = 1
234 IF( nb.GT.n .OR. nb.LE.m ) nb = n
236 IF ( nb.GT.m .AND. n.GT.m )
THEN
237 IF( mod( n - m, nb - m ).EQ.0 )
THEN
238 nblcks = ( n - m ) / ( nb - m )
240 nblcks = ( n - m ) / ( nb - m ) + 1
248 IF( ( n.LE.m ) .OR. ( nb.LE.m ) .OR. ( nb.GE.n ) )
THEN
250 lwopt = max( 1, mb*n )
253 lwopt = max( 1, mb*m )
256 IF( ( tsize.LT.max( 1, mb*m*nblcks + 5 ) .OR. lwork.LT.lwopt )
257 $ .AND. ( lwork.GE.lwmin ) .AND. ( tsize.GE.mintsz )
258 $ .AND. ( .NOT.lquery ) )
THEN
259 IF( tsize.LT.max( 1, mb*m*nblcks + 5 ) )
THEN
264 IF( lwork.LT.lwopt )
THEN
269 IF( ( n.LE.m ) .OR. ( nb.LE.m ) .OR. ( nb.GE.n ) )
THEN
270 lwreq = max( 1, mb*n )
272 lwreq = max( 1, mb*m )
277 ELSE IF( n.LT.0 )
THEN
279 ELSE IF( lda.LT.max( 1, m ) )
THEN
281 ELSE IF( tsize.LT.max( 1, mb*m*nblcks + 5 )
282 $ .AND. ( .NOT.lquery ) .AND. ( .NOT.lminws ) )
THEN
284 ELSE IF( ( lwork.LT.lwreq ) .and .( .NOT.lquery )
285 $ .AND. ( .NOT.lminws ) )
THEN
293 t( 1 ) = mb*m*nblcks + 5
298 work( 1 ) = sroundup_lwork(lwmin)
300 work( 1 ) = sroundup_lwork(lwreq)
304 CALL xerbla(
'SGELQ', -info )
306 ELSE IF( lquery )
THEN
312 IF( min( m, n ).EQ.0 )
THEN
318 IF( ( n.LE.m ) .OR. ( nb.LE.m ) .OR. ( nb.GE.n ) )
THEN
319 CALL sgelqt( m, n, mb, a, lda, t( 6 ), mb, work, info )
321 CALL slaswlq( m, n, mb, nb, a, lda, t( 6 ), mb, work,
325 work( 1 ) = sroundup_lwork(lwreq)
subroutine xerbla(srname, info)
subroutine sgelq(m, n, a, lda, t, tsize, work, lwork, info)
SGELQ
subroutine sgelqt(m, n, mb, a, lda, t, ldt, work, info)
SGELQT
subroutine slaswlq(m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
SLASWLQ