154 SUBROUTINE dorgbr( VECT, M, N, K, A, LDA, TAU, WORK, LWORK,
163 INTEGER INFO, K, LDA, LWORK, M, N
166 DOUBLE PRECISION A( LDA, * ), TAU( * ), WORK( * )
172 DOUBLE PRECISION ZERO, ONE
173 parameter( zero = 0.0d+0, one = 1.0d+0 )
176 LOGICAL LQUERY, WANTQ
177 INTEGER I, IINFO, J, LWKOPT, MN
194 wantq = lsame( vect,
'Q' )
196 lquery = ( lwork.EQ.-1 )
197 IF( .NOT.wantq .AND. .NOT.lsame( vect,
'P' ) )
THEN
199 ELSE IF( m.LT.0 )
THEN
201 ELSE IF( n.LT.0 .OR. ( wantq .AND. ( n.GT.m .OR. n.LT.min( m,
202 $ k ) ) ) .OR. ( .NOT.wantq .AND. ( m.GT.n .OR. m.LT.
203 $ min( n, k ) ) ) )
THEN
205 ELSE IF( k.LT.0 )
THEN
207 ELSE IF( lda.LT.max( 1, m ) )
THEN
209 ELSE IF( lwork.LT.max( 1, mn ) .AND. .NOT.lquery )
THEN
217 CALL dorgqr( m, n, k, a, lda, tau, work, -1, iinfo )
220 CALL dorgqr( m-1, m-1, m-1, a, lda, tau, work, -1,
226 CALL dorglq( m, n, k, a, lda, tau, work, -1, iinfo )
229 CALL dorglq( n-1, n-1, n-1, a, lda, tau, work, -1,
234 lwkopt = int( work( 1 ) )
235 lwkopt = max(lwkopt, mn)
239 CALL xerbla(
'DORGBR', -info )
241 ELSE IF( lquery )
THEN
248 IF( m.EQ.0 .OR. n.EQ.0 )
THEN
262 CALL dorgqr( m, n, k, a, lda, tau, work, lwork, iinfo )
275 a( i, j ) = a( i, j-1 )
286 CALL dorgqr( m-1, m-1, m-1, a( 2, 2 ), lda, tau, work,
299 CALL dorglq( m, n, k, a, lda, tau, work, lwork, iinfo )
314 DO 50 i = j - 1, 2, -1
315 a( i, j ) = a( i-1, j )
323 CALL dorglq( n-1, n-1, n-1, a( 2, 2 ), lda, tau, work,
subroutine dorgbr(vect, m, n, k, a, lda, tau, work, lwork, info)
DORGBR