phylopomp
Phylodynamics for POMPs
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bare.cc
Go to the documentation of this file.
1 // Bare genealogy
2 
3 #include "genealogy.h"
4 #include "generics.h"
5 #include "internal.h"
6 
7 extern "C" {
8 
10  SEXP curtail (SEXP State, SEXP Time) {
11  genealogy_t A = State;
12  A.curtail(*REAL(AS_NUMERIC(Time)));
13  SEXP out;
14  PROTECT(out = serial(A));
15  SET_ATTR(out,install("class"),mkString("gpgen"));
16  UNPROTECT(1);
17  return out;
18  }
19 
21  SEXP yaml (SEXP State) {
22  genealogy_t A = State;
23  return mkString(A.yaml().c_str());
24  }
25 
27  SEXP gendat (SEXP State) {
28  genealogy_t A = State;
29  A.prune();
30  A.obscure();
31  A.trace_lineages();
32  return A.gendat();
33  }
34 
35 }
SEXP yaml(SEXP State)
extract a YAML description
Definition: bare.cc:21
SEXP gendat(SEXP State)
data-frame format
Definition: bare.cc:27
SEXP curtail(SEXP State, SEXP Time)
curtail the given genealogy
Definition: bare.cc:10
Encodes a genealogy.
Definition: genealogy.h:22
virtual std::string yaml(std::string tab="") const
machine-readable info
Definition: genealogy.h:352
genealogy_t & prune(void)
prune the tree (drop all black balls)
Definition: genealogy.h:465
genealogy_t & obscure(void)
erase all deme information
Definition: genealogy.h:476
void gendat(double *tout, int *anc, int *lin, int *sat, int *type, int *index, int *child) const
nodelist in data-frame format
Definition: genealogy.h:231
void curtail(slate_t tnew)
Definition: genealogy.h:496
void trace_lineages(void)
Definition: nodeseq.h:244
SEXP serial(const TYPE &X)
binary serialization
Definition: generics.h:28