177 SUBROUTINE sgetsqrhrt( M, N, MB1, NB1, NB2, A, LDA, T, LDT, WORK,
186 INTEGER INFO, LDA, LDT, LWORK, M, N, NB1, NB2, MB1
189 REAL A( LDA, * ), T( LDT, * ), WORK( * )
196 parameter( one = 1.0e+0 )
200 INTEGER I, IINFO, J, LW1, LW2, LWT, LDWT, LWORKOPT,
201 $ nb1local, nb2local, num_all_row_blocks
205 EXTERNAL sroundup_lwork
212 INTRINSIC ceiling, max, min
222 ELSE IF( n.LT.0 .OR. m.LT.n )
THEN
224 ELSE IF( mb1.LE.n )
THEN
226 ELSE IF( nb1.LT.1 )
THEN
228 ELSE IF( nb2.LT.1 )
THEN
230 ELSE IF( lda.LT.max( 1, m ) )
THEN
232 ELSE IF( ldt.LT.max( 1, min( nb2, n ) ) )
THEN
243 IF( lwork.LT.n*n+1 .AND. .NOT.lquery )
THEN
249 nb1local = min( nb1, n )
251 num_all_row_blocks = max( 1,
252 $ ceiling( real( m - n ) / real( mb1 - n ) ) )
257 lwt = num_all_row_blocks * n * nb1local
267 lw2 = nb1local * max( nb1local, ( n - nb1local ) )
269 lworkopt = max( lwt + lw1, max( lwt+n*n+lw2, lwt+n*n+n ) )
271 IF( ( lwork.LT.max( 1, lworkopt ) ).AND.(.NOT.lquery) )
THEN
281 CALL xerbla(
'SGETSQRHRT', -info )
283 ELSE IF ( lquery )
THEN
284 work( 1 ) = sroundup_lwork( lworkopt )
290 IF( min( m, n ).EQ.0 )
THEN
291 work( 1 ) = sroundup_lwork( lworkopt )
295 nb2local = min( nb2, n )
300 CALL slatsqr( m, n, mb1, nb1local, a, lda, work, ldwt,
301 $ work(lwt+1), lw1, iinfo )
308 CALL scopy( j, a( 1, j ), 1, work( lwt + n*(j-1)+1 ), 1 )
315 CALL sorgtsqr_row( m, n, mb1, nb1local, a, lda, work, ldwt,
316 $ work( lwt+n*n+1 ), lw2, iinfo )
321 CALL sorhr_col( m, n, nb2local, a, lda, t, ldt,
322 $ work( lwt+n*n+1 ), iinfo )
339 IF( work( lwt+n*n+i ).EQ.-one )
THEN
341 a( i, j ) = -one * work( lwt+n*(j-1)+i )
344 CALL scopy( n-i+1, work(lwt+n*(i-1)+i), n, a( i, i ), lda )
348 work( 1 ) = sroundup_lwork( lworkopt )
subroutine xerbla(srname, info)
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine sgetsqrhrt(m, n, mb1, nb1, nb2, a, lda, t, ldt, work, lwork, info)
SGETSQRHRT
subroutine slatsqr(m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
SLATSQR
subroutine sorgtsqr_row(m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
SORGTSQR_ROW
subroutine sorhr_col(m, n, nb, a, lda, t, ldt, d, info)
SORHR_COL