135 SUBROUTINE zqrt02( M, N, K, A, AF, Q, R, LDA, TAU, WORK, LWORK,
144 INTEGER K, LDA, LWORK, M, N
147 DOUBLE PRECISION RESULT( * ), RWORK( * )
148 COMPLEX*16 A( lda, * ), AF( lda, * ), Q( lda, * ),
149 $ r( lda, * ), tau( * ), work( lwork )
155 DOUBLE PRECISION ZERO, ONE
156 parameter ( zero = 0.0d+0, one = 1.0d+0 )
158 parameter ( rogue = ( -1.0d+10, -1.0d+10 ) )
162 DOUBLE PRECISION ANORM, EPS, RESID
165 DOUBLE PRECISION DLAMCH, ZLANGE, ZLANSY
166 EXTERNAL dlamch, zlange, zlansy
172 INTRINSIC dble, dcmplx, max
178 COMMON / srnamc / srnamt
182 eps = dlamch(
'Epsilon' )
186 CALL zlaset(
'Full', m, n, rogue, rogue, q, lda )
187 CALL zlacpy(
'Lower', m-1, k, af( 2, 1 ), lda, q( 2, 1 ), lda )
192 CALL zungqr( m, n, k, q, lda, tau, work, lwork, info )
196 CALL zlaset(
'Full', n, k, dcmplx( zero ), dcmplx( zero ), r,
198 CALL zlacpy(
'Upper', n, k, af, lda, r, lda )
202 CALL zgemm(
'Conjugate transpose',
'No transpose', n, k, m,
203 $ dcmplx( -one ), q, lda, a, lda, dcmplx( one ), r,
208 anorm = zlange(
'1', m, k, a, lda, rwork )
209 resid = zlange(
'1', n, k, r, lda, rwork )
210 IF( anorm.GT.zero )
THEN
211 result( 1 ) = ( ( resid / dble( max( 1, m ) ) ) / anorm ) / eps
218 CALL zlaset(
'Full', n, n, dcmplx( zero ), dcmplx( one ), r, lda )
219 CALL zherk(
'Upper',
'Conjugate transpose', n, m, -one, q, lda,
224 resid = zlansy(
'1',
'Upper', n, r, lda, rwork )
226 result( 2 ) = ( resid / dble( max( 1, m ) ) ) / eps
subroutine zlacpy(UPLO, M, N, A, LDA, B, LDB)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zqrt02(M, N, K, A, AF, Q, R, LDA, TAU, WORK, LWORK, RWORK, RESULT)
ZQRT02
subroutine zgemm(TRANSA, TRANSB, M, N, K, ALPHA, A, LDA, B, LDB, BETA, C, LDC)
ZGEMM
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 zherk(UPLO, TRANS, N, K, ALPHA, A, LDA, BETA, C, LDC)
ZHERK