147 SUBROUTINE sglmts( N, M, P, A, AF, LDA, B, BF, LDB, D, DF,
148 $ X, U, WORK, LWORK, RWORK, RESULT )
155 INTEGER LDA, LDB, LWORK, M, P, N
159 REAL A( LDA, * ), AF( LDA, * ), B( LDB, * ),
160 $ bf( ldb, * ), rwork( * ), d( * ), df( * ),
161 $ u( * ), work( lwork ), x( * )
167 parameter( zero = 0.0e+0, one = 1.0e+0 )
171 REAL ANORM, BNORM, EPS, XNORM, YNORM, DNORM, UNFL
174 REAL SASUM, SLAMCH, SLANGE
175 EXTERNAL sasum, slamch, slange
185 eps = slamch(
'Epsilon' )
186 unfl = slamch(
'Safe minimum' )
187 anorm = max( slange(
'1', n, m, a, lda, rwork ), unfl )
188 bnorm = max( slange(
'1', n, p, b, ldb, rwork ), unfl )
193 CALL slacpy(
'Full', n, m, a, lda, af, lda )
194 CALL slacpy(
'Full', n, p, b, ldb, bf, ldb )
195 CALL scopy( n, d, 1, df, 1 )
199 CALL sggglm( n, m, p, af, lda, bf, ldb, df, x, u, work, lwork,
208 CALL scopy( n, d, 1, df, 1 )
209 CALL sgemv(
'No transpose', n, m, -one, a, lda, x, 1,
212 CALL sgemv(
'No transpose', n, p, -one, b, ldb, u, 1,
215 dnorm = sasum( n, df, 1 )
216 xnorm = sasum( m, x, 1 ) + sasum( p, u, 1 )
217 ynorm = anorm + bnorm
219 IF( xnorm.LE.zero )
THEN
222 result = ( ( dnorm / ynorm ) / xnorm ) /eps
subroutine scopy(n, sx, incx, sy, incy)
SCOPY
subroutine sgemv(trans, m, n, alpha, a, lda, x, incx, beta, y, incy)
SGEMV
subroutine sggglm(n, m, p, a, lda, b, ldb, d, x, y, work, lwork, info)
SGGGLM
subroutine slacpy(uplo, m, n, a, lda, b, ldb)
SLACPY copies all or part of one two-dimensional array to another.
subroutine sglmts(n, m, p, a, af, lda, b, bf, ldb, d, df, x, u, work, lwork, rwork, result)
SGLMTS