[Pomp-commits] r716 - in pkg/pomp: . R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat May 12 17:09:24 CEST 2012


Author: kingaa
Date: 2012-05-12 17:09:24 +0200 (Sat, 12 May 2012)
New Revision: 716

Modified:
   pkg/pomp/DESCRIPTION
   pkg/pomp/R/dmeasure-pomp.R
   pkg/pomp/R/dprocess-pomp.R
   pkg/pomp/R/pomp-methods.R
   pkg/pomp/R/rmeasure-pomp.R
   pkg/pomp/R/rprocess-pomp.R
   pkg/pomp/R/skeleton-pomp.R
   pkg/pomp/R/trajectory-pomp.R
Log:
- use fewer anonymous functions


Modified: pkg/pomp/DESCRIPTION
===================================================================
--- pkg/pomp/DESCRIPTION	2012-05-10 09:16:06 UTC (rev 715)
+++ pkg/pomp/DESCRIPTION	2012-05-12 15:09:24 UTC (rev 716)
@@ -1,8 +1,8 @@
 Package: pomp
 Type: Package
 Title: Statistical inference for partially observed Markov processes
-Version: 0.42-3
-Date: 2012-05-10
+Version: 0.42-4
+Date: 2012-05-12
 Author: Aaron A. King, Edward L. Ionides, Carles Breto, Steve Ellner, Bruce Kendall, Helen Wearing, Matthew J. Ferrari, Michael Lavine, Daniel C. Reuman
 Maintainer: Aaron A. King <kingaa at umich.edu>
 URL: http://pomp.r-forge.r-project.org

Modified: pkg/pomp/R/dmeasure-pomp.R
===================================================================
--- pkg/pomp/R/dmeasure-pomp.R	2012-05-10 09:16:06 UTC (rev 715)
+++ pkg/pomp/R/dmeasure-pomp.R	2012-05-12 15:09:24 UTC (rev 716)
@@ -1,11 +1,9 @@
+## evaluate the measurement model density function
 setGeneric("dmeasure",function(object,...)standardGeneric("dmeasure"))
 
-## evaluate the measurement model density function
-setMethod(
-          'dmeasure',
-          'pomp',
-          function (object, y, x, times, params, log = FALSE, ...) {
-            fun <- get.pomp.fun(object at dmeasure)
-            .Call(do_dmeasure,object,y,x,times,params,log,fun)
-          }
-          )
+dmeasure.internal <- function (object, y, x, times, params, log = FALSE, ...) {
+  fun <- get.pomp.fun(object at dmeasure)
+  .Call(do_dmeasure,object,y,x,times,params,log,fun)
+}
+
+setMethod("dmeasure","pomp",dmeasure.internal)

Modified: pkg/pomp/R/dprocess-pomp.R
===================================================================
--- pkg/pomp/R/dprocess-pomp.R	2012-05-10 09:16:06 UTC (rev 715)
+++ pkg/pomp/R/dprocess-pomp.R	2012-05-12 15:09:24 UTC (rev 716)
@@ -1,9 +1,7 @@
+## evaluate the process model density function
 setGeneric("dprocess",function(object,...)standardGeneric("dprocess"))
 
-## evaluate the process model density function
-setMethod(
-          'dprocess',
-          'pomp',
-          function (object, x, times, params, log = FALSE, ...)
-            .Call(do_dprocess,object,x,times,params,log)
-          )
+dprocess.internal <- function (object, x, times, params, log = FALSE, ...)
+  .Call(do_dprocess,object,x,times,params,log)
+
+setMethod("dprocess","pomp",dprocess.internal)

Modified: pkg/pomp/R/pomp-methods.R
===================================================================
--- pkg/pomp/R/pomp-methods.R	2012-05-10 09:16:06 UTC (rev 715)
+++ pkg/pomp/R/pomp-methods.R	2012-05-12 15:09:24 UTC (rev 716)
@@ -35,7 +35,7 @@
 as.data.frame.pomp <- function (x, row.names, optional, ...) as(x,"data.frame")
 
 ## parameter transformations
-pomp.transform <- function (object, params, dir = c("forward","inverse"), ...) {
+partrans.internal <- function (object, params, dir = c("forward","inverse"), ...) {
   if (!object at has.trans) return(params)
   dir <- match.arg(dir)
   tfunc <- switch(
@@ -46,7 +46,7 @@
   .Call(do_partrans,object,params,tfunc)
 }
 
-setMethod("partrans","pomp",pomp.transform)
+setMethod("partrans","pomp",partrans.internal)
 
 ## a simple method to extract the data array
 setMethod(

Modified: pkg/pomp/R/rmeasure-pomp.R
===================================================================
--- pkg/pomp/R/rmeasure-pomp.R	2012-05-10 09:16:06 UTC (rev 715)
+++ pkg/pomp/R/rmeasure-pomp.R	2012-05-12 15:09:24 UTC (rev 716)
@@ -1,11 +1,10 @@
+## simulate the measurement model
+
 setGeneric("rmeasure",function(object,...)standardGeneric("rmeasure"))
 
-## simulate the measurement model
-setMethod(
-          'rmeasure',
-          'pomp',
-          function (object, x, times, params, ...) {
-            fun <- get.pomp.fun(object at rmeasure)
-            .Call(do_rmeasure,object,x,times,params,fun)
-          }
-          )
+rmeasure.internal <- function (object, x, times, params, ...) {
+  fun <- get.pomp.fun(object at rmeasure)
+  .Call(do_rmeasure,object,x,times,params,fun)
+}
+
+setMethod("rmeasure","pomp",rmeasure.internal)

Modified: pkg/pomp/R/rprocess-pomp.R
===================================================================
--- pkg/pomp/R/rprocess-pomp.R	2012-05-10 09:16:06 UTC (rev 715)
+++ pkg/pomp/R/rprocess-pomp.R	2012-05-12 15:09:24 UTC (rev 716)
@@ -1,9 +1,8 @@
+## simulate the process model
+
 setGeneric("rprocess",function(object,...)standardGeneric("rprocess"))
 
-## simulate the process model
-setMethod(
-          'rprocess',
-          'pomp',
-          function (object, xstart, times, params, offset = 0, ...)
-            .Call(do_rprocess,object,xstart,times,params,offset)
-          )
+rprocess.internal <- function (object, xstart, times, params, offset = 0, ...)
+  .Call(do_rprocess,object,xstart,times,params,offset)
+
+setMethod("rprocess","pomp",rprocess.internal)

Modified: pkg/pomp/R/skeleton-pomp.R
===================================================================
--- pkg/pomp/R/skeleton-pomp.R	2012-05-10 09:16:06 UTC (rev 715)
+++ pkg/pomp/R/skeleton-pomp.R	2012-05-12 15:09:24 UTC (rev 716)
@@ -1,14 +1,9 @@
-skeleton <- function (object, x, t, params, ...)
-  stop("function ",sQuote("skeleton")," is undefined for objects of class ",sQuote(class(object)))
+## evaluate the deterministic skeleton
+setGeneric("skeleton",function(object,...)standardGeneric("skeleton"))
 
-setGeneric('skeleton')
+skeleton.internal <- function (object, x, t, params, ...) {
+  skel <- .Call(get_pomp_fun,object at skeleton)
+  .Call(do_skeleton,object,x,t,params,skel)
+}
 
-## evaluate the measurement model density function
-setMethod(
-          'skeleton',
-          'pomp',
-          function (object, x, t, params, ...) {
-            skel <- .Call(get_pomp_fun,object at skeleton)
-            .Call(do_skeleton,object,x,t,params,skel)
-          }
-          )
+setMethod("skeleton","pomp",skeleton.internal)

Modified: pkg/pomp/R/trajectory-pomp.R
===================================================================
--- pkg/pomp/R/trajectory-pomp.R	2012-05-10 09:16:06 UTC (rev 715)
+++ pkg/pomp/R/trajectory-pomp.R	2012-05-12 15:09:24 UTC (rev 716)
@@ -1,8 +1,5 @@
-trajectory <- function (object, params, times, t0, ...)            
-  stop("function ",sQuote("trajectory")," is undefined for objects of class ",sQuote(class(object)))
+setGeneric("trajectory",function(object,...)standardGeneric("trajectory"))
 
-setGeneric('trajectory')                                                                            
-
 trajectory.internal <- function (object, params, times, t0, as.data.frame = FALSE, ...) {
 
   if (missing(times))



More information about the pomp-commits mailing list