Matteo Fasiolo
2013-06-07 14:22:15 UTC
Dear Rcpp experts,
I would like to be able to store the R random seed from a Rcpp
function and then reset it. In other words I would like to replicate
the following code in Rcpp:
savedSeed <- .Random.seed
x <- Rfunction(parameters1);
.Random.seed <- savedSeed
x1 <- Rfunction(parameters2);
where Rfunction simulates some random numbers and uses them
but with different parameter values.
Is it possible to do something similar in Rcpp?
Probably using GetRNGstate() and PutRNGstate()?
Thanks,
Matteo
I would like to be able to store the R random seed from a Rcpp
function and then reset it. In other words I would like to replicate
the following code in Rcpp:
savedSeed <- .Random.seed
x <- Rfunction(parameters1);
.Random.seed <- savedSeed
x1 <- Rfunction(parameters2);
where Rfunction simulates some random numbers and uses them
but with different parameter values.
Is it possible to do something similar in Rcpp?
Probably using GetRNGstate() and PutRNGstate()?
Thanks,
Matteo