Skip to content
Prev 4329 / 10988 Next

[Rcpp-devel] A simple List example that has me stumped

Hi Gang:

For me, the following returns a 1 instead of a 2.  Any ideas?

mcmc <- list(names=list("M", "burnin", "thin", "save"),
              save=list("beta", "rho", "mu", "theta"),
              M=2, burnin=0, thin=1)

check1 <- NULL

check1 <- cxxfunction(signature(arg1="list", arg2="list", arg3="list"),
                       body='
List list3(arg3), save=list3["save"];

const int burnin=list3["burnin"], M=list3["M"], thin=list3["thin"], 
m=save.size();
return wrap(M);
',
                       plugin="Rcpp")

(GS <- check1(NULL, NULL, mcmc))

Thanks