search for: rand_unif

Displaying 2 results from an estimated 2 matches for "rand_unif".

Did you mean: rand_unix
2001 Jul 14
1
Calling rand_unif() from fortran
What is the necesary incantation to call rand_unif() from a fortran routine? Just inserting rand_unif() into the fortran code compiles OK, but won't dyn.load(): > dyn.load("forest.so") Error in dyn.load(x, as.logical(local), as.logical(now)) : unable to load shared library "/home/warnes/R/forest/forest.so": /home/w...
2006 Dec 14
1
Detecting compilation under R
...ple, suppose I have some C that uses GSL to get a random number if its a standalone program, or uses R's internals if its being compiled to run in R. I want to do something like: #ifdef USING_R #include <R.h> #else #include <gsl_random.h> #endif and then: #ifdef USING_R x = rand_unif(0.0,1.0); #else x = gsl_runif(0.0,1.0); #endif (cant remember the exact names but hopefully you get the idea). This fails because USING_R is only set when R.h is included. Are there any preprocessor definitions set by R CMD SHLIB and R CMD BUILD that I can test against? Of course I can...