|
phylopomp
Phylodynamics for POMPs
|
A sequence of nodes. More...
#include <nodeseq.h>


Public Member Functions | |
| ~nodeseq_t (void) | |
| destructor | |
| size_t | bytesize (void) const |
| size of serialized binary form | |
| void | sort (void) |
| order nodes in order of increasing time | |
| pocket_t * | colored (color_t col) const |
| Get all balls of a color. | |
| size_t | ntime (slate_t t) const |
| Number of distinct timepoints. | |
| size_t | length (void) const |
| Number of nodes in the sequence. | |
| node_t * | position (int n) |
| traverse to nth node, retrieve pointer | |
| void | move (ball_t *b, node_t *p, node_t *q) |
| move ball b from p to q | |
| void | swap (ball_t *a, ball_t *b) |
| swap balls a and b, wherever they lie | |
| void | attach (node_t *p, node_t *q) |
| void | detach (node_t *p) |
| void | add (node_t *p, ball_t *a) |
| void | drop (ball_t *a) |
| void | destroy_node (node_t *p) |
| remove a dead root node | |
| void | weed (void) |
| drop all dead roots | |
| void | comb (void) |
| void | trace_lineages (void) |
| string_t | yaml (string_t tab="") const |
| human/machine-readable info | |
| SEXP | structure (void) const |
| R list description. | |
| string_t | newick (slate_t t, bool showdeme, bool extended) const |
put genealogy at time t into Newick format. | |
Static Public Member Functions | |
| static bool | compare (node_t *p, node_t *q) |
Private Member Functions | |
| void | clean (void) |
| clean up: delete all nodes, reset globals | |
| void | repair_owners (std::unordered_map< name_t, ball_t * > &names) |
| slate_t | dawn (void) const |
| Earliest time in the sequence. | |
| slate_t | dusk (void) const |
| Latest time in the sequence. | |
| void | trace_lineage (ball_t *b, name_t u) |
Friends | |
| raw_t * | operator>> (const nodeseq_t &G, raw_t *o) |
| binary serialization | |
| raw_t * | operator>> (raw_t *o, nodeseq_t &G) |
| binary deserialization | |
|
inline |
add node p; take as parent the node holding ball a. the deme of p is changed to match that of a
Definition at line 184 of file nodeseq.h.


attach node q as descendant of node p. note that this does not push q into the nodeseq.
Definition at line 174 of file nodeseq.h.


|
inline |
|
inlineprivate |
|
inline |
drop all inline nodes i.e., those holding just one ball that is green.
Definition at line 226 of file nodeseq.h.


Order relation among nodes. An ancestor node should always come before its descendants. Nodes should be ordered by time, then arbitrarily.
Definition at line 95 of file nodeseq.h.


|
inlineprivate |
|
inline |
|
inline |
|
inline |
drop the black ball 'a' and the node if either (1) the node becomes thereby a dead root, or (2) the node's pocket becomes thereby empty.
Definition at line 192 of file nodeseq.h.


|
inlineprivate |
|
inline |
| string_t nodeseq_t::newick | ( | slate_t | t, |
| bool | showdeme, | ||
| bool | extended ) const |
put genealogy at time t into Newick format.
Definition at line 78 of file newick.cc.


|
inline |
|
inline |
Needed in deserialization. This function repairs the links green balls and their names.
Definition at line 80 of file nodeseq.h.


|
inline |
| SEXP nodeseq_t::structure | ( | void | ) | const |
R list description.
Definition at line 70 of file structure.cc.


swap balls a and b, wherever they lie
Definition at line 164 of file nodeseq.h.


trace back a single lineage. this results in the deme slot for all green balls along the lineage of 'b' begin replaced by the lineage of 'b'.
Definition at line 240 of file nodeseq.h.


|
inline |
trace back all sample lineages. this results in the deme slots of all green balls being replaced by the unique names of the lineages they trace.
Definition at line 253 of file nodeseq.h.


|
inline |
drop all dead roots
Definition at line 214 of file nodeseq.h.


| string_t nodeseq_t::yaml | ( | string_t | tab = "" | ) | const |
binary deserialization
Definition at line 54 of file nodeseq.h.