215 SUBROUTINE cggqrf( N, M, P, A, LDA, TAUA, B, LDB, TAUB, WORK,
224 INTEGER info, lda, ldb, lwork, m, n, p
227 COMPLEX a( lda, * ), b( ldb, * ), taua( * ), taub( * ),
235 INTEGER lopt, lwkopt, nb, nb1, nb2, nb3
245 INTRINSIC int, max, min
252 nb1 =
ilaenv( 1,
'CGEQRF',
' ', n, m, -1, -1 )
253 nb2 =
ilaenv( 1,
'CGERQF',
' ', n, p, -1, -1 )
254 nb3 =
ilaenv( 1,
'CUNMQR',
' ', n, m, p, -1 )
255 nb = max( nb1, nb2, nb3 )
256 lwkopt = max( n, m, p)*nb
258 lquery = ( lwork.EQ.-1 )
261 ELSE IF( m.LT.0 )
THEN
263 ELSE IF( p.LT.0 )
THEN
265 ELSE IF( lda.LT.max( 1, n ) )
THEN
267 ELSE IF( ldb.LT.max( 1, n ) )
THEN
269 ELSE IF( lwork.LT.max( 1, n, m, p ) .AND. .NOT.lquery )
THEN
273 CALL
xerbla(
'CGGQRF', -info )
275 ELSE IF( lquery )
THEN
281 CALL
cgeqrf( n, m, a, lda, taua, work, lwork, info )
286 CALL
cunmqr(
'Left',
'Conjugate Transpose', n, p, min( n, m ), a,
287 $ lda, taua, b, ldb, work, lwork, info )
288 lopt = max( lopt, int( work( 1 ) ) )
292 CALL
cgerqf( n, p, b, ldb, taub, work, lwork, info )
293 work( 1 ) = max( lopt, int( work( 1 ) ) )