177 SUBROUTINE zgetsqrhrt( M, N, MB1, NB1, NB2, A, LDA, T, LDT, WORK,
186 INTEGER INFO, LDA, LDT, LWORK, M, N, NB1, NB2, MB1
189 COMPLEX*16 A( LDA, * ), T( LDT, * ), WORK( * )
196 parameter( cone = ( 1.0d+0, 0.0d+0 ) )
200 INTEGER I, IINFO, J, LW1, LW2, LWT, LDWT, LWORKOPT,
201 $ nb1local, nb2local, num_all_row_blocks
208 INTRINSIC ceiling, dble, dcmplx, max, min
218 ELSE IF( n.LT.0 .OR. m.LT.n )
THEN
220 ELSE IF( mb1.LE.n )
THEN
222 ELSE IF( nb1.LT.1 )
THEN
224 ELSE IF( nb2.LT.1 )
THEN
226 ELSE IF( lda.LT.max( 1, m ) )
THEN
228 ELSE IF( ldt.LT.max( 1, min( nb2, n ) ) )
THEN
239 IF( lwork.LT.n*n+1 .AND. .NOT.lquery )
THEN
245 nb1local = min( nb1, n )
247 num_all_row_blocks = max( 1,
248 $ ceiling( dble( m - n ) / dble( mb1 - n ) ) )
253 lwt = num_all_row_blocks * n * nb1local
263 lw2 = nb1local * max( nb1local, ( n - nb1local ) )
265 lworkopt = max( lwt + lw1, max( lwt+n*n+lw2, lwt+n*n+n ) )
267 IF( ( lwork.LT.max( 1, lworkopt ) ).AND.(.NOT.lquery) )
THEN
277 CALL xerbla(
'ZGETSQRHRT', -info )
279 ELSE IF ( lquery )
THEN
280 work( 1 ) = dcmplx( lworkopt )
286 IF( min( m, n ).EQ.0 )
THEN
287 work( 1 ) = dcmplx( lworkopt )
291 nb2local = min( nb2, n )
296 CALL zlatsqr( m, n, mb1, nb1local, a, lda, work, ldwt,
297 $ work(lwt+1), lw1, iinfo )
304 CALL zcopy( j, a( 1, j ), 1, work( lwt + n*(j-1)+1 ), 1 )
311 CALL zungtsqr_row( m, n, mb1, nb1local, a, lda, work, ldwt,
312 $ work( lwt+n*n+1 ), lw2, iinfo )
317 CALL zunhr_col( m, n, nb2local, a, lda, t, ldt,
318 $ work( lwt+n*n+1 ), iinfo )
335 IF( work( lwt+n*n+i ).EQ.-cone )
THEN
337 a( i, j ) = -cone * work( lwt+n*(j-1)+i )
340 CALL zcopy( n-i+1, work(lwt+n*(i-1)+i), n, a( i, i ), lda )
344 work( 1 ) = dcmplx( lworkopt )
subroutine xerbla(srname, info)
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine zgetsqrhrt(m, n, mb1, nb1, nb2, a, lda, t, ldt, work, lwork, info)
ZGETSQRHRT
subroutine zlatsqr(m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
ZLATSQR
subroutine zungtsqr_row(m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
ZUNGTSQR_ROW
subroutine zunhr_col(m, n, nb, a, lda, t, ldt, d, info)
ZUNHR_COL