Class node_iterator

Class Documentation

class fwdpp::ts::node_iterator

Traverse nodes in a marginal_tree.

Public Functions

template<typename ORDER>
node_iterator(const marginal_tree &m, ORDER order_policy)

Traverse nodes starting from all roots

The dispatch tag is sent to the appropriate overload of

fwdpp::ts::node_traversal_dispatch, which must return a std::unique_ptr containing an object derived from node_traversal_order.
Parameters

template<typename ORDER>
node_iterator(const marginal_tree &m, table_index_t u, ORDER order_policy)

Traverse nodes in a subtree whose root is u

The dispatch tag is sent to the appropriate overload of

fwdpp::ts::node_traversal_dispatch, which must return a std::unique_ptr containing an object derived from node_traversal_order.
Parameters
  • m: A marginal_tree

  • u: A node in m

  • order_policy: A dispatch tag.

table_index_t operator()()

Return the next node in the tree. A value ot NULL_INDEX signals end of iteration.

template<typename F>
table_index_t operator()(const F &f)

Apply a function to each node.

Parameters
  • f: A function behaving as void(*process_node)(table_index_t) Returns false to signal end of iteration.