188 INTEGER INFO, LDA, LDT, LWORK, M, N, NB1, NB2, MB1
191 REAL A( LDA, * ), T( LDT, * ), WORK( * )
198 PARAMETER ( ONE = 1.0e+0 )
202 INTEGER I, IINFO, J, LW1, LW2, LWT, LDWT, LWORKOPT,
203 $ nb1local, nb2local, num_all_row_blocks
207 EXTERNAL SROUNDUP_LWORK
215 INTRINSIC ceiling, max, min
222 lquery = ( lwork.EQ.-1 )
225 ELSE IF( n.LT.0 .OR. m.LT.n )
THEN
227 ELSE IF( mb1.LE.n )
THEN
229 ELSE IF( nb1.LT.1 )
THEN
231 ELSE IF( nb2.LT.1 )
THEN
233 ELSE IF( lda.LT.max( 1, m ) )
THEN
235 ELSE IF( ldt.LT.max( 1, min( nb2, n ) ) )
THEN
246 IF( lwork.LT.n*n+1 .AND. .NOT.lquery )
THEN
252 nb1local = min( nb1, n )
254 num_all_row_blocks = max( 1,
255 $ ceiling( real( m - n ) / real( mb1 - n ) ) )
260 lwt = num_all_row_blocks * n * nb1local
270 lw2 = nb1local * max( nb1local, ( n - nb1local ) )
272 lworkopt = max( lwt + lw1, max( lwt+n*n+lw2, lwt+n*n+n ) )
273 lworkopt = max( 1, lworkopt )
275 IF( lwork.LT.lworkopt .AND. .NOT.lquery )
THEN
285 CALL xerbla(
'SGETSQRHRT', -info )
287 ELSE IF ( lquery )
THEN
288 work( 1 ) = sroundup_lwork( lworkopt )
294 IF( min( m, n ).EQ.0 )
THEN
295 work( 1 ) = sroundup_lwork( lworkopt )
299 nb2local = min( nb2, n )
304 CALL slatsqr( m, n, mb1, nb1local, a, lda, work, ldwt,
305 $ work(lwt+1), lw1, iinfo )
312 CALL scopy( j, a( 1, j ), 1, work( lwt + n*(j-1)+1 ), 1 )
319 CALL sorgtsqr_row( m, n, mb1, nb1local, a, lda, work, ldwt,
320 $ work( lwt+n*n+1 ), lw2, iinfo )
325 CALL sorhr_col( m, n, nb2local, a, lda, t, ldt,
326 $ work( lwt+n*n+1 ), iinfo )
343 IF( work( lwt+n*n+i ).EQ.-one )
THEN
345 a( i, j ) = -one * work( lwt+n*(j-1)+i )
348 CALL scopy( n-i+1, work(lwt+n*(i-1)+i), n, a( i, i ),
353 work( 1 ) = sroundup_lwork( lworkopt )
subroutine sgetsqrhrt(m, n, mb1, nb1, nb2, a, lda, t, ldt, work, lwork, info)
SGETSQRHRT