213 SUBROUTINE sggqrf( N, M, P, A, LDA, TAUA, B, LDB, TAUB, WORK,
221 INTEGER INFO, LDA, LDB, LWORK, M, N, P
224 REAL A( LDA, * ), B( LDB, * ), TAUA( * ), TAUB( * ),
232 INTEGER LOPT, LWKOPT, NB, NB1, NB2, NB3
240 EXTERNAL ilaenv, sroundup_lwork
243 INTRINSIC int, max, min
250 nb1 = ilaenv( 1,
'SGEQRF',
' ', n, m, -1, -1 )
251 nb2 = ilaenv( 1,
'SGERQF',
' ', n, p, -1, -1 )
252 nb3 = ilaenv( 1,
'SORMQR',
' ', n, m, p, -1 )
253 nb = max( nb1, nb2, nb3 )
254 lwkopt = max( n, m, p )*nb
255 work( 1 ) = sroundup_lwork(lwkopt)
256 lquery = ( lwork.EQ.-1 )
259 ELSE IF( m.LT.0 )
THEN
261 ELSE IF( p.LT.0 )
THEN
263 ELSE IF( lda.LT.max( 1, n ) )
THEN
265 ELSE IF( ldb.LT.max( 1, n ) )
THEN
267 ELSE IF( lwork.LT.max( 1, n, m, p ) .AND. .NOT.lquery )
THEN
271 CALL xerbla(
'SGGQRF', -info )
273 ELSE IF( lquery )
THEN
279 CALL sgeqrf( n, m, a, lda, taua, work, lwork, info )
280 lopt = int( work( 1 ) )
284 CALL sormqr(
'Left',
'Transpose', n, p, min( n, m ), a, lda, taua,
285 $ b, ldb, work, lwork, info )
286 lopt = max( lopt, int( work( 1 ) ) )
290 CALL sgerqf( n, p, b, ldb, taub, work, lwork, info )
291 lwkopt = max( lopt, int( work( 1 ) ) )
292 work( 1 ) = sroundup_lwork( lwkopt )
subroutine xerbla(srname, info)
subroutine sgeqrf(m, n, a, lda, tau, work, lwork, info)
SGEQRF
subroutine sgerqf(m, n, a, lda, tau, work, lwork, info)
SGERQF
subroutine sggqrf(n, m, p, a, lda, taua, b, ldb, taub, work, lwork, info)
SGGQRF
subroutine sormqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
SORMQR