136 SUBROUTINE cqlt03( M, N, K, AF, C, CC, Q, LDA, TAU, WORK, LWORK,
145 INTEGER k, lda, lwork, m, n
148 REAL result( * ), rwork( * )
149 COMPLEX af( lda, * ), c( lda, * ), cc( lda, * ),
150 $ q( lda, * ), tau( * ), work( lwork )
157 parameter( zero = 0.0e+0, one = 1.0e+0 )
159 parameter( rogue = ( -1.0e+10, -1.0e+10 ) )
162 CHARACTER side, trans
163 INTEGER info, iside, itrans, j, mc, minmn, nc
164 REAL cnorm, eps, resid
178 INTRINSIC cmplx, max, min, real
184 common / srnamc / srnamt
187 DATA iseed / 1988, 1989, 1990, 1991 /
196 IF( minmn.EQ.0 )
THEN
206 CALL
claset(
'Full', m, m, rogue, rogue, q, lda )
207 IF( k.GT.0 .AND. m.GT.k )
208 $ CALL
clacpy(
'Full', m-k, k, af( 1, n-k+1 ), lda,
209 $ q( 1, m-k+1 ), lda )
211 $ CALL
clacpy(
'Upper', k-1, k-1, af( m-k+1, n-k+2 ), lda,
212 $ q( m-k+1, m-k+2 ), lda )
217 CALL
cungql( m, m, k, q, lda, tau( minmn-k+1 ), work, lwork,
221 IF( iside.EQ.1 )
THEN
234 CALL
clarnv( 2, iseed, mc, c( 1, j ) )
236 cnorm =
clange(
'1', mc, nc, c, lda, rwork )
241 IF( itrans.EQ.1 )
THEN
249 CALL
clacpy(
'Full', mc, nc, c, lda, cc, lda )
255 $ CALL
cunmql( side, trans, mc, nc, k, af( 1, n-k+1 ),
256 $ lda, tau( minmn-k+1 ), cc, lda, work,
261 IF(
lsame( side,
'L' ) )
THEN
262 CALL
cgemm( trans,
'No transpose', mc, nc, mc,
263 $ cmplx( -one ), q, lda, c, lda, cmplx( one ),
266 CALL
cgemm(
'No transpose', trans, mc, nc, nc,
267 $ cmplx( -one ), c, lda, q, lda, cmplx( one ),
273 resid =
clange(
'1', mc, nc, cc, lda, rwork )
274 result( ( iside-1 )*2+itrans ) = resid /
275 $ (
REAL( MAX( 1, M ) )*cnorm*eps )