[Pomp-commits] r653 - pkg/src

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Apr 10 21:48:02 CEST 2012


Author: kingaa
Date: 2012-04-10 21:48:02 +0200 (Tue, 10 Apr 2012)
New Revision: 653

Modified:
   pkg/src/trajectory.c
Log:
- bug fix


Modified: pkg/src/trajectory.c
===================================================================
--- pkg/src/trajectory.c	2012-04-10 15:47:46 UTC (rev 652)
+++ pkg/src/trajectory.c	2012-04-10 19:48:02 UTC (rev 653)
@@ -103,10 +103,10 @@
 }
 
 static struct {
-  SEXP *object;
-  SEXP *params;
-  SEXP *skelfun;
-  SEXP *xnames;
+  SEXP object;
+  SEXP params;
+  SEXP skelfun;
+  SEXP xnames;
   int xdim[3];
 } _pomp_vf_eval_common;
 
@@ -114,10 +114,10 @@
 #define COMMON(X)    (_pomp_vf_eval_common.X)
 
 void pomp_desolve_init (SEXP object, SEXP params, SEXP fun, SEXP statenames, SEXP nvar, SEXP nrep) {
-  COMMON(object) = &object;
-  COMMON(params) = ¶ms;
-  COMMON(skelfun) = &fun;
-  COMMON(xnames) = &statenames;
+  COMMON(object) = object;
+  COMMON(params) = params;
+  COMMON(skelfun) = fun;
+  COMMON(xnames) = statenames;
   COMMON(xdim)[0] = INTEGER(AS_INTEGER(nvar))[0];
   COMMON(xdim)[1] = INTEGER(AS_INTEGER(nrep))[0];
   COMMON(xdim)[2] = 1;
@@ -130,10 +130,10 @@
   
   PROTECT(T = NEW_NUMERIC(1));
   PROTECT(X = makearray(3,COMMON(xdim)));
-  setrownames(X,*(COMMON(xnames)),3);
+  setrownames(X,COMMON(xnames),3);
   REAL(T)[0] = *t;
   memcpy(REAL(X),y,(*neq)*sizeof(double));
-  PROTECT(dXdt = do_skeleton(*(COMMON(object)),X,T,*(COMMON(params)),*(COMMON(skelfun))));
+  PROTECT(dXdt = do_skeleton(COMMON(object),X,T,COMMON(params),COMMON(skelfun)));
   memcpy(ydot,REAL(dXdt),(*neq)*sizeof(double));
   
   UNPROTECT(3);



More information about the pomp-commits mailing list