https://github.com/cran/fields
Tip revision: 6769ffc81115fbf0bf7d9c566cf7ac81be0049dc authored by Doug Nychka on 25 July 2005, 00:00:00 UTC
version 3.04
version 3.04
Tip revision: 6769ffc
test.for.zero.R
test.for.zero<- function( xtest,xtrue, tol= 1.0e-8, relative=TRUE,
tag=NULL){
if( !is.null(tag)){
cat( "testing: ", tag, fill=TRUE)}
denom<- ifelse( relative, mean( abs(c(xtrue))),1.0)
test.value<- sum( abs(c(xtest) - c( xtrue) ) ) /denom
if( test.value < tol ){
cat("** PASSED test at tolerance ", tol, fill=TRUE)}
else{ cat( "## FAILED test value = ", test.value, " at tolerance ", tol,
fill=TRUE)}
}