SCM

SCM Repository

[rmetrics] Annotation of /pkg/randtoolbox/src/init.c
ViewVC logotype

Annotation of /pkg/randtoolbox/src/init.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3644 - (view) (download) (as text)

1 : dutangc 3644 /**********************************************************************************************
2 :     * Copyright (c) 2008 Christophe Dutang *
3 :     * *
4 :     * This program is free software; you can redistribute it and/or modify *
5 :     * it under the terms of the GNU General Public License as published by *
6 :     * the Free Software Foundation; either version 2 of the License, or *
7 :     * (at your option) any later version. *
8 :     * *
9 :     * This program is distributed in the hope that it will be useful, *
10 :     * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 :     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 :     * GNU General Public License for more details. *
13 :     * *
14 :     * You should have received a copy of the GNU General Public License *
15 :     * along with this program; if not, write to the *
16 :     * Free Software Foundation, Inc., *
17 :     * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA *
18 :     * *
19 :     **********************************************************************************************/
20 :     /*
21 :     * Torus algorithm to generate quasi random numbers
22 :     *
23 :     * init file
24 :     *
25 :     * Native routines registration, see 'writing R extensions'
26 :     *
27 :     */
28 :    
29 :     #include <Rinternals.h>
30 :     #include <R_ext/Rdynload.h>
31 :     #include "randtoolbox.h"
32 :     #include "testrng.h"
33 :    
34 :     //table of registration
35 :     static const R_CallMethodDef callMethods[] =
36 :     {
37 :     {"doTorus", (DL_FUNC) &doTorus, 6},
38 :     {"doSetSeed", (DL_FUNC) &doSetSeed, 1},
39 :     {"doCongruRand", (DL_FUNC) &doCongruRand, 6},
40 :     {"doSFMersenneTwister", (DL_FUNC) &doSFMersenneTwister, 4},
41 :     {"doPokerTest", (DL_FUNC) &doPokerTest, 3},
42 :     {"doCollisionTest", (DL_FUNC) &doCollisionTest, 3},
43 :     {"doWELL", (DL_FUNC) &doWELL, 5},
44 :     {"doKnuthTAOCP", (DL_FUNC) &doKnuthTAOCP, 2},
45 :     {NULL, NULL, 0}
46 :     };
47 :    
48 :     void R_init_randtoolbox(DllInfo *info)
49 :     {
50 :     //register method accessed with .Call
51 :     R_registerRoutines(info, NULL, callMethods, NULL, NULL);
52 :     //make randtoolbox C functions available from other packages
53 :     R_RegisterCCallable("randtoolbox", "torus", (DL_FUNC) torus);
54 :     R_RegisterCCallable("randtoolbox", "setSeed", (DL_FUNC) setSeed);
55 :     R_RegisterCCallable("randtoolbox", "congruRand", (DL_FUNC) congruRand);
56 :     R_RegisterCCallable("randtoolbox", "SFmersennetwister", (DL_FUNC) SFmersennetwister);
57 :     R_RegisterCCallable("randtoolbox", "pokerTest", (DL_FUNC) pokerTest);
58 :     R_RegisterCCallable("randtoolbox", "collisionTest", (DL_FUNC) collisionTest);
59 :     R_RegisterCCallable("randtoolbox", "WELLrng", (DL_FUNC) WELLrng);
60 :     R_RegisterCCallable("randtoolbox", "knuthTAOCP", (DL_FUNC) knuthTAOCP);
61 :     }

root@r-forge.r-project.org
ViewVC Help
Powered by ViewVC 1.0.0  
Thanks to:
Vienna University of Economics and Business Powered By FusionForge