Revision 69b0f9dca8eb051f132725ecc679fe1997246e50 authored by Adrian Baddeley on 18 January 2006, 21:47:25 UTC, committed by cran-robot on 18 January 2006, 21:47:25 UTC
1 parent cb2215f
pairwise.S
#
#
# pairwise.S
#
# $Revision: 1.4 $ $Date: 2005/07/27 06:57:24 $
#
# Pairwise() create a user-defined pairwise interaction process
# [an object of class 'interact']
#
# -------------------------------------------------------------------
#
Pairwise <- function(pot, name = "user-defined pairwise interaction process",
par = NULL, parnames=NULL,
printfun) {
fop <- names(formals(pot))
if(!identical(all.equal(fop, c("d", "par")), TRUE)
&& !identical(all.equal(fop, c("d", "tx", "tu", "par")), TRUE))
stop(paste("Formal arguments of pair potential function \`pot\'",
"must be either (d, par) or (d, tx, tu, par)"))
if(missing(printfun))
printfun <- function(self) {
cat(paste(self$name, "\n"))
cat("Potential function:\n")
print(self$pot)
}
out <-
list(
name = name,
family = pairwise.family,
pot = pot,
par = par,
parnames = parnames,
init = NULL,
update = NULL,
print = printfun
)
class(out) <- "interact"
return(out)
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...