[Rd] Re: R-devel Digest, Vol 15, Issue 26

Josef Leydold leydold at statistik.wu-wien.ac.at
Fri May 28 13:37:16 CEST 2004


Hi,

I am writing a package that provides an interface to other uniform
random number generators. It uses RNGkind(kind="user-supplied") and a
function double *user_unif_rand() as described in the help page
"Random.user". When looking into CRAN I found three other packages
that provide such a function in the DLL that they contribute:
rlecuyer, rsprng, and SuppDists (where it is currently disabled). 
When loading two of thes then the functionality of at least one these
packages is affected. Moreover, a user cannot add his own random
number generator. Probably this is not a problem at all and will not
become a problem. Nevertheless, ...

Is it possible and desired to add the optinional argument PACKAGE to
RNGkind similarly to the .Call() function i.e. to have

RNGkind(kind="user-supplied", PACKAGE="mypackage") ?


When looking at the sources I think it should be straight forward
by extending

typedef struct {
    RNGtype kind;
    N01type Nkind;
    char *name; /* print name */
    int n_seed; /* length of seed vector */
    Int32 *i_seed;
    char *package;   /* <-- added */
} RNGTAB;

and changing the corresponding calls in src/main/RNG.c.

If the anser is yes, maybe I could try to provide a patch for RNG.c.
The only thing I do not fully understand are the entries in 
./src/main/names.c (but I have not studied the syntax of this file in
detail). 

Josef




-- 


-----------------------------------------------------------------------------
Josef Leydold     |     University of Economics and Business Administration
                  |     Department for Applied Statistics and Data Processing
-----------------------------------------------------------------------------
Augasse 2-6       |     Tel.   *43/1/31336-4695
A-1090 Vienna     |     FAX    *43/1/31336-738
European Union    |     email  Josef.Leydold at statistik.wu-wien.ac.at
-----------------------------------------------------------------------------
Alles Unglueck kam daher, dass die Denkenden nicht mehr handeln konnten,
und die Handelnden keine Zeit mehr fanden zu denken.       (Marlen Haushofer)



More information about the R-devel mailing list