134 SUBROUTINE cqlt02( M, N, K, A, AF, Q, L, LDA, TAU, WORK, LWORK,
142 INTEGER K, LDA, LWORK, M, N
145 REAL RESULT( * ), RWORK( * )
146 COMPLEX A( LDA, * ), AF( LDA, * ), L( LDA, * ),
147 $ q( 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', m-k, k, af( 1, n-k+1 ), lda,
195 $ q( 1, n-k+1 ), lda )
197 $
CALL clacpy(
'Upper', k-1, k-1, af( m-k+1, n-k+2 ), lda,
198 $ q( m-k+1, n-k+2 ), lda )
203 CALL cungql( m, n, k, q, lda, tau( n-k+1 ), work, lwork, info )
207 CALL claset(
'Full', n, k, cmplx( zero ), cmplx( zero ),
208 $ l( m-n+1, n-k+1 ), lda )
209 CALL clacpy(
'Lower', k, k, af( m-k+1, n-k+1 ), lda,
210 $ l( m-k+1, n-k+1 ), lda )
214 CALL cgemm(
'Conjugate transpose',
'No transpose', n, k, m,
215 $ cmplx( -one ), q, lda, a( 1, n-k+1 ), lda,
216 $ cmplx( one ), l( m-n+1, n-k+1 ), lda )
220 anorm = clange(
'1', m, k, a( 1, n-k+1 ), lda, rwork )
221 resid = clange(
'1', n, k, l( m-n+1, n-k+1 ), lda, rwork )
222 IF( anorm.GT.zero )
THEN
223 result( 1 ) = ( ( resid / real( max( 1, m ) ) ) / anorm ) / eps
230 CALL claset(
'Full', n, n, cmplx( zero ), cmplx( one ), l, lda )
231 CALL cherk(
'Upper',
'Conjugate transpose', n, m, -one, q, lda,
236 resid = clansy(
'1',
'Upper', n, l, lda, rwork )
238 result( 2 ) = ( resid / real( max( 1, m ) ) ) / eps
subroutine cqlt02(m, n, k, a, af, q, l, lda, tau, work, lwork, rwork, result)
CQLT02
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 cungql(m, n, k, a, lda, tau, work, lwork, info)
CUNGQL