124 SUBROUTINE cqlt01( M, N, A, AF, Q, L, LDA, TAU, WORK, LWORK,
132 INTEGER LDA, LWORK, M, N
135 REAL RESULT( * ), RWORK( * )
136 COMPLEX A( LDA, * ), AF( LDA, * ), L( LDA, * ),
137 $ q( lda, * ), tau( * ), work( lwork )
144 parameter( zero = 0.0e+0, one = 1.0e+0 )
146 parameter( rogue = ( -1.0e+10, -1.0e+10 ) )
150 REAL ANORM, EPS, RESID
153 REAL CLANGE, CLANSY, SLAMCH
154 EXTERNAL clange, clansy, slamch
160 INTRINSIC cmplx, max, min, real
166 COMMON / srnamc / srnamt
171 eps = slamch(
'Epsilon' )
175 CALL clacpy(
'Full', m, n, a, lda, af, lda )
180 CALL cgeqlf( m, n, af, lda, tau, work, lwork, info )
184 CALL claset(
'Full', m, m, rogue, rogue, q, lda )
186 IF( n.LT.m .AND. n.GT.0 )
187 $
CALL clacpy(
'Full', m-n, n, af, lda, q( 1, m-n+1 ), lda )
189 $
CALL clacpy(
'Upper', n-1, n-1, af( m-n+1, 2 ), lda,
190 $ q( m-n+1, m-n+2 ), lda )
193 $
CALL clacpy(
'Upper', m-1, m-1, af( 1, n-m+2 ), lda,
200 CALL cungql( m, m, minmn, q, lda, tau, work, lwork, info )
204 CALL claset(
'Full', m, n, cmplx( zero ), cmplx( zero ), l, lda )
207 $
CALL clacpy(
'Lower', n, n, af( m-n+1, 1 ), lda,
208 $ l( m-n+1, 1 ), lda )
210 IF( n.GT.m .AND. m.GT.0 )
211 $
CALL clacpy(
'Full', m, n-m, af, lda, l, lda )
213 $
CALL clacpy(
'Lower', m, m, af( 1, n-m+1 ), lda,
214 $ l( 1, n-m+1 ), lda )
219 CALL cgemm(
'Conjugate transpose',
'No transpose', m, n, m,
220 $ cmplx( -one ), q, lda, a, lda, cmplx( one ), l, lda )
224 anorm = clange(
'1', m, n, a, lda, rwork )
225 resid = clange(
'1', m, n, l, lda, rwork )
226 IF( anorm.GT.zero )
THEN
227 result( 1 ) = ( ( resid / real( max( 1, m ) ) ) / anorm ) / eps
234 CALL claset(
'Full', m, m, cmplx( zero ), cmplx( one ), l, lda )
235 CALL cherk(
'Upper',
'Conjugate transpose', m, m, -one, q, lda,
240 resid = clansy(
'1',
'Upper', m, l, lda, rwork )
242 result( 2 ) = ( resid / real( max( 1, m ) ) ) / eps
subroutine cqlt01(m, n, a, af, q, l, lda, tau, work, lwork, rwork, result)
CQLT01
subroutine cgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
CGEMM
subroutine cgeqlf(m, n, a, lda, tau, work, lwork, info)
CGEQLF
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