156 SUBROUTINE cungbr( VECT, M, N, K, A, LDA, TAU, WORK, LWORK, INFO )
164 INTEGER INFO, K, LDA, LWORK, M, N
167 COMPLEX A( LDA, * ), TAU( * ), WORK( * )
174 parameter( zero = ( 0.0e+0, 0.0e+0 ),
175 $ one = ( 1.0e+0, 0.0e+0 ) )
178 LOGICAL LQUERY, WANTQ
179 INTEGER I, IINFO, J, LWKOPT, MN
184 EXTERNAL lsame, sroundup_lwork
197 wantq = lsame( vect,
'Q' )
199 lquery = ( lwork.EQ.-1 )
200 IF( .NOT.wantq .AND. .NOT.lsame( vect,
'P' ) )
THEN
202 ELSE IF( m.LT.0 )
THEN
204 ELSE IF( n.LT.0 .OR. ( wantq .AND. ( n.GT.m .OR. n.LT.min( m,
205 $ k ) ) ) .OR. ( .NOT.wantq .AND. ( m.GT.n .OR. m.LT.
206 $ min( n, k ) ) ) )
THEN
208 ELSE IF( k.LT.0 )
THEN
210 ELSE IF( lda.LT.max( 1, m ) )
THEN
212 ELSE IF( lwork.LT.max( 1, mn ) .AND. .NOT.lquery )
THEN
220 CALL cungqr( m, n, k, a, lda, tau, work, -1, iinfo )
223 CALL cungqr( m-1, m-1, m-1, a, lda, tau, work, -1,
229 CALL cunglq( m, n, k, a, lda, tau, work, -1, iinfo )
232 CALL cunglq( n-1, n-1, n-1, a, lda, tau, work, -1,
237 lwkopt = int( work( 1 ) )
238 lwkopt = max(lwkopt, mn)
242 CALL xerbla(
'CUNGBR', -info )
244 ELSE IF( lquery )
THEN
245 work( 1 ) = sroundup_lwork(lwkopt)
251 IF( m.EQ.0 .OR. n.EQ.0 )
THEN
265 CALL cungqr( m, n, k, a, lda, tau, work, lwork, iinfo )
278 a( i, j ) = a( i, j-1 )
289 CALL cungqr( m-1, m-1, m-1, a( 2, 2 ), lda, tau, work,
302 CALL cunglq( m, n, k, a, lda, tau, work, lwork, iinfo )
317 DO 50 i = j - 1, 2, -1
318 a( i, j ) = a( i-1, j )
326 CALL cunglq( n-1, n-1, n-1, a( 2, 2 ), lda, tau, work,
331 work( 1 ) = sroundup_lwork(lwkopt)
subroutine xerbla(srname, info)
subroutine cungbr(vect, m, n, k, a, lda, tau, work, lwork, info)
CUNGBR
subroutine cunglq(m, n, k, a, lda, tau, work, lwork, info)
CUNGLQ
subroutine cungqr(m, n, k, a, lda, tau, work, lwork, info)
CUNGQR