133 SUBROUTINE cqrt02( M, N, K, A, AF, Q, R, LDA, TAU, WORK, LWORK,
141 INTEGER K, LDA, LWORK, M, N
144 REAL RESULT( * ), RWORK( * )
145 COMPLEX A( LDA, * ), AF( LDA, * ), Q( LDA, * ),
146 $ r( lda, * ), tau( * ), work( lwork )
153 parameter( zero = 0.0e+0, one = 1.0e+0 )
155 parameter( rogue = ( -1.0e+10, -1.0e+10 ) )
159 REAL ANORM, EPS, RESID
162 REAL CLANGE, CLANSY, SLAMCH
163 EXTERNAL clange, clansy, slamch
169 INTRINSIC cmplx, max, real
175 COMMON / srnamc / srnamt
179 eps = slamch(
'Epsilon' )
183 CALL claset(
'Full', m, n, rogue, rogue, q, lda )
184 CALL clacpy(
'Lower', m-1, k, af( 2, 1 ), lda, q( 2, 1 ), lda )
189 CALL cungqr( m, n, k, q, lda, tau, work, lwork, info )
193 CALL claset(
'Full', n, k, cmplx( zero ), cmplx( zero ), r, lda )
194 CALL clacpy(
'Upper', n, k, af, lda, r, lda )
198 CALL cgemm(
'Conjugate transpose',
'No transpose', n, k, m,
199 $ cmplx( -one ), q, lda, a, lda, cmplx( one ), r, lda )
203 anorm = clange(
'1', m, k, a, lda, rwork )
204 resid = clange(
'1', n, k, r, lda, rwork )
205 IF( anorm.GT.zero )
THEN
206 result( 1 ) = ( ( resid / real( max( 1, m ) ) ) / anorm ) / eps
213 CALL claset(
'Full', n, n, cmplx( zero ), cmplx( one ), r, lda )
214 CALL cherk(
'Upper',
'Conjugate transpose', n, m, -one, q, lda,
219 resid = clansy(
'1',
'Upper', n, r, lda, rwork )
221 result( 2 ) = ( resid / real( max( 1, m ) ) ) / eps
subroutine cqrt02(m, n, k, a, af, q, r, lda, tau, work, lwork, rwork, result)
CQRT02
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine cherk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
CHERK
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.
subroutine claset(uplo, m, n, alpha, beta, a, lda)
CLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine cungqr(m, n, k, a, lda, tau, work, lwork, info)
CUNGQR