144 SUBROUTINE zglmts( 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 RWORK( * )
160 COMPLEX*16 A( LDA, * ), AF( LDA, * ), B( LDB, * ),
161 $ bf( ldb, * ), d( * ), df( * ), u( * ),
162 $ work( lwork ), x( * )
165 DOUBLE PRECISION ZERO
166 parameter( zero = 0.0d+0 )
168 parameter( cone = 1.0d+0 )
172 DOUBLE PRECISION ANORM, BNORM, DNORM, EPS, UNFL, XNORM, YNORM
175 DOUBLE PRECISION DLAMCH, DZASUM, ZLANGE
176 EXTERNAL dlamch, dzasum, zlange
187 eps = dlamch(
'Epsilon' )
188 unfl = dlamch(
'Safe minimum' )
189 anorm = max( zlange(
'1', n, m, a, lda, rwork ), unfl )
190 bnorm = max( zlange(
'1', n, p, b, ldb, rwork ), unfl )
195 CALL zlacpy(
'Full', n, m, a, lda, af, lda )
196 CALL zlacpy(
'Full', n, p, b, ldb, bf, ldb )
197 CALL zcopy( n, d, 1, df, 1 )
201 CALL zggglm( n, m, p, af, lda, bf, ldb, df, x, u, work, lwork,
210 CALL zcopy( n, d, 1, df, 1 )
211 CALL zgemv(
'No transpose', n, m, -cone, a, lda, x, 1, cone, df,
214 CALL zgemv(
'No transpose', n, p, -cone, b, ldb, u, 1, cone, df,
217 dnorm = dzasum( n, df, 1 )
218 xnorm = dzasum( m, x, 1 ) + dzasum( p, u, 1 )
219 ynorm = anorm + bnorm
221 IF( xnorm.LE.zero )
THEN
224 result = ( ( dnorm / ynorm ) / xnorm ) / eps
subroutine zcopy(n, zx, incx, zy, incy)
ZCOPY
subroutine zgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
ZGEMV
subroutine zggglm(n, m, p, a, lda, b, ldb, d, x, y, work, lwork, info)
ZGGGLM
subroutine zlacpy(uplo, m, n, a, lda, b, ldb)
ZLACPY copies all or part of one two-dimensional array to another.
subroutine zglmts(n, m, p, a, af, lda, b, bf, ldb, d, df, x, u, work, lwork, rwork, result)
ZGLMTS