48#include <lal/definitions.hpp>
130 virtual void init(uint32_t n)
noexcept;
185 virtual std::vector<edge_pair>
get_Q() const noexcept = 0;
201 virtual std::vector<edge>
get_edges() const noexcept = 0;
238 virtual
void _init(uint32_t n) noexcept;
Abstract class for graphs.
Definition graph.hpp:69
void copy_full_graph(const graph &g) noexcept
Copies all members of this class.
virtual void extra_work_per_edge_add(node u, node v) noexcept
Do some extra work after an edge has been added.
bool has_node(node u) const noexcept
Returns true if node u is in this graph.
Definition graph.hpp:188
bool is_normalised() const noexcept
Returns whether this graph is normalised or not.
Definition graph.hpp:210
virtual ~graph() noexcept
Destructor.
Definition graph.hpp:99
void __disjoint_union(const graph &g) noexcept
Disjoint union of graphs.
virtual void normalise() noexcept
Normalises the graph.
graph(const graph &g) noexcept
Copy constructor.
Definition graph.hpp:86
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:108
virtual void _clear() noexcept
Clears memory for the graph class.
virtual void extra_work_per_edge_remove(node u, node v) noexcept
Do some extra work after an edge has been removed.
virtual bool is_undirected() const noexcept=0
Returns whether this graph is undirected or not.
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:94
virtual std::vector< edge_pair > get_Q() const noexcept=0
Returns all independent pairs of edges of this graph.
virtual void init(uint32_t n) noexcept
Allocates the necessary memory for this class.
uint32_t m_num_edges
Amount of edges of this graph.
Definition graph.hpp:221
uint32_t get_num_nodes() const noexcept
Returns the number of ndoes.
Definition graph.hpp:194
void normalise_after_remove(bool norm, bool check) noexcept
Normalise the graph after one (or more) edges have been removed.
void normalise_after_add(bool norm, bool check) noexcept
Normalise the graph after one (or more) edges have been added.
uint32_t get_num_edges() const noexcept
Returns the number of edges.
Definition graph.hpp:198
void move_full_graph(graph &&g) noexcept
Moves all members of this class.
std::vector< neighbourhood > m_adjacency_list
Data structure that implements the graph.
Definition graph.hpp:219
void set_normalised(bool v=true) noexcept
Sets whether this graph is normalised or not.
Definition graph.hpp:174
graph(uint32_t n) noexcept
Constructor with number of nodes.
Definition graph.hpp:79
virtual std::vector< edge > get_edges() const noexcept=0
Returns all edges of this graph.
virtual void _init(uint32_t n) noexcept
Initialises memory of graph class.
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:234
Main namespace of the library.
Definition definitions.hpp:48
uint32_t node
Node type.
Definition definitions.hpp:51
std::vector< node > neighbourhood
List of nodes.
Definition definitions.hpp:79