148 SUBROUTINE cglmts( N, M, P, A, AF, LDA, B, BF, LDB, D, DF,
149 $ X, U, WORK, LWORK, RWORK, RESULT )
156 INTEGER LDA, LDB, LWORK, M, P, N
161 COMPLEX A( LDA, * ), AF( LDA, * ), B( LDB, * ),
162 $ bf( ldb, * ), d( * ), df( * ), u( * ),
163 $ work( lwork ), x( * )
169 parameter( zero = 0.0e+0 )
171 parameter( cone = 1.0e+0 )
175 REAL ANORM, BNORM, EPS, XNORM, YNORM, DNORM, UNFL
178 REAL SCASUM, SLAMCH, CLANGE
179 EXTERNAL scasum, slamch, clange
189 eps = slamch(
'Epsilon' )
190 unfl = slamch(
'Safe minimum' )
191 anorm = max( clange(
'1', n, m, a, lda, rwork ), unfl )
192 bnorm = max( clange(
'1', n, p, b, ldb, rwork ), unfl )
197 CALL clacpy(
'Full', n, m, a, lda, af, lda )
198 CALL clacpy(
'Full', n, p, b, ldb, bf, ldb )
199 CALL ccopy( n, d, 1, df, 1 )
203 CALL cggglm( n, m, p, af, lda, bf, ldb, df, x, u, work, lwork,
212 CALL ccopy( n, d, 1, df, 1 )
213 CALL cgemv(
'No transpose', n, m, -cone, a, lda, x, 1, cone,
216 CALL cgemv(
'No transpose', n, p, -cone, b, ldb, u, 1, cone,
219 dnorm = scasum( n, df, 1 )
220 xnorm = scasum( m, x, 1 ) + scasum( p, u, 1 )
221 ynorm = anorm + bnorm
223 IF( xnorm.LE.zero )
THEN
226 result = ( ( dnorm / ynorm ) / xnorm ) /eps
subroutine cglmts(n, m, p, a, af, lda, b, bf, ldb, d, df, x, u, work, lwork, rwork, result)
CGLMTS
subroutine ccopy(n, cx, incx, cy, incy)
CCOPY
subroutine cgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
CGEMV
subroutine cggglm(n, m, p, a, lda, b, ldb, d, x, y, work, lwork, info)
CGGGLM
subroutine clacpy(uplo, m, n, a, lda, b, ldb)
CLACPY copies all or part of one two-dimensional array to another.