Template Struct table_collection

Struct Documentation

template<typename NodeTableType, typename EdgeTableType, typename SiteTableType, typename MutationTableType>
struct fwdpp::ts::table_collection

A collection of tables for a single simulation.

Version

0.7.0 Added to fwdpp

Version

0.9.0 Made a template class

Public Types

using node_table = NodeTableType
using edge_table = EdgeTableType
using site_table = SiteTableType
using mutation_table = MutationTableType
using edge_t = typename EdgeTableType::value_type
using node_t = typename NodeTableType::value_type
using site_t = typename SiteTableType::value_type
using mutation_t = typename MutationTableType::value_type

Public Functions

table_collection(const double maxpos)
table_collection(const table_index_t num_initial_nodes, const double initial_time, table_index_t pop, const double maxpos)
void clear() noexcept

Clears internal vectors.

void record_preserved_nodes(const std::vector<table_index_t> &node_ids)

Take a list of nodes to record as “ancient samples”. Throws an exception if the nodes are already recorded as such.

table_index_t push_back_node(double time, std::int32_t pop)
template<typename ...args>
table_index_t emplace_back_node(args&&... Args)
std::size_t push_back_edge(double l, double r, table_index_t parent, table_index_t child)
template<typename ...args>
std::size_t emplace_back_edge(args&&... Args)
template<typename ...args>
std::size_t push_back_site(args&&... Args)
template<typename ...args>
std::size_t emplace_back_site(args&&... Args)
template<typename ...args>
std::size_t push_back_mutation(args&&... Args)
template<typename ...args>
std::size_t emplace_back_mutation(args&&... Args)
void build_indexes()

Generates the index vectors referred to as I and O in Kelleher et al. (2016)

std::size_t num_nodes() const
std::size_t num_edges() const
double genome_length() const
bool operator==(const table_collection &b) const
bool operator!=(const table_collection &b) const

Public Members

node_table nodes

Node table for this simulation.

edge_table edges

Edge table for this simulation.

mutation_table mutations

Mutation table for this simulation;.

site_table sites

Site table.

std::vector<table_index_t> input_left

The input edge vector. “I” in Kelleher2016-cb, page 13.

std::vector<table_index_t> output_right

The output edge vector. “O” in Kelleher2016-cb, page 13.

std::ptrdiff_t edge_offset

This reflects the length of tables.edges after last simplification. It can be used to make sure we only sort newly-added nodes.

std::vector<table_index_t> preserved_nodes

A vector of dead/ancient sample nodes.