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 | |
nodeseq_t & | operator+= (nodeseq_t &other) |
merge two node sequences | |
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 | swap (ball_t *a, ball_t *b) |
swap balls a and b, wherever they lie | |
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 | comb (void) |
void | trace_lineages (void) |
std::string | describe (void) const |
human-readable info | |
virtual std::string | yaml (std::string tab="") const |
human- & machine-readable info | |
SEXP | structure (void) const |
R list description. | |
std::string | newick (slate_t t) const |
put genealogy at time t into Newick format. | |
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) |
Static Private Member Functions | |
static bool | compare (node_t *p, node_t *q) |
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 176 of file nodeseq.h.
|
inline |
|
inlineprivate |
|
inline |
pass through the sequence, dropping superfluous nodes i.e., those holding just one ball that is green.
Definition at line 207 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 184 of file nodeseq.h.
|
inlineprivate |
|
inline |
|
inline |
put genealogy at time t
into Newick format.
Definition at line 287 of file nodeseq.h.
|
inline |
|
inline |
Needed in deserialization. This function repairs the links green balls and their names.
Definition at line 82 of file nodeseq.h.
|
inline |
|
inline |
R list description.
Definition at line 276 of file nodeseq.h.
swap balls a and b, wherever they lie
Definition at line 166 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 228 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 241 of file nodeseq.h.
|
inlinevirtual |
human- & machine-readable info
Reimplemented in genealogy_t.
Definition at line 267 of file nodeseq.h.
binary deserialization
Definition at line 56 of file nodeseq.h.