Microsimulation API

/home/marcle/src/R/microsimulation/src/init.c
Go to the documentation of this file.
1 #include <R.h>
2 #include <Rinternals.h>
3 #include <stdlib.h> // for NULL
4 #include <R_ext/Rdynload.h>
5
6 /* FIXME:
7 Check these declarations against the C/Fortran source code.
8 */
9
10 /* .C calls */
11 extern void r_get_user_random_seed(void *);
12 extern void r_next_rng_substream();
13 extern void r_rng_advance_substream(void *, void *);
14 extern void r_set_user_random_seed(void *);
15 extern void r_create_current_stream();
16 extern void r_remove_current_stream();
17
18 /* .Call calls */
19 extern SEXP callCalibrationSimulation(SEXP);
20 extern SEXP callIllnessDeath(SEXP);
21 extern SEXP callPersonSimulation(SEXP, SEXP);
22 extern SEXP callSimplePerson(SEXP);
23 extern SEXP callSimplePerson2(SEXP);
24 extern SEXP pqueue__cancel(SEXP, SEXP);
25 extern SEXP pqueue__clear(SEXP);
26 extern SEXP pqueue__empty(SEXP);
27 extern SEXP pqueue__new(SEXP);
28 extern SEXP pqueue__pop(SEXP);
29 extern SEXP pqueue__push(SEXP, SEXP, SEXP);
30
31 static const R_CMethodDef CEntries[] = {
32 {"r_get_user_random_seed", (DL_FUNC) &r_get_user_random_seed, 1},
33 {"r_next_rng_substream", (DL_FUNC) &r_next_rng_substream, 0},
34 {"r_rng_advance_substream", (DL_FUNC) &r_rng_advance_substream, 2},
35 {"r_set_user_random_seed", (DL_FUNC) &r_set_user_random_seed, 1},
36 {"r_create_current_stream", (DL_FUNC) &r_create_current_stream, 0},
37 {"r_remove_current_stream", (DL_FUNC) &r_remove_current_stream, 0},
38 {NULL, NULL, 0}
39 };
40
41 static const R_CallMethodDef CallEntries[] = {
42 {"callCalibrationSimulation", (DL_FUNC) &callCalibrationSimulation, 1},
43 {".callIllnessDeath", (DL_FUNC) &callIllnessDeath, 1},
44 {".callPersonSimulation", (DL_FUNC) &callPersonSimulation, 2},
45 {".callSimplePerson", (DL_FUNC) &callSimplePerson, 1},
46 {".callSimplePerson2", (DL_FUNC) &callSimplePerson2, 1},
47 {"pqueue__cancel", (DL_FUNC) &pqueue__cancel, 2},
48 {"pqueue__clear", (DL_FUNC) &pqueue__clear, 1},
49 {"pqueue__empty", (DL_FUNC) &pqueue__empty, 1},
50 {"pqueue__new", (DL_FUNC) &pqueue__new, 1},
51 {"pqueue__pop", (DL_FUNC) &pqueue__pop, 1},
52 {"pqueue__push", (DL_FUNC) &pqueue__push, 3},
53 {NULL, NULL, 0}
54 };
55
56 void R_init_microsimulation(DllInfo *dll)
57 {
58 R_registerRoutines(dll, CEntries, CallEntries, NULL, NULL);
59 R_useDynamicSymbols(dll, TRUE);
60 }
callCalibrationSimulation
SEXP callCalibrationSimulation(SEXP)
r_remove_current_stream
void r_remove_current_stream()
A utility function to remove the current_stream. Used when finalising the microsimulation package in ...
Definition: microsimulation.cc:38
callSimplePerson
SEXP callSimplePerson(SEXP)
R_init_microsimulation
void R_init_microsimulation(DllInfo *dll)
Definition: init.c:56
pqueue__new
SEXP pqueue__new(SEXP)
Definition: pqueue.cpp:128
pqueue__push
SEXP pqueue__push(SEXP, SEXP, SEXP)
Definition: pqueue.cpp:134
r_set_user_random_seed
void r_set_user_random_seed(void *)
CallEntries
static const R_CallMethodDef CallEntries[]
Definition: init.c:41
r_next_rng_substream
void r_next_rng_substream()
A utility function to move to the next user random stream for the simulation.
Definition: microsimulation.cc:60
pqueue__cancel
SEXP pqueue__cancel(SEXP, SEXP)
Definition: pqueue.cpp:146
callPersonSimulation
SEXP callPersonSimulation(SEXP, SEXP)
pqueue__clear
SEXP pqueue__clear(SEXP)
Definition: pqueue.cpp:158
r_rng_advance_substream
void r_rng_advance_substream(void *, void *)
CEntries
static const R_CMethodDef CEntries[]
Definition: init.c:31
r_create_current_stream
void r_create_current_stream()
A utility function to create the current_stream. Used when initialising the microsimulation package i...
Definition: microsimulation.cc:32
callSimplePerson2
SEXP callSimplePerson2(SEXP)
pqueue__pop
SEXP pqueue__pop(SEXP)
Definition: pqueue.cpp:141
callIllnessDeath
SEXP callIllnessDeath(SEXP)
Definition: illness-death.cpp:73
r_get_user_random_seed
void r_get_user_random_seed(void *)
pqueue__empty
SEXP pqueue__empty(SEXP)
Definition: pqueue.cpp:153