|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_TREE_FORMATS_NEWICK_BROKER_H_
2 #define GENESIS_TREE_FORMATS_NEWICK_BROKER_H_
114 typedef std::deque<NewickBrokerElement>::iterator
iterator;
329 std::string
dump()
const;
337 std::deque<NewickBrokerElement> stack_;
343 #endif // include guard
std::deque< NewickBrokerElement >::iterator iterator
std::deque< NewickBrokerElement >::const_reverse_iterator const_reverse_iterator
NewickBrokerElement & operator[](std::size_t index)
Provides index based array access to the nodes.
std::deque< NewickBrokerElement >::reverse_iterator reverse_iterator
NewickBrokerElement & top()
Returns a reference to the top node of the tree stack.
void clear()
Deletes all nodes from the broker.
long max_rank() const
Returns the highest rank of the nodes in the tree. assign_ranks() has to be called first.
iterator end()
Returns an iterator to the end of the token list.
bool validate() const
Returns true iff the tree is valid. assign_ranks() has to be called first.
void push_top(NewickBrokerElement const &node)
std::string dump() const
Return a readable string representation of the elements of the NewickBroker.
iterator begin()
Returns an iterator to the top of the stack.
const_iterator cbegin() const
Const version of begin().
const_reverse_iterator crbegin()
Const version of rbegin().
reverse_iterator rend()
Reverse version of end().
NewickBrokerElement & at(std::size_t index)
Provides index based array access to the nodes, doing a boundary check first.
size_t inner_count() const
std::deque< NewickBrokerElement >::const_iterator const_iterator
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Stores a Newick tree in an intermediate format that can be further processed into a Tree.
NewickBroker & operator=(NewickBroker const &)=default
void assign_ranks() const
Iterate over the tree and assign ranks (= number of immediate children) to all nodes.
bool empty() const
Returns whether the stack is empty.
const_reverse_iterator crend()
Const version of rend().
reverse_iterator rbegin()
Returns a reverse iterator to the nodes on the stack.
NewickBrokerElement & bottom()
Returns a reference to the bottom node of the tree stack.
void push_bottom(NewickBrokerElement const &node)
Store the information for one element of a Newick tree.
bool is_bifurcating() const
size_t leaf_count() const
Returns the number of leaf nodes in the tree. assign_ranks() has to be called first.
size_t size() const
Returns the size of the stack, i.e. the number of nodes stored in the broker.
const_iterator cend() const
Const version of end().
size_t node_count() const
Alias for size().