124 SUBROUTINE cqrt01( M, N, A, AF, Q, R, LDA, TAU, WORK, LWORK,
132 INTEGER LDA, LWORK, M, N
135 REAL RESULT( * ), RWORK( * )
136 COMPLEX A( LDA, * ), AF( LDA, * ), Q( LDA, * ),
137 $ r( lda, * ), tau( * ), work( lwork )
144 parameter( zero = 0.0e+0, one = 1.0e+0 )
146 parameter( rogue = ( -1.0e+10, -1.0e+10 ) )
150 REAL ANORM, EPS, RESID
153 REAL CLANGE, CLANSY, SLAMCH
154 EXTERNAL clange, clansy, slamch
160 INTRINSIC cmplx, max, min, real
166 COMMON / srnamc / srnamt
171 eps = slamch(
'Epsilon' )
175 CALL clacpy(
'Full', m, n, a, lda, af, lda )
180 CALL cgeqrf( m, n, af, lda, tau, work, lwork, info )
184 CALL claset(
'Full', m, m, rogue, rogue, q, lda )
185 CALL clacpy(
'Lower', m-1, n, af( 2, 1 ), lda, q( 2, 1 ), lda )
190 CALL cungqr( m, m, minmn, q, lda, tau, work, lwork, info )
194 CALL claset(
'Full', m, n, cmplx( zero ), cmplx( zero ), r, lda )
195 CALL clacpy(
'Upper', m, n, af, lda, r, lda )
199 CALL cgemm(
'Conjugate transpose',
'No transpose', m, n, m,
200 $ cmplx( -one ), q, lda, a, lda, cmplx( one ), r, lda )
204 anorm = clange(
'1', m, n, a, lda, rwork )
205 resid = clange(
'1', m, n, r, lda, rwork )
206 IF( anorm.GT.zero )
THEN
207 result( 1 ) = ( ( resid / real( max( 1, m ) ) ) / anorm ) / eps
214 CALL claset(
'Full', m, m, cmplx( zero ), cmplx( one ), r, lda )
215 CALL cherk(
'Upper',
'Conjugate transpose', m, m, -one, q, lda,
220 resid = clansy(
'1',
'Upper', m, r, lda, rwork )
222 result( 2 ) = ( resid / real( max( 1, m ) ) ) / eps
subroutine cqrt01(m, n, a, af, q, r, lda, tau, work, lwork, rwork, result)
CQRT01
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine cgeqrf(m, n, a, lda, tau, work, lwork, info)
CGEQRF
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