[Pomp-commits] r742 - pkg/pomp/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Jul 1 18:05:55 CEST 2012


Author: kingaa
Date: 2012-07-01 18:05:54 +0200 (Sun, 01 Jul 2012)
New Revision: 742

Modified:
   pkg/pomp/R/pomp-methods.R
   pkg/pomp/R/pomp.R
Log:
- force storage.type to double for params slot


Modified: pkg/pomp/R/pomp-methods.R
===================================================================
--- pkg/pomp/R/pomp-methods.R	2012-06-29 21:25:50 UTC (rev 741)
+++ pkg/pomp/R/pomp-methods.R	2012-07-01 16:05:54 UTC (rev 742)
@@ -259,6 +259,7 @@
                 object at params <- params
               }
             }
+            storage.mode(object at params) <- "double"
             object
           }
           )

Modified: pkg/pomp/R/pomp.R
===================================================================
--- pkg/pomp/R/pomp.R	2012-06-29 21:25:50 UTC (rev 741)
+++ pkg/pomp/R/pomp.R	2012-07-01 16:05:54 UTC (rev 742)
@@ -58,6 +58,12 @@
   if (missing(times)) stop(sQuote("times")," is a required argument")
   if (missing(t0)) stop(sQuote("t0")," is a required argument")
   if (missing(params)) params <- numeric(0)
+
+  if (length(params)>0) {
+    if (is.null(names(params)) || !is.numeric(params))
+      stop("pomp error: ",sQuote("params")," must be a named numeric vector",call.=TRUE)
+  }
+  storage.mode(params) <- 'double'
   
   ## check the data
   if (is.data.frame(data)) {



More information about the pomp-commits mailing list