124 SUBROUTINE zqrt01( M, N, A, AF, Q, R, LDA, TAU, WORK, LWORK,
132 INTEGER LDA, LWORK, M, N
135 DOUBLE PRECISION RESULT( * ), RWORK( * )
136 COMPLEX*16 A( LDA, * ), AF( LDA, * ), Q( LDA, * ),
137 $ r( lda, * ), tau( * ), work( lwork )
143 DOUBLE PRECISION ZERO, ONE
144 parameter( zero = 0.0d+0, one = 1.0d+0 )
146 parameter( rogue = ( -1.0d+10, -1.0d+10 ) )
150 DOUBLE PRECISION ANORM, EPS, RESID
153 DOUBLE PRECISION DLAMCH, ZLANGE, ZLANSY
154 EXTERNAL dlamch, zlange, zlansy
160 INTRINSIC dble, dcmplx, max, min
166 COMMON / srnamc / srnamt
171 eps = dlamch(
'Epsilon' )
175 CALL zlacpy(
'Full', m, n, a, lda, af, lda )
180 CALL zgeqrf( m, n, af, lda, tau, work, lwork, info )
184 CALL zlaset(
'Full', m, m, rogue, rogue, q, lda )
185 CALL zlacpy(
'Lower', m-1, n, af( 2, 1 ), lda, q( 2, 1 ), lda )
190 CALL zungqr( m, m, minmn, q, lda, tau, work, lwork, info )
194 CALL zlaset(
'Full', m, n, dcmplx( zero ), dcmplx( zero ), r,
196 CALL zlacpy(
'Upper', m, n, af, lda, r, lda )
200 CALL zgemm(
'Conjugate transpose',
'No transpose', m, n, m,
201 $ dcmplx( -one ), q, lda, a, lda, dcmplx( one ), r,
206 anorm = zlange(
'1', m, n, a, lda, rwork )
207 resid = zlange(
'1', m, n, r, lda, rwork )
208 IF( anorm.GT.zero )
THEN
209 result( 1 ) = ( ( resid / dble( max( 1, m ) ) ) / anorm ) / eps
216 CALL zlaset(
'Full', m, m, dcmplx( zero ), dcmplx( one ), r, lda )
217 CALL zherk(
'Upper',
'Conjugate transpose', m, m, -one, q, lda,
222 resid = zlansy(
'1',
'Upper', m, r, lda, rwork )
224 result( 2 ) = ( resid / dble( max( 1, m ) ) ) / eps
subroutine zgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
ZGEMM
subroutine zgeqrf(m, n, a, lda, tau, work, lwork, info)
ZGEQRF
subroutine zherk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
ZHERK
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
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 zqrt01(m, n, a, af, q, r, lda, tau, work, lwork, rwork, result)
ZQRT01