#include "init.h"
#include "decls.h"
#include "pomplink.h"
Go to the source code of this file.
◆ curtail()
SEXP curtail |
( |
SEXP |
State, |
|
|
SEXP |
Time |
|
) |
| |
curtail the given genealogy
Definition at line 10 of file bare.cc.
12 A.
curtail(*REAL(AS_NUMERIC(Time)));
15 SET_ATTR(out,install(
"class"),mkString(
"gpgen"));
void curtail(slate_t tnew)
SEXP serial(const TYPE &X)
binary serialization
◆ DECLARATIONS() [1/8]
◆ DECLARATIONS() [2/8]
◆ DECLARATIONS() [3/8]
◆ DECLARATIONS() [4/8]
◆ DECLARATIONS() [5/8]
◆ DECLARATIONS() [6/8]
◆ DECLARATIONS() [7/8]
◆ DECLARATIONS() [8/8]
DECLARATIONS |
( |
TwoSpecies |
| ) |
|
◆ gendat()
SEXP gendat |
( |
SEXP |
State | ) |
|
data-frame format
Definition at line 27 of file bare.cc.
genealogy_t & prune(void)
prune the tree (drop all black balls)
genealogy_t & obscure(void)
erase all deme information
void gendat(double *tout, int *anc, int *lin, int *sat, int *type, int *index, int *child) const
nodelist in data-frame format
void trace_lineages(void)
◆ getInfo()
SEXP getInfo |
( |
SEXP |
args | ) |
|
extract requested information prune and/or obscure if requested
Definition at line 19 of file getinfo.cc.
20 const char *argname[] = {
21 "object",
"prune",
"obscure",
22 "t0",
"time",
"nsample",
"ndeme",
23 "description",
"structure",
"yaml",
"newick",
24 "lineages",
"gendat",
"genealogy"};
25 const int narg =
sizeof(argname)/
sizeof(
const char *);
27 SEXP
object = R_NilValue;
31 for (k = 0; k < narg; k++) flag[k] =
false;
34 while (args != R_NilValue) {
35 const char *name = isNull(TAG(args)) ?
"" : CHAR(PRINTNAME(TAG(args)));
42 flag[j] = *LOGICAL(AS_LOGICAL(arg));
43 }
else if (j < narg) {
44 flag[j] = *LOGICAL(AS_LOGICAL(arg));
47 err(
"unrecognized argument '%s' in '%s'.",name,__func__);
52 if (!flag[0])
err(
"no genealogy furnished to '%s'",__func__);
56 const bool *f = flag+1;
57 if (*(f++)) A.
prune();
62 PROTECT(out = NEW_LIST(nout));
63 PROTECT(outnames = NEW_CHARACTER(nout));
98 SET_ATTR(
S,install(
"class"),mkString(
"gpgen"));
102 SET_NAMES(out,outnames);
SEXP yaml(SEXP State)
extract a YAML description
SEXP gendat(SEXP State)
data-frame format
SEXP describe(const TYPE &X)
human readable output
SEXP structure(const TYPE &X)
structure in R list format
SEXP newick(const TYPE &X)
tree in newick format
SEXP lineage_count(const TYPE &G)
number of lineages through time
static size_t matchargs(const char *prov, const char **set, size_t n)
static int set_list_elem(SEXP list, SEXP names, SEXP element, const char *name, int pos)
◆ parse_newick()
SEXP parse_newick |
( |
SEXP |
X, |
|
|
SEXP |
T0, |
|
|
SEXP |
Tf |
|
) |
| |
A parser for Newick code. Returns a genealogy in the phylopomp format.
Definition at line 10 of file parse.cc.
11 PROTECT(X = AS_CHARACTER(X));
12 PROTECT(T0 = AS_NUMERIC(T0));
13 PROTECT(Tf = AS_NUMERIC(Tf));
14 double t0 = *REAL(T0);
15 double tf = *REAL(Tf);
17 std::string x = CHAR(STRING_ELT(X,0));
◆ R_init_phylopomp()
void R_init_phylopomp |
( |
DllInfo * |
info | ) |
|
Definition at line 48 of file init.c.
51 R_useDynamicSymbols(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");
static const R_CallMethodDef extMethods[]
get_userdata_int_t * get_userdata_int
static const R_CallMethodDef callMethods[]
get_userdata_t * get_userdata
get_userdata_double_t * get_userdata_double
◆ yaml()
extract a YAML description
Definition at line 21 of file bare.cc.
23 return mkString(A.
yaml().c_str());
virtual std::string yaml(std::string tab="") const
machine-readable info
◆ callMethods
const R_CallMethodDef callMethods[] |
|
static |
Initial value:= {
{
"curtail", (DL_FUNC) &
curtail, 2},
{
"yaml", (DL_FUNC) &
yaml, 1},
{
"gendat", (DL_FUNC) &
gendat, 1},
{NULL, NULL, 0}
}
SEXP gendat(SEXP)
data-frame format
SEXP curtail(SEXP, SEXP)
curtail the given genealogy
SEXP parse_newick(SEXP, SEXP, SEXP)
SEXP yaml(SEXP)
extract a YAML description
Definition at line 27 of file init.c.
◆ extMethods
const R_CallMethodDef extMethods[] |
|
static |
Initial value:= {
{
"getInfo", (DL_FUNC) &
getInfo, -1},
{NULL, NULL, 0}
}
Definition at line 43 of file init.c.
◆ get_userdata
get_userdata_t* get_userdata |
Definition at line 5 of file init.c.
◆ get_userdata_double
get_userdata_double_t* get_userdata_double |
Definition at line 6 of file init.c.
◆ get_userdata_int
get_userdata_int_t* get_userdata_int |
Definition at line 7 of file init.c.