From htang at hpl.hp.com  Mon Jun  2 10:36:33 2003
From: htang at hpl.hp.com (htang@hpl.hp.com)
Date: Mon Jun  2 09:36:49 2003
Subject: [Rd] wishlist: add get_seed() function to standalone R library
	(PR#3160)
Message-ID: <200306020736.h527aX2b001447@pubhealth.ku.dk>

Full_Name: Hsiu-Khuern Tang
Version: 1.7.0
OS: Debian GNU/Linux unstable
Submission from: (NULL) (66.32.185.71)


Hi all,

   This report is about the use of R as a standalone library, for linking with a
C program, for example.

   I have found it useful to be able to save the seeds of a random number
generator and restore it in a subsequent invocation of that program.  This
ensures continuity from one invocation to the next.  The file
src/nmath/standalone/sunif.c contains the function set_seed() for setting the
seeds of the Marsaglia-multicarry RNG; it would be nice to have get_seed()
defined simply as follows:

void get_seed(unsigned int *i1, unsigned int *i2)
{
    *i1 = I1; *i2 = I2;
}

Also, Rmath.h will have to contain the function prototype declaration for
get_seed.

Thanks a lot!

Best,
Hsiu-Khuern Tang.


[Rd] wishlist: add get_seed() function to standalone R library (PR#3160)
htang@hpl.hp.com