144 SUBROUTINE dglmts( N, M, P, A, AF, LDA, B, BF, LDB, D, DF, X, U,
145 $ WORK, LWORK, RWORK, RESULT )
152 INTEGER LDA, LDB, LWORK, M, N, P
153 DOUBLE PRECISION RESULT
159 DOUBLE PRECISION A( LDA, * ), AF( LDA, * ), B( LDB, * ),
160 $ bf( ldb, * ), d( * ), df( * ), rwork( * ),
161 $ u( * ), work( lwork ), x( * )
164 DOUBLE PRECISION ZERO, ONE
165 parameter( zero = 0.0d+0, one = 1.0d+0 )
169 DOUBLE PRECISION ANORM, BNORM, DNORM, EPS, UNFL, XNORM, YNORM
172 DOUBLE PRECISION DASUM, DLAMCH, DLANGE
173 EXTERNAL dasum, dlamch, dlange
184 eps = dlamch(
'Epsilon' )
185 unfl = dlamch(
'Safe minimum' )
186 anorm = max( dlange(
'1', n, m, a, lda, rwork ), unfl )
187 bnorm = max( dlange(
'1', n, p, b, ldb, rwork ), unfl )
192 CALL dlacpy(
'Full', n, m, a, lda, af, lda )
193 CALL dlacpy(
'Full', n, p, b, ldb, bf, ldb )
194 CALL dcopy( n, d, 1, df, 1 )
198 CALL dggglm( n, m, p, af, lda, bf, ldb, df, x, u, work, lwork,
207 CALL dcopy( n, d, 1, df, 1 )
208 CALL dgemv(
'No transpose', n, m, -one, a, lda, x, 1, one, df, 1 )
210 CALL dgemv(
'No transpose', n, p, -one, b, ldb, u, 1, one, df, 1 )
212 dnorm = dasum( n, df, 1 )
213 xnorm = dasum( m, x, 1 ) + dasum( p, u, 1 )
214 ynorm = anorm + bnorm
216 IF( xnorm.LE.zero )
THEN
219 result = ( ( dnorm / ynorm ) / xnorm ) / eps
subroutine dglmts(n, m, p, a, af, lda, b, bf, ldb, d, df, x, u, work, lwork, rwork, result)
DGLMTS
subroutine dcopy(n, dx, incx, dy, incy)
DCOPY
subroutine dgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
DGEMV
subroutine dggglm(n, m, p, a, lda, b, ldb, d, x, y, work, lwork, info)
DGGGLM
subroutine dlacpy(uplo, m, n, a, lda, b, ldb)
DLACPY copies all or part of one two-dimensional array to another.