phylopomp
Phylodynamics for POMPs
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
init.c
Go to the documentation of this file.
1 #include "init.h"
2 #include "decls.h"
3 #include "pomplink.h"
4 
5 get_userdata_t *get_userdata;
6 get_userdata_double_t *get_userdata_double;
7 get_userdata_int_t *get_userdata_int;
8 
9 SEXP parse_newick (SEXP, SEXP, SEXP);
10 SEXP getInfo (SEXP);
11 SEXP curtail (SEXP, SEXP);
12 SEXP yaml (SEXP);
13 SEXP gendat (SEXP);
14 
15 // for each model, there must be
16 // one DECLARATIONS line and one METHODS line.
17 
19 DECLARATIONS(Moran);
20 DECLARATIONS(S2I2R2);
25 DECLARATIONS(TwoSpecies);
26 
27 static const R_CallMethodDef callMethods[] = {
28  METHODS(LBDP),
29  METHODS(Moran),
30  METHODS(S2I2R2),
31  METHODS(SEIR),
32  METHODS(SI2R),
33  METHODS(SIIR),
34  METHODS(SIR),
35  METHODS(TwoSpecies),
36  {"parse_newick", (DL_FUNC) &parse_newick, 3},
37  {"curtail", (DL_FUNC) &curtail, 2},
38  {"yaml", (DL_FUNC) &yaml, 1},
39  {"gendat", (DL_FUNC) &gendat, 1},
40  {NULL, NULL, 0}
41 };
42 
43 static const R_CallMethodDef extMethods[] = {
44  {"getInfo", (DL_FUNC) &getInfo, -1},
45  {NULL, NULL, 0}
46 };
47 
48 void R_init_phylopomp (DllInfo *info) {
49  // Register routines
50  R_registerRoutines(info,NULL,callMethods,NULL,extMethods);
51  R_useDynamicSymbols(info,TRUE);
52  // R_useDynamicSymbols(info,FALSE);
53  // R_forceSymbols(info,TRUE);
54  get_userdata = (get_userdata_t*) R_GetCCallable("pomp","get_userdata");
55  get_userdata_double = (get_userdata_double_t*) R_GetCCallable("pomp","get_userdata_double");
56  get_userdata_int = (get_userdata_int_t*) R_GetCCallable("pomp","get_userdata_int");
57 }
void R_init_phylopomp(DllInfo *info)
Definition: init.c:48
SEXP gendat(SEXP)
data-frame format
Definition: bare.cc:27
static const R_CallMethodDef extMethods[]
Definition: init.c:43
SEXP curtail(SEXP, SEXP)
curtail the given genealogy
Definition: bare.cc:10
SEXP parse_newick(SEXP, SEXP, SEXP)
Definition: parse.cc:10
get_userdata_int_t * get_userdata_int
Definition: init.c:7
DECLARATIONS(LBDP)
SEXP getInfo(SEXP)
Definition: getinfo.cc:19
static const R_CallMethodDef callMethods[]
Definition: init.c:27
get_userdata_t * get_userdata
Definition: init.c:5
get_userdata_double_t * get_userdata_double
Definition: init.c:6
SEXP yaml(SEXP)
extract a YAML description
Definition: bare.cc:21
#define METHODS(X)
Definition: init.h:14