SCM

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 6114, Wed Feb 21 13:25:59 2018 UTC revision 6115, Tue Mar 20 14:26:58 2018 UTC
# Line 96  Line 96 
96  /* .Fortran calls defined LowDiscrepancy.f  /* .Fortran calls defined LowDiscrepancy.f
97   * C version of these Fortran routines are halton_c() and sobol_c() in randtoolbox.c   * C version of these Fortran routines are halton_c() and sobol_c() in randtoolbox.c
98   */   */
99  /* DOES NOT WORK  /* DOES NOT WORK*/
100  extern void F77_NAME(halton_f)(void *, void *, void *, void *, void *, void *, void *);  extern void F77_NAME(halton_f)(void *, void *, void *, void *, void *, void *, void *);
101  extern void F77_NAME(sobol_f)(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);  extern void F77_NAME(sobol_f)(void *, void *, void *, void *, void *, void *, void *, void *, void *, void *, void *);
102    
103  //table of registration routines accessed with .Fortran()  //table of registration routines accessed with .Fortran()
104  static const R_FortranMethodDef FortranEntries[] = {  static const R_FortranMethodDef FortranEntries[] = {
105    {"halton_f", (DL_FUNC) &F77_NAME(halton_f),  7},    {"halton_f", (DL_FUNC) &F77_NAME(halton_f),  7}, //LowDiscrepancy.f
106    {"sobol_f", (DL_FUNC) &F77_NAME(sobol_f),  11},    {"sobol_f", (DL_FUNC) &F77_NAME(sobol_f),  11}, //LowDiscrepancy.f
107    {NULL, NULL, 0}    {NULL, NULL, 0}
108  };*/  };
109    
110    
111  //there is no routine accessed with .External()  //there is no routine accessed with .External()
# Line 114  Line 114 
114  void R_init_randtoolbox(DllInfo *dll)  void R_init_randtoolbox(DllInfo *dll)
115  {  {
116    //register method accessed with .C, .Call, .Fortran, .External respectively    //register method accessed with .C, .Call, .Fortran, .External respectively
117    R_registerRoutines(dll, CEntries, CallEntries, NULL, NULL);    R_registerRoutines(dll, CEntries, CallEntries, FortranEntries, NULL);
118    
119      /*dynamic lookup only for
120      double *user_unif_rand(void);
121      void user_unif_init(unsigned int seed);
122      in src/runifInterface.h*/
123    R_useDynamicSymbols(dll, TRUE);    R_useDynamicSymbols(dll, TRUE);
124    
125    
126    //make randtoolbox C functions available for other packages    //make randtoolbox C functions available for other packages
127    R_RegisterCCallable("randtoolbox", "torus", (DL_FUNC) torus);    R_RegisterCCallable("randtoolbox", "torus", (DL_FUNC) torus);
128    R_RegisterCCallable("randtoolbox", "halton_c", (DL_FUNC) halton_c);    R_RegisterCCallable("randtoolbox", "halton_c", (DL_FUNC) halton_c);
# Line 128  Line 134 
134    R_RegisterCCallable("randtoolbox", "collisionTest", (DL_FUNC) collisionTest);    R_RegisterCCallable("randtoolbox", "collisionTest", (DL_FUNC) collisionTest);
135    R_RegisterCCallable("randtoolbox", "knuthTAOCP", (DL_FUNC) knuthTAOCP);    R_RegisterCCallable("randtoolbox", "knuthTAOCP", (DL_FUNC) knuthTAOCP);
136    
137    //retrieve WELL rng entry point in the rngWELL pkg    //retrieve RNG function coming from rngWELL package, see files rngWELL.c(h) in that pkg
138    WELLrng = (void (*) (double *, int, int, int, int, int)) R_GetCCallable("rngWELL", "WELLrng");    WELLrng = (void (*) (double *, int, int, int, int, int)) R_GetCCallable("rngWELL", "WELLrng");
139    WELL_get_set_entry_point =(void (*) (void (*)())) R_GetCCallable("rngWELL", "WELL_get_set_entry_point");    WELL_get_set_entry_point =(void (*) (void (*)())) R_GetCCallable("rngWELL", "WELL_get_set_entry_point");
140    /*getRngWELL = (void (*) (int *, int *, unsigned int *)) R_GetCCallable("rngWELL", "getRngWELL");    /* // well RNG function coming from rngWELL package, see files runifInterface.c(h) in that pkg
141      getRngWELL = (void (*) (int *, int *, unsigned int *)) R_GetCCallable("rngWELL", "getRngWELL");
142     putRngWELL = (void (*) (int *, int *, unsigned int *)) R_GetCCallable("rngWELL", "putRngWELL");     putRngWELL = (void (*) (int *, int *, unsigned int *)) R_GetCCallable("rngWELL", "putRngWELL");
143     initMT2002 = (void (*) (unsigned int *, int *, unsigned int *)) R_GetCCallable("rngWELL", "initMT2002");*/     initMT2002 = (void (*) (unsigned int *, int *, unsigned int *)) R_GetCCallable("rngWELL", "initMT2002");*/
144    
145    
146  }  }
147    

Legend:
Removed from v.6114  
changed lines
  Added in v.6115

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