177 SUBROUTINE cgetsqrhrt( M, N, MB1, NB1, NB2, A, LDA, T, LDT, WORK,
186 INTEGER INFO, LDA, LDT, LWORK, M, N, NB1, NB2, MB1
189 COMPLEX A( LDA, * ), T( LDT, * ), WORK( * )
196 parameter( cone = ( 1.0e+0, 0.0e+0 ) )
200 INTEGER I, IINFO, J, LW1, LW2, LWT, LDWT, LWORKOPT,
201 $ nb1local, nb2local, num_all_row_blocks
208 INTRINSIC ceiling, real, cmplx, 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( real( m - n ) / real( 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(
'CGETSQRHRT', -info )
279 ELSE IF ( lquery )
THEN
280 work( 1 ) = cmplx( lworkopt )
286 IF( min( m, n ).EQ.0 )
THEN
287 work( 1 ) = cmplx( lworkopt )
291 nb2local = min( nb2, n )
296 CALL clatsqr( m, n, mb1, nb1local, a, lda, work, ldwt,
297 $ work(lwt+1), lw1, iinfo )
304 CALL ccopy( j, a( 1, j ), 1, work( lwt + n*(j-1)+1 ), 1 )
311 CALL cungtsqr_row( m, n, mb1, nb1local, a, lda, work, ldwt,
312 $ work( lwt+n*n+1 ), lw2, iinfo )
317 CALL cunhr_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 ccopy( n-i+1, work(lwt+n*(i-1)+i), n, a( i, i ), lda )
344 work( 1 ) = cmplx( lworkopt )
subroutine xerbla(srname, info)
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine cgetsqrhrt(m, n, mb1, nb1, nb2, a, lda, t, ldt, work, lwork, info)
CGETSQRHRT
subroutine clatsqr(m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
CLATSQR
subroutine cungtsqr_row(m, n, mb, nb, a, lda, t, ldt, work, lwork, info)
CUNGTSQR_ROW
subroutine cunhr_col(m, n, nb, a, lda, t, ldt, d, info)
CUNHR_COL