[Pomp-commits] r78 - in pkg: man src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Mar 11 17:02:14 CET 2009


Author: kingaa
Date: 2009-03-11 17:02:14 +0100 (Wed, 11 Mar 2009)
New Revision: 78

Modified:
   pkg/man/eulermultinom.Rd
   pkg/src/eulermultinom.c
Log:
replace "euler infelicity" Rprintf statements with warnings

Modified: pkg/man/eulermultinom.Rd
===================================================================
--- pkg/man/eulermultinom.Rd	2009-03-11 16:01:05 UTC (rev 77)
+++ pkg/man/eulermultinom.Rd	2009-03-11 16:02:14 UTC (rev 78)
@@ -29,12 +29,13 @@
   }
 }
 \details{
-  Direct access to the underlying C routines is available: see the header file "pomp.h", included with the package.
+  Direct access to the underlying C routines is available: see the header file "pomp.h", included with the package,
+  e.g., \code{edit(file=system.file("include/pomp.h",package="pomp"))}.
 }
 \author{Aaron A. King (kingaa at umich dot edu)}
 \seealso{\code{\link{euler}}, \code{\link{pomp}}}
 \examples{
-x <- reulermultinom(5,size=100,rate=c(a=1,b=2,c=3),dt=0.1)
+print(x <- reulermultinom(5,size=100,rate=c(a=1,b=2,c=3),dt=0.1))
 deulermultinom(x,size=100,rate=c(1,2,3),dt=0.1)
 }
 \keyword{distribution}

Modified: pkg/src/eulermultinom.c
===================================================================
--- pkg/src/eulermultinom.c	2009-03-11 16:01:05 UTC (rev 77)
+++ pkg/src/eulermultinom.c	2009-03-11 16:02:14 UTC (rev 78)
@@ -24,13 +24,13 @@
   GetRNGstate();
   size = rbinom(size,1-exp(-p*dt)); // total number of events
   if (!(R_FINITE(size)))
-    Rprintf("reulermultinom infelicity 1: %lg %lg %lg\n",size,p,dt);
+    warning("reulermultinom: result of binomial draw is not finite");
   m -= 1;
   for (k = 0; k < m; k++) {
     if (rate[k] > p) p = rate[k];
     trans[k] = ((size > 0) && (p > 0)) ? rbinom(size,rate[k]/p) : 0;
     if (!(R_FINITE(size)&&R_FINITE(p)&&R_FINITE(rate[k])&&R_FINITE(trans[k])))
-      Rprintf("reulermultinom infelicity %d: %lg %lg %lg %lg\n",k,size,rate[k]/p,trans[k],dt);
+      warning("reulermultinom: result of binomial draw is not finite");
     size -= trans[k];
     p -= rate[k];
   }



More information about the pomp-commits mailing list