154 SUBROUTINE zungbr( VECT, M, N, K, A, LDA, TAU, WORK, LWORK,
163 INTEGER INFO, K, LDA, LWORK, M, N
166 COMPLEX*16 A( LDA, * ), TAU( * ), WORK( * )
173 parameter( zero = ( 0.0d+0, 0.0d+0 ),
174 $ one = ( 1.0d+0, 0.0d+0 ) )
177 LOGICAL LQUERY, WANTQ
178 INTEGER I, IINFO, J, LWKOPT, MN
195 wantq = lsame( vect,
'Q' )
197 lquery = ( lwork.EQ.-1 )
198 IF( .NOT.wantq .AND. .NOT.lsame( vect,
'P' ) )
THEN
200 ELSE IF( m.LT.0 )
THEN
202 ELSE IF( n.LT.0 .OR. ( wantq .AND. ( n.GT.m .OR. n.LT.min( m,
203 $ k ) ) ) .OR. ( .NOT.wantq .AND. ( m.GT.n .OR. m.LT.
204 $ min( n, k ) ) ) )
THEN
206 ELSE IF( k.LT.0 )
THEN
208 ELSE IF( lda.LT.max( 1, m ) )
THEN
210 ELSE IF( lwork.LT.max( 1, mn ) .AND. .NOT.lquery )
THEN
218 CALL zungqr( m, n, k, a, lda, tau, work, -1, iinfo )
221 CALL zungqr( m-1, m-1, m-1, a, lda, tau, work, -1,
227 CALL zunglq( m, n, k, a, lda, tau, work, -1, iinfo )
230 CALL zunglq( n-1, n-1, n-1, a, lda, tau, work, -1,
235 lwkopt = int( dble( work( 1 ) ) )
236 lwkopt = max(lwkopt, mn)
240 CALL xerbla(
'ZUNGBR', -info )
242 ELSE IF( lquery )
THEN
249 IF( m.EQ.0 .OR. n.EQ.0 )
THEN
263 CALL zungqr( m, n, k, a, lda, tau, work, lwork, iinfo )
276 a( i, j ) = a( i, j-1 )
287 CALL zungqr( m-1, m-1, m-1, a( 2, 2 ), lda, tau, work,
300 CALL zunglq( m, n, k, a, lda, tau, work, lwork, iinfo )
315 DO 50 i = j - 1, 2, -1
316 a( i, j ) = a( i-1, j )
324 CALL zunglq( n-1, n-1, n-1, a( 2, 2 ), lda, tau, work,