Re: [R] random numbers 
On 30 June 2007 at 12:12, Ross Boylan wrote:
| I call C++ code from R to generate simulated data.  I'm doing this on a
| cluster, and use rmpi and rsprng.  While rsprng randomizes R-level
| random numbers (e.g., from runif), it has no effect on the C code, which
| is completely SPRNG and MPI ignorant.
| 
| Currently I generate a seed to pass into the C code, using
| as.integer(runif(1, max=.Machine$integer.max)-.Machine$integer.max/2)
| It seems to work.
| 
| Any comments on this approach?  Here are some issues I see:

I may be missing something but given that rsprng is running on your cluster,
you are bound to also have sprng itself -- so why don't you use that from C
or C++  for this purpose?

Hth, Dirk

-- 
Hell, there are no rules here - we're trying to accomplish something. 
                                                  -- Thomas A. Edison

______________________________________________
R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

