134 SUBROUTINE dqlt02( M, N, K, A, AF, Q, L, LDA, TAU, WORK, LWORK,
142 INTEGER K, LDA, LWORK, M, N
145 DOUBLE PRECISION A( LDA, * ), AF( LDA, * ), L( LDA, * ),
146 $ q( lda, * ), result( * ), rwork( * ), tau( * ),
153 DOUBLE PRECISION ZERO, ONE
154 parameter( zero = 0.0d+0, one = 1.0d+0 )
155 DOUBLE PRECISION ROGUE
156 parameter( rogue = -1.0d+10 )
160 DOUBLE PRECISION ANORM, EPS, RESID
163 DOUBLE PRECISION DLAMCH, DLANGE, DLANSY
164 EXTERNAL dlamch, dlange, dlansy
176 COMMON / srnamc / srnamt
182 IF( m.EQ.0 .OR. n.EQ.0 .OR. k.EQ.0 )
THEN
188 eps = dlamch(
'Epsilon' )
192 CALL dlaset(
'Full', m, n, rogue, rogue, q, lda )
194 $
CALL dlacpy(
'Full', m-k, k, af( 1, n-k+1 ), lda,
195 $ q( 1, n-k+1 ), lda )
197 $
CALL dlacpy(
'Upper', k-1, k-1, af( m-k+1, n-k+2 ), lda,
198 $ q( m-k+1, n-k+2 ), lda )
203 CALL dorgql( m, n, k, q, lda, tau( n-k+1 ), work, lwork, info )
207 CALL dlaset(
'Full', n, k, zero, zero, l( m-n+1, n-k+1 ), lda )
208 CALL dlacpy(
'Lower', k, k, af( m-k+1, n-k+1 ), lda,
209 $ l( m-k+1, n-k+1 ), lda )
213 CALL dgemm(
'Transpose',
'No transpose', n, k, m, -one, q, lda,
214 $ a( 1, n-k+1 ), lda, one, l( m-n+1, n-k+1 ), lda )
218 anorm = dlange(
'1', m, k, a( 1, n-k+1 ), lda, rwork )
219 resid = dlange(
'1', n, k, l( m-n+1, n-k+1 ), lda, rwork )
220 IF( anorm.GT.zero )
THEN
221 result( 1 ) = ( ( resid / dble( max( 1, m ) ) ) / anorm ) / eps
228 CALL dlaset(
'Full', n, n, zero, one, l, lda )
229 CALL dsyrk(
'Upper',
'Transpose', n, m, -one, q, lda, one, l,
234 resid = dlansy(
'1',
'Upper', n, l, lda, rwork )
236 result( 2 ) = ( resid / dble( max( 1, m ) ) ) / eps
subroutine dqlt02(m, n, k, a, af, q, l, lda, tau, work, lwork, rwork, result)
DQLT02
subroutine dgemm(transa, transb, m, n, k, alpha, a, lda, b, ldb, beta, c, ldc)
DGEMM
subroutine dsyrk(uplo, trans, n, k, alpha, a, lda, beta, c, ldc)
DSYRK
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.
subroutine dlaset(uplo, m, n, alpha, beta, a, lda)
DLASET initializes the off-diagonal elements and the diagonal elements of a matrix to given values.
subroutine dorgql(m, n, k, a, lda, tau, work, lwork, info)
DORGQL