134 SUBROUTINE zqlt02( M, N, K, A, AF, Q, L, LDA, TAU, WORK, LWORK,
142 INTEGER K, LDA, LWORK, M, N
145 DOUBLE PRECISION RESULT( * ), RWORK( * )
146 COMPLEX*16 A( LDA, * ), AF( LDA, * ), L( LDA, * ),
147 $ q( lda, * ), tau( * ), work( lwork )
153 DOUBLE PRECISION ZERO, ONE
154 parameter( zero = 0.0d+0, one = 1.0d+0 )
156 parameter( rogue = ( -1.0d+10, -1.0d+10 ) )
160 DOUBLE PRECISION ANORM, EPS, RESID
163 DOUBLE PRECISION DLAMCH, ZLANGE, ZLANSY
164 EXTERNAL dlamch, zlange, zlansy
170 INTRINSIC dble, dcmplx, max
176 COMMON / srnamc / srnamt
182 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
188 eps = dlamch(
'Epsilon' )
192 CALL zlaset(
'Full', m, n, rogue, rogue, q, lda )
194 $
CALL zlacpy(
'Full', m-k, k, af( 1, n-k+1 ), lda,
195 $ q( 1, n-k+1 ), lda )
197 $
CALL zlacpy(
'Upper', k-1, k-1, af( m-k+1, n-k+2 ), lda,
198 $ q( m-k+1, n-k+2 ), lda )
203 CALL zungql( m, n, k, q, lda, tau( n-k+1 ), work, lwork, info )
207 CALL zlaset(
'Full', n, k, dcmplx( zero ), dcmplx( zero ),
208 $ l( m-n+1, n-k+1 ), lda )
209 CALL zlacpy(
'Lower', k, k, af( m-k+1, n-k+1 ), lda,
210 $ l( m-k+1, n-k+1 ), lda )
214 CALL zgemm(
'Conjugate transpose',
'No transpose', n, k, m,
215 $ dcmplx( -one ), q, lda, a( 1, n-k+1 ), lda,
216 $ dcmplx( one ), l( m-n+1, n-k+1 ), lda )
220 anorm = zlange(
'1', m, k, a( 1, n-k+1 ), lda, rwork )
221 resid = zlange(
'1', n, k, l( m-n+1, n-k+1 ), lda, rwork )
222 IF( anorm.GT.zero )
THEN
223 result( 1 ) = ( ( resid / dble( max( 1, m ) ) ) / anorm ) / eps
230 CALL zlaset(
'Full', n, n, dcmplx( zero ), dcmplx( one ), l, lda )
231 CALL zherk(
'Upper',
'Conjugate transpose', n, m, -one, q, lda,
236 resid = zlansy(
'1',
'Upper', n, l, lda, rwork )
238 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 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 zungql(m, n, k, a, lda, tau, work, lwork, info)
ZUNGQL
subroutine zqlt02(m, n, k, a, af, q, l, lda, tau, work, lwork, rwork, result)
ZQLT02