Displaying 1 result from an estimated 1 matches for "randcal".
Did you mean:
randal
2002 Jan 24
2
random number generation issues with r and compiled C code
...all
GetRNGstate() once before generating all random numbers necessary and then
call it again when I have finished calling all the random variates? Or
does it not matter that much?
Also, is scoping a problem here? I have not tried this yet, but suppose I
was to do as follows
foo()
{
GetRNGstate();
randcall();
randcall();
PutRNGetate();
}
where
randcall()
{
int i;
for(i=0; i < 100; i++)
cout << unif_rand();
}
would this be Ok, or do calls to GetRNGstate() and PutRNGetate() have
to be inside randcall()? If this is the case, then the above strategy
of reading in seed as early as possible a...