Include file:
#include "mcrl2/atermpp/aterm_balanced_tree.h
atermpp::
term_balanced_tree
¶Read-only balanced binary tree of terms.
atermpp::term_balanced_tree::
const_reference
¶typedef for const Term
Const reference to T.
atermpp::term_balanced_tree::
difference_type
¶typedef for ptrdiff_t
A signed integral type.
atermpp::term_balanced_tree::
pointer
¶typedef for Term *
Pointer to T.
atermpp::term_balanced_tree::
reference
¶typedef for Term &
Reference to T.
atermpp::term_balanced_tree::
size_type
¶typedef for std::size_t
An unsigned integral type.
atermpp::term_balanced_tree::
value_type
¶typedef for Term
The type of object, T stored in the term_balanced_tree.
empty_tree
()¶make_node
(const term_balanced_tree &left_tree, const term_balanced_tree &right_tree)¶tree_empty_function
()¶tree_node_function
()¶make_tree
(ForwardTraversalIterator &p, const std::size_t size, Transformer transformer)¶term_balanced_tree
(detail::_term_appl *t)¶begin
() constReturns an iterator pointing to the beginning of the term_balanced_tree.
Returns: The beginning of the list.
element_at
(std::size_t position, std::size_t size) const¶Get an element at the indicated position.
Parameters:
position The required position
size The number of elements in the tree. This is required to make the complexity logarithmic.
By providing the size this operation is logarithmic. If a wrong size is provided the outcome is not determined. See also operator [].
Returns: The element at the indicated position.
empty
() constReturns true if tree is empty.
Returns: True iff the tree is empty.
end
() constReturns an iterator pointing to the end of the term_balanced_tree.
Returns: The end of the list.
is_node
() const¶Returns true iff the tree is a node with a left and right subtree.
Returns: True iff the tree is a node with a left and right subtree.
left_branch
() const¶Get the left branch of the tree.
It is assumed that the tree is a node with a left branch.
Returns: A reference t the left subtree of the current tree
operator=
(const term_balanced_tree&) noexcept = default¶Assignment operator.
operator=
(term_balanced_tree&&) noexcept = default¶Move assign operator.
operator[]
(std::size_t position) const¶Element indexing operator.
Parameters:
position Index in the tree.
This operation behaves linearly with respect to container size, because it must calculate the size of the container. The operator element_at behaves logarithmically.
right_branch
() const¶Get the left branch of the tree.
It is assumed that the tree is a node with a left branch.
Returns: A reference t the left subtree of the current tree
size
() constReturns the size of the term_balanced_tree.
This operator is linear in the size of the balanced tree.
Returns: The size of the tree.
term_balanced_tree
()¶Default constructor. Creates an empty tree.
term_balanced_tree
(const term_balanced_tree&) noexcept = default¶Copy constructor.
term_balanced_tree
(term_balanced_tree&&) noexcept = default¶Move constructor.
term_balanced_tree
(ForwardTraversalIterator first, const std::size_t size)¶Creates an term_balanced_tree with a copy of a range.
Parameters:
first The start of a range of elements.
size The size of the range of elements.
term_balanced_tree
(ForwardTraversalIterator first, const std::size_t size, Transformer transformer)¶Creates an term_balanced_tree with a copy of a range, where a transformer is applied to each term before adding it to the tree..
Parameters:
first The start of a range of elements.
size The size of the range of elements.
transformer A class with an operator() that is applied to each term before adding it to the tree.