53#include <lal/graphs/graph.hpp>
54#include <lal/graphs/tree_type.hpp>
304 uint32_t * const root_of, uint32_t * const root_size
321 uint32_t * const root_of, uint32_t * const root_size
322 ) const noexcept = 0;
338 uint32_t * const root_of, uint32_t * const root_size
355 uint32_t * const root_of, uint32_t * const root_size
356 ) const noexcept = 0;
Abstract class for graphs.
Definition graph.hpp:69
bool has_node(node u) const noexcept
Returns true if node u is in this graph.
Definition graph.hpp:188
graph() noexcept
Empty constructor.
Definition graph.hpp:74
uint32_t get_num_nodes() const noexcept
Returns the number of ndoes.
Definition graph.hpp:194
uint32_t get_num_edges() const noexcept
Returns the number of edges.
Definition graph.hpp:198
Tree graph class.
Definition tree.hpp:73
tree & operator=(const tree &t) noexcept
Copy assignment operator.
Definition tree.hpp:105
bool is_of_tree_type(const tree_type &tt) const noexcept
Returns whether this tree is of type tt.
Definition tree.hpp:209
tree(const tree &t) noexcept
Copy constructor.
Definition tree.hpp:83
virtual bool is_rooted() const noexcept=0
Returns whether this tree is a rooted tree.
bool is_tree() const noexcept
Is this graph is an actual tree?
Definition tree.hpp:145
tree() noexcept
Empty constructor.
Definition tree.hpp:78
bool can_add_edge(node s, node t) const noexcept
Can this edge be added?
void tree_only_copy(const tree &t) noexcept
Copies only members of class tree.
void fill_union_find() noexcept
void tree_only_move(tree &&t) noexcept
Moves only members of class tree.
virtual ~tree() noexcept
Destructor.
Definition tree.hpp:96
std::vector< node > m_root_of
The root of every vertex in the union-find data structure.
Definition tree.hpp:241
void extra_work_per_edge_add(node u, node v) noexcept
Do some extra work after an edge has been added.
uint32_t get_num_nodes_component(node u) const noexcept
Amount of nodes in a connected component of the tree.
Definition tree.hpp:195
bool m_is_tree_type_valid
Is the type of this tree valid?
Definition tree.hpp:262
bool is_tree_type_valid() const noexcept
Is the type of this tree valid?
Definition tree.hpp:231
void tree_only_init(uint32_t n) noexcept
Initialises only the memory of class tree.
virtual void calculate_tree_type() noexcept=0
Calculates the type of tree.
void extra_work_per_edge_remove(node u, node v) noexcept
Do some extra work after an edge has been removed.
virtual void call_union_find_after_remove(node u, node v, uint32_t *const root_of, uint32_t *const root_size) noexcept=0
A call to the union find method.
std::array< bool, __tree_type_size > m_tree_type
The type of this tree.
Definition tree.hpp:254
tree(tree &&t) noexcept
Move constructor.
Definition tree.hpp:91
virtual void call_union_find_after_add(node u, node v, uint32_t *const root_of, uint32_t *const root_size) noexcept=0
A call to the union find method.
bool can_add_edges(const std::vector< edge > &edges) const noexcept
Can these edges be added?
std::vector< uint32_t > m_root_size
The size of the connected component that a root belongs to.
Definition tree.hpp:251
void tree_only_clear() noexcept
Clears the memory used by only class tree.
void tree_only_extra_work_edges_set() noexcept
std::vector< std::string > get_tree_type_list() const noexcept
Returns the list of types as a list of strings.
constexpr std::size_t __tree_type_size
Number of elements within enumeration lal::graphs::tree_type.
Definition tree_type.hpp:110
tree_type
Enumeration of several types of trees.
Definition tree_type.hpp:55
Main namespace of the library.
Definition definitions.hpp:48
std::pair< node, node > edge
Edge type.
Definition definitions.hpp:75
uint32_t node
Node type.
Definition definitions.hpp:51