48#include <lal/basic_types.hpp>
131 virtual void init(uint64_t n)
noexcept;
189 virtual std::vector<edge_pair>
get_Q() const noexcept = 0;
205 virtual std::vector<edge>
get_edges() const noexcept = 0;
242 virtual
void _init(uint64_t n) noexcept {
267 g.m_normalised =
false;
Abstract class for graphs.
Definition: graph.hpp:69
uint64_t m_num_edges
Amount of edges of this graph.
Definition: graph.hpp:225
void copy_full_graph(const graph &g) noexcept
Copies all members of this class.
Definition: graph.hpp:255
bool has_node(node u) const noexcept
Returns true if node u is in this graph.
Definition: graph.hpp:192
bool is_normalised() const noexcept
Returns whether this graph is normalised or not.
Definition: graph.hpp:214
virtual ~graph() noexcept
Destructor.
Definition: graph.hpp:101
void __disjoint_union(const graph &g) noexcept
Disjoint union of graphs.
virtual void actions_after_remove_node(node u) noexcept
Do some work before an node is removed.
virtual void normalise() noexcept
Normalises the graph.
uint64_t get_num_edges() const noexcept
Returns the number of edges.
Definition: graph.hpp:202
graph(const graph &g) noexcept
Copy constructor.
Definition: graph.hpp:88
virtual bool has_edge(node u, node v) const =0
Returns true if the undirected edge (u, v) exists in the graph.
virtual bool is_directed() const noexcept=0
Returns whether this graph is directed or not.
graph & operator=(const graph &g) noexcept
Copy assignment operator.
Definition: graph.hpp:109
uint64_t get_num_nodes() const noexcept
Returns the number of ndoes.
Definition: graph.hpp:198
virtual void init(uint64_t n) noexcept
Allocates the necessary memory for this class.
virtual void _init(uint64_t n) noexcept
Initialises memory of graph class.
Definition: graph.hpp:242
virtual void _clear() noexcept
Clears memory for the graph class.
Definition: graph.hpp:248
virtual bool is_undirected() const noexcept=0
Returns whether this graph is undirected or not.
void normalise_after_edge_removal(bool norm, bool check) noexcept
Normalise the graph after one (or more) edges have been removed.
virtual void actions_after_add_edge(node u, node v) noexcept
Do some extra work after an edge has been added.
virtual void finish_bulk_add(bool norm=true, bool check=true) noexcept=0
Completes the inner structure of the graph after adding a bulk of edges.
graph() noexcept
Empty constructor.
Definition: graph.hpp:74
graph(graph &&g) noexcept
Move constructor.
Definition: graph.hpp:96
virtual std::vector< edge_pair > get_Q() const noexcept=0
Returns all independent pairs of edges of this graph.
void move_full_graph(graph &&g) noexcept
Moves all members of this class.
Definition: graph.hpp:261
graph(uint64_t n) noexcept
Constructor with number of nodes.
Definition: graph.hpp:80
std::vector< neighbourhood > m_adjacency_list
Data structure that implements the graph.
Definition: graph.hpp:223
void set_normalised(bool v=true) noexcept
Sets whether this graph is normalised or not.
Definition: graph.hpp:178
virtual std::vector< edge > get_edges() const noexcept=0
Returns all edges of this graph.
void normalise_after_edge_addition(bool norm, bool check) noexcept
Normalise the graph after one (or more) edges have been added.
virtual void actions_after_remove_edge(node u, node v) noexcept
Do some extra work after an edge has been removed.
virtual void actions_before_remove_edges_incident_to(node u) noexcept
Do some work before all edges incident to a node is removed.
virtual void clear() noexcept
Frees the memory occupied by this graph.
virtual bool check_normalised() noexcept
Checks if the graph is normalised.
bool m_normalised
Is this graph normalised?
Definition: graph.hpp:238
Main namespace of the library.
Definition: basic_types.hpp:50
uint64_t node
Node type. See Node / Vertex page for further details.
Definition: basic_types.hpp:53
std::vector< node > neighbourhood
List of nodes.
Definition: basic_types.hpp:62