|
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) |
| std::unordered_map< name_t, std::vector< node_t * > > | children_map (void) const |
| map nodes onto vector of children | |
| std::vector< node_t * > | sorted_roots (const std::unordered_map< name_t, slate_t > &height) const |
| collect root nodes and sort them in order of decreasing subtree height | |
| std::vector< node_t * > | ladderize (std::unordered_map< name_t, std::vector< node_t * > > &children) const |
| 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, slate_t te, 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 (const std::unordered_map< name_t, ball_t * > &names) |
| std::unordered_map< name_t, node_t * > | node_map (void) const |
| map node names onto pointers | |
| 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 181 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 171 of file nodeseq.h.


|
inline |
map nodes onto vector of children
Definition at line 249 of file nodeseq.h.


|
inlineprivate |
|
inline |
drop all inline nodes i.e., those holding just one ball that is green.
Definition at line 223 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 103 of file nodeseq.h.


|
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 189 of file nodeseq.h.


|
inline |
ladderize the tree by sorting each vector in 'children' according to decreasing subtree height. Return the root nodes, sorted in the same way.
Definition at line 282 of file nodeseq.h.


|
inline |
put genealogy at time t into Newick format.
Definition at line 92 of file newick.cc.


|
inline |
|
inline |
|
inline |
|
inline |
collect root nodes and sort them in order of decreasing subtree height
Definition at line 264 of file nodeseq.h.


| 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 161 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 237 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 309 of file nodeseq.h.


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


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