phylopomp
Phylodynamics for POMPs
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
bare.cc File Reference
#include "genealogy.h"
#include "generics.h"
#include "internal.h"
Include dependency graph for bare.cc:

Go to the source code of this file.

Functions

SEXP curtail (SEXP State, SEXP Time, SEXP Troot)
 curtail the given genealogy
 
SEXP yaml (SEXP State)
 extract a YAML description
 
SEXP gendat (SEXP State)
 data-frame format
 

Function Documentation

◆ curtail()

SEXP curtail ( SEXP State,
SEXP Time,
SEXP Troot )

curtail the given genealogy

Definition at line 10 of file bare.cc.

10 {
11 genealogy_t A = State;
12 double t, t0;
13 t = *REAL(AS_NUMERIC(Time));
14 t0 = *REAL(AS_NUMERIC(Troot));
15 if (ISNA(t)) t = A.time();
16 if (ISNA(t0)) t0 = A.timezero();
17 A.curtail(t,t0);
18 SEXP out;
19 PROTECT(out = serial(A));
20 SET_ATTR(out,install("class"),mkString("gpgen"));
21 UNPROTECT(1);
22 return out;
23 }
Encodes a genealogy.
Definition genealogy.h:22
slate_t & timezero(void)
view/set zero time.
Definition genealogy.h:158
slate_t & time(void)
view/set current time.
Definition genealogy.h:150
void curtail(slate_t tnew, slate_t troot)
Definition genealogy.h:499
SEXP serial(const TYPE &X)
binary serialization
Definition generics.h:28
Here is the call graph for this function:

◆ gendat()

SEXP gendat ( SEXP State)

data-frame format

Definition at line 32 of file bare.cc.

32 {
33 genealogy_t A = State;
34 A.prune();
35 A.obscure();
37 return A.gendat();
38 }
genealogy_t & prune(void)
prune the tree (drop all black balls)
Definition genealogy.h:468
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:234
genealogy_t & obscure(void)
erase all deme information
Definition genealogy.h:479
void trace_lineages(void)
Definition nodeseq.h:241
Here is the call graph for this function:
Here is the caller graph for this function:

◆ yaml()

SEXP yaml ( SEXP State)

extract a YAML description

Definition at line 26 of file bare.cc.

26 {
27 genealogy_t A = State;
28 return mkString(A.yaml().c_str());
29 }
virtual std::string yaml(std::string tab="") const
machine-readable info
Definition genealogy.h:355
Here is the call graph for this function:
Here is the caller graph for this function: