158 SUBROUTINE cungbr( VECT, M, N, K, A, LDA, TAU, WORK, LWORK, INFO )
167 INTEGER info, k, lda, lwork, m, n
170 COMPLEX a( lda, * ), tau( * ), work( * )
177 parameter( zero = ( 0.0e+0, 0.0e+0 ),
178 $ one = ( 1.0e+0, 0.0e+0 ) )
181 LOGICAL lquery, wantq
182 INTEGER i, iinfo, j, lwkopt, mn
200 wantq =
lsame( vect,
'Q' )
202 lquery = ( lwork.EQ.-1 )
203 IF( .NOT.wantq .AND. .NOT.
lsame( vect,
'P' ) )
THEN
205 ELSE IF( m.LT.0 )
THEN
207 ELSE IF( n.LT.0 .OR. ( wantq .AND. ( n.GT.m .OR. n.LT.min( m,
208 $ k ) ) ) .OR. ( .NOT.wantq .AND. ( m.GT.n .OR. m.LT.
209 $ min( n, k ) ) ) )
THEN
211 ELSE IF( k.LT.0 )
THEN
213 ELSE IF( lda.LT.max( 1, m ) )
THEN
215 ELSE IF( lwork.LT.max( 1, mn ) .AND. .NOT.lquery )
THEN
223 CALL
cungqr( m, n, k, a, lda, tau, work, -1, iinfo )
226 CALL
cungqr( m-1, m-1, m-1, a( 2, 2 ), lda, tau, work,
232 CALL
cunglq( m, n, k, a, lda, tau, work, -1, iinfo )
235 CALL
cunglq( n-1, n-1, n-1, a( 2, 2 ), lda, tau, work,
241 lwkopt = max(lwkopt, mn)
245 CALL
xerbla(
'CUNGBR', -info )
247 ELSE IF( lquery )
THEN
254 IF( m.EQ.0 .OR. n.EQ.0 )
THEN
268 CALL
cungqr( m, n, k, a, lda, tau, work, lwork, iinfo )
281 a( i, j ) = a( i, j-1 )
292 CALL
cungqr( m-1, m-1, m-1, a( 2, 2 ), lda, tau, work,
305 CALL
cunglq( m, n, k, a, lda, tau, work, lwork, iinfo )
320 DO 50 i = j - 1, 2, -1
321 a( i, j ) = a( i-1, j )
329 CALL
cunglq( n-1, n-1, n-1, a( 2, 2 ), lda, tau, work,