[Pomp-commits] r534 - in pkg: . src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sun Aug 14 14:40:49 CEST 2011


Author: kingaa
Date: 2011-08-14 14:40:49 +0200 (Sun, 14 Aug 2011)
New Revision: 534

Modified:
   pkg/DESCRIPTION
   pkg/src/pfilter.c
   pkg/src/sir.c
Log:
- clean up some of the C code to get rid of annoying warnings


Modified: pkg/DESCRIPTION
===================================================================
--- pkg/DESCRIPTION	2011-08-08 16:41:41 UTC (rev 533)
+++ pkg/DESCRIPTION	2011-08-14 12:40:49 UTC (rev 534)
@@ -2,7 +2,7 @@
 Type: Package
 Title: Statistical inference for partially observed Markov processes
 Version: 0.39-1
-Date: 2011-08-09
+Date: 2011-08-15
 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/src/pfilter.c
===================================================================
--- pkg/src/pfilter.c	2011-08-08 16:41:41 UTC (rev 533)
+++ pkg/src/pfilter.c	2011-08-14 12:40:49 UTC (rev 534)
@@ -57,7 +57,7 @@
   int nprotect = 0;
   SEXP pm = R_NilValue, pv = R_NilValue, fm = R_NilValue;
   SEXP rw_names, ess, fail, loglik;
-  SEXP newstates, newparams;
+  SEXP newstates = R_NilValue, newparams = R_NilValue;
   SEXP retval, retvalnames;
   double *xpm = 0, *xpv = 0, *xfm = 0, *xw = 0, *xx = 0, *xp = 0;
   SEXP dimX, dimP, newdim, Xnames, Pnames, pindex;
@@ -219,7 +219,7 @@
   if (!all_fail) { // resample the particles unless we have filtering failure
     int xdim[2];
     int sample[np];
-    double *ss, *st, *ps, *pt;
+    double *ss = 0, *st = 0, *ps = 0, *pt = 0;
 
     // create storage for new states
     xdim[0] = nvars; xdim[1] = np;

Modified: pkg/src/sir.c
===================================================================
--- pkg/src/sir.c	2011-08-08 16:41:41 UTC (rev 533)
+++ pkg/src/sir.c	2011-08-14 12:40:49 UTC (rev 534)
@@ -4,25 +4,25 @@
 
 #include "pomp.h"
 
-static double expit (double x) {
-  return 1.0/(1.0 + exp(-x));
-}
+// static double expit (double x) {
+//   return 1.0/(1.0 + exp(-x));
+// }
 
-static double logit (double x) {
-  return log(x/(1-x));
-}
+// static double logit (double x) {
+//   return log(x/(1-x));
+// }
 
-static double term_time (double t, double b0, double b1) 
-{
-  static double correction = 0.4958904;
-  double day = 365.0 * (t - floor(t));
-  double interm;
-  interm = ((day >= 7.0 && day < 100.0)
-	    || (day >= 116.0 && day < 200.0) 
-	    || (day >= 252.0 && day < 300.0) 
-	    || (day >= 308.0 && day < 356.0)) ? 1.0 : -1.0;
-  return b0*(1.0+b1*interm)/(1.0+b1*correction);
-}
+// static double term_time (double t, double b0, double b1) 
+// {
+//   static double correction = 0.4958904;
+//   double day = 365.0 * (t - floor(t));
+//   double interm;
+//   interm = ((day >= 7.0 && day < 100.0)
+// 	    || (day >= 116.0 && day < 200.0) 
+// 	    || (day >= 252.0 && day < 300.0) 
+// 	    || (day >= 308.0 && day < 356.0)) ? 1.0 : -1.0;
+//   return b0*(1.0+b1*interm)/(1.0+b1*correction);
+// }
 
 #define LOGGAMMA       (p[parindex[0]]) // recovery rate
 #define LOGMU          (p[parindex[1]]) // baseline birth and death rate



More information about the pomp-commits mailing list