[Pomp-commits] r249 - pkg/src
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu May 20 13:48:58 CEST 2010
Author: kingaa
Date: 2010-05-20 13:48:58 +0200 (Thu, 20 May 2010)
New Revision: 249
Modified:
pkg/src/pomp_internal.h
Log:
- initialize arrays with NA
Modified: pkg/src/pomp_internal.h
===================================================================
--- pkg/src/pomp_internal.h 2010-05-19 02:06:39 UTC (rev 248)
+++ pkg/src/pomp_internal.h 2010-05-20 11:48:58 UTC (rev 249)
@@ -45,11 +45,14 @@
static inline SEXP makearray (int rank, int *dim) {
int nprotect = 0;
int *dimp, k;
+ double *xp;
SEXP dimx, x;
PROTECT(dimx = NEW_INTEGER(rank)); nprotect++;
dimp = INTEGER(dimx);
for (k = 0; k < rank; k++) dimp[k] = dim[k];
PROTECT(x = allocArray(REALSXP,dimx)); nprotect++;
+ xp = REAL(x);
+ for (k = 0; k < length(x); k++) xp[k] = NA_REAL;
UNPROTECT(nprotect);
return x;
}
More information about the pomp-commits
mailing list