21 template <
class POPN,
size_t NDEME = 1>
27 const static size_t ndeme = NDEME;
41 o = (
reinterpret_cast<const popul_t&
>(A) >> o);
48 o = (o >>
reinterpret_cast<popul_t&
>(A));
70 err(
"in %s (%s line %d): cannot deserialize a NULL.",
71 __func__,__FILE__,__LINE__);
72 PROTECT(o = AS_RAW(o));
106 int count = popul_t::play(tfin);
121 std::string
yaml (std::string tab =
"")
const {
122 std::string t = tab +
" ";
160 for (
int j = 0; j < m; j++) {
168 for (
ball_it a = p->begin(); a != p->end(); a++) {
177 for (
ball_it a = p->begin(); a != p->end(); a++) {
SEXP yaml(SEXP State)
extract a YAML description
Balls function as pointers.
name_t deme(void) const
view deme
node_t * holder(void) const
in whose pocket do I lie?
ball_t * birth(ball_t *a, slate_t t, name_t d)
birth into deme d
SEXP structure(void) const
R list description.
std::string newick(void) const
put genealogy at current time into Newick format.
virtual std::string yaml(std::string tab="") const
machine-readable info
void death(ball_t *a, slate_t t)
death
size_t bytesize(void) const
size of serialized binary form
std::string describe(void) const
human-readable info
std::pair< node_it, node_it > extant(void) const
slate_t timezero(void) const
get zero time.
slate_t & time(void)
view/set current time.
ball_t * migrate(ball_t *a, slate_t t, name_t d=0)
movement into deme d
void sample_death(ball_t *a, slate_t t)
insert a sample node and simultaneously terminate the lineage
ball_t * graft(slate_t t, name_t d)
graft a new lineage into deme d
void sample(ball_t *a, slate_t t)
insert a sample node
void lineage_count(double *tout, int *deme, int *ell, int *sat, int *etype) const
pocket_t * random_balls(name_t i=0, int n=1) const
choose a random set of n balls from deme i
ball_t * random_ball(name_t i=0) const
choose one random ball from deme i
Encodes the master process.
std::string yaml(std::string tab="") const
machine/human readable info
slate_t time(void) const
current time
void birth(name_t i=0, name_t j=0, int n=1)
n births into deme j with parent in deme i
int play(double tfin)
runs the process to time tfin
master_t & operator=(const master_t &A)
copy assignment operator
friend raw_t * operator>>(const master_t &A, raw_t *o)
binary serialization
std::string describe(void) const
human-readable info
void sample(name_t i=0, int n=1)
sample in deme i
master_t(raw_t *o)
constructor from serialized binary form
void death(name_t i=0)
death in deme i
master_t(master_t &&)=default
move constructor
void jump(int e)
makes a jump
void rinit(void)
initialize the state
slate_t timezero(void) const
get zero-time
void graft(name_t i=0, int m=1)
new root in deme i
std::string newick(void) const
tree in Newick format
master_t(const master_t &A)
copy constructor
static const size_t ndeme
master_t(SEXP o)
constructor from RAW SEXP (containing binary serialization)
inventory_t< ndeme > inventory
~master_t(void)
destructor
size_t bytesize(void) const
size of serialized binary form
SEXP lineage_count(void) const
lineage count table
void migrate(name_t i=0, name_t j=0)
migration from deme i to deme j
void sample_death(name_t i=0, int n=1)
sample_death in deme i
SEXP structure(void) const
structure in R list format
A pocket is a set of balls.
std::set< ball_t *, ball_order >::const_iterator ball_it