#include "internal.h"
#include <Rdefines.h>
Go to the source code of this file.
◆ randwalk_perturbation()
SEXP randwalk_perturbation |
( |
SEXP |
params, |
|
|
SEXP |
rw_sd |
|
) |
| |
Definition at line 6 of file mif2.c.
8 double *xp = 0, *rw, *xrw, *xs;
9 SEXP Pnames, rwnames,
pindex;
19 PROTECT(Pnames = GET_ROWNAMES(GET_DIMNAMES(
params)));
22 PROTECT(rwnames = GET_NAMES(rw_sd));
23 nrw = LENGTH(rwnames); rw = REAL(rw_sd);
31 for (j = 0, xrw = rw; j < nrw; j++, pidx++, xrw++) {
32 for (k = 0, xs = xp+(*pidx); k <
nreps; k++, xs +=
npars) {
33 *xs += *xrw * norm_rand();
static R_INLINE SEXP matchnames(SEXP provided, SEXP needed, const char *where)