134 SUBROUTINE zqrt03( M, N, K, AF, C, CC, Q, LDA, TAU, WORK, LWORK,
142 INTEGER K, LDA, LWORK, M, N
145 DOUBLE PRECISION RESULT( * ), RWORK( * )
146 COMPLEX*16 AF( LDA, * ), C( LDA, * ), CC( LDA, * ),
147 $ q( lda, * ), tau( * ), work( lwork )
153 DOUBLE PRECISION ZERO, ONE
154 parameter( zero = 0.0d+0, one = 1.0d+0 )
156 parameter( rogue = ( -1.0d+10, -1.0d+10 ) )
159 CHARACTER SIDE, TRANS
160 INTEGER INFO, ISIDE, ITRANS, J, MC, NC
161 DOUBLE PRECISION CNORM, EPS, RESID
165 DOUBLE PRECISION DLAMCH, ZLANGE
166 EXTERNAL lsame, dlamch, zlange
175 INTRINSIC dble, dcmplx, max
181 COMMON / srnamc / srnamt
184 DATA iseed / 1988, 1989, 1990, 1991 /
188 eps = dlamch(
'Epsilon' )
192 CALL zlaset(
'Full', m, m, rogue, rogue, q, lda )
193 CALL zlacpy(
'Lower', m-1, k, af( 2, 1 ), lda, q( 2, 1 ), lda )
198 CALL zungqr( m, m, k, q, lda, tau, work, lwork, info )
201 IF( iside.EQ.1 )
THEN
214 CALL zlarnv( 2, iseed, mc, c( 1, j ) )
216 cnorm = zlange(
'1', mc, nc, c, lda, rwork )
221 IF( itrans.EQ.1 )
THEN
229 CALL zlacpy(
'Full', mc, nc, c, lda, cc, lda )
234 CALL zunmqr( side, trans, mc, nc, k, af, lda, tau, cc, lda,
235 $ work, lwork, info )
239 IF( lsame( side,
'L' ) )
THEN
240 CALL zgemm( trans,
'No transpose', mc, nc, mc,
241 $ dcmplx( -one ), q, lda, c, lda,
242 $ dcmplx( one ), cc, lda )
244 CALL zgemm(
'No transpose', trans, mc, nc, nc,
245 $ dcmplx( -one ), c, lda, q, lda,
246 $ dcmplx( one ), cc, lda )
251 resid = zlange(
'1', mc, nc, cc, lda, rwork )
252 result( ( iside-1 )*2+itrans ) = resid /
253 $ ( dble( max( 1, m ) )*cnorm*eps )
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zlarnv(idist, iseed, n, x)
ZLARNV returns a vector of random numbers from a uniform or normal distribution.
subroutine zlaset(uplo, m, n, alpha, beta, a, lda)
ZLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine zungqr(m, n, k, a, lda, tau, work, lwork, info)
ZUNGQR
subroutine zunmqr(side, trans, m, n, k, a, lda, tau, c, ldc, work, lwork, info)
ZUNMQR
subroutine zqrt03(m, n, k, af, c, cc, q, lda, tau, work, lwork, rwork, result)
ZQRT03