Displaying 2 results from an estimated 2 matches for "gslrng".
Did you mean:
gsl_rng
2009 Dec 22
0
Rcpp 0.7.0: R/C++ integration now even easier
...e code below) but let's just look
at one example of using GNU GSL functions for illustrative purposes (as you
wouldn't need this to access random-number generators as R has its own).
Consider this R code snippet:
## use Rcpp to pass down a parameter for the seed, and a vector size
gslrng <- '
int seed = RcppSexp(s).asInt();
int len = RcppSexp(n).asInt();
gsl_rng *r;
gsl_rng_env_setup();
std::vector<double> v(len);
r = gsl_rng_alloc (gsl_rng_default);
gsl_rng_set (r, (unsigned long) seed);
for (int i=0; i<len...
2009 Dec 22
0
Rcpp 0.7.0: R/C++ integration now even easier
...e code below) but let's just look
at one example of using GNU GSL functions for illustrative purposes (as you
wouldn't need this to access random-number generators as R has its own).
Consider this R code snippet:
## use Rcpp to pass down a parameter for the seed, and a vector size
gslrng <- '
int seed = RcppSexp(s).asInt();
int len = RcppSexp(n).asInt();
gsl_rng *r;
gsl_rng_env_setup();
std::vector<double> v(len);
r = gsl_rng_alloc (gsl_rng_default);
gsl_rng_set (r, (unsigned long) seed);
for (int i=0; i<len...