134 SUBROUTINE crqt02( M, N, K, A, AF, Q, R, LDA, TAU, WORK, LWORK,
142 INTEGER K, LDA, LWORK, M, N
145 REAL RESULT( * ), RWORK( * )
146 COMPLEX A( LDA, * ), AF( LDA, * ), Q( LDA, * ),
147 $ r( lda, * ), tau( * ), work( lwork )
154 parameter( zero = 0.0e+0, one = 1.0e+0 )
156 parameter( rogue = ( -1.0e+10, -1.0e+10 ) )
160 REAL ANORM, EPS, RESID
163 REAL CLANGE, CLANSY, SLAMCH
164 EXTERNAL clange, clansy, slamch
170 INTRINSIC cmplx, max, real
176 COMMON / srnamc / srnamt
182 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
188 eps = slamch(
'Epsilon' )
192 CALL claset(
'Full', m, n, rogue, rogue, q, lda )
194 $
CALL clacpy(
'Full', k, n-k, af( m-k+1, 1 ), lda,
195 $ q( m-k+1, 1 ), lda )
197 $
CALL clacpy(
'Lower', k-1, k-1, af( m-k+2, n-k+1 ), lda,
198 $ q( m-k+2, n-k+1 ), lda )
203 CALL cungrq( m, n, k, q, lda, tau( m-k+1 ), work, lwork, info )
207 CALL claset(
'Full', k, m, cmplx( zero ), cmplx( zero ),
208 $ r( m-k+1, n-m+1 ), lda )
209 CALL clacpy(
'Upper', k, k, af( m-k+1, n-k+1 ), lda,
210 $ r( m-k+1, n-k+1 ), lda )
214 CALL cgemm(
'No transpose',
'Conjugate transpose', k, m, n,
215 $ cmplx( -one ), a( m-k+1, 1 ), lda, q, lda,
216 $ cmplx( one ), r( m-k+1, n-m+1 ), lda )
220 anorm = clange(
'1', k, n, a( m-k+1, 1 ), lda, rwork )
221 resid = clange(
'1', k, m, r( m-k+1, n-m+1 ), lda, rwork )
222 IF( anorm.GT.zero )
THEN
223 result( 1 ) = ( ( resid / real( max( 1, n ) ) ) / anorm ) / eps
230 CALL claset(
'Full', m, m, cmplx( zero ), cmplx( one ), r, lda )
231 CALL cherk(
'Upper',
'No transpose', m, n, -one, q, lda, one, r,
236 resid = clansy(
'1',
'Upper', m, r, lda, rwork )
238 result( 2 ) = ( resid / real( max( 1, n ) ) ) / eps
subroutine crqt02(m, n, k, a, af, q, r, lda, tau, work, lwork, rwork, result)
CRQT02
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 cungrq(m, n, k, a, lda, tau, work, lwork, info)
CUNGRQ