124 SUBROUTINE cungtr( UPLO, N, A, LDA, TAU, WORK, LWORK, INFO )
133 INTEGER info, lda, lwork, n
136 COMPLEX a( lda, * ), tau( * ), work( * )
143 parameter( zero = ( 0.0e+0, 0.0e+0 ),
144 $ one = ( 1.0e+0, 0.0e+0 ) )
147 LOGICAL lquery, upper
148 INTEGER i, iinfo, j, lwkopt, nb
166 lquery = ( lwork.EQ.-1 )
167 upper =
lsame( uplo,
'U' )
168 IF( .NOT.upper .AND. .NOT.
lsame( uplo,
'L' ) )
THEN
170 ELSE IF( n.LT.0 )
THEN
172 ELSE IF( lda.LT.max( 1, n ) )
THEN
174 ELSE IF( lwork.LT.max( 1, n-1 ) .AND. .NOT.lquery )
THEN
180 nb =
ilaenv( 1,
'CUNGQL',
' ', n-1, n-1, n-1, -1 )
182 nb =
ilaenv( 1,
'CUNGQR',
' ', n-1, n-1, n-1, -1 )
184 lwkopt = max( 1, n-1 )*nb
189 CALL
xerbla(
'CUNGTR', -info )
191 ELSE IF( lquery )
THEN
212 a( i, j ) = a( i, j+1 )
223 CALL
cungql( n-1, n-1, n-1, a, lda, tau, work, lwork, iinfo )
236 a( i, j ) = a( i, j-1 )
247 CALL
cungqr( n-1, n-1, n-1, a( 2, 2 ), lda, tau, work,