EnTT 3.14.0
|
Basic implementation of a directed adjacency matrix. More...
#include <adjacency_matrix.hpp>
Public Types | |
using | allocator_type = Allocator |
Allocator type. | |
using | size_type = std::size_t |
Unsigned integer type. | |
using | vertex_type = size_type |
Vertex type. | |
using | edge_type = std::pair<vertex_type, vertex_type> |
Edge type. | |
using | vertex_iterator = iota_iterator<vertex_type> |
Vertex iterator type. | |
using | edge_iterator = internal::edge_iterator<typename container_type::const_iterator> |
Edge iterator type. | |
using | out_edge_iterator = edge_iterator |
Out-edge iterator type. | |
using | in_edge_iterator = edge_iterator |
In-edge iterator type. | |
using | graph_category = Category |
Graph category tag. | |
Public Member Functions | |
adjacency_matrix () noexcept(noexcept(allocator_type{})) | |
Default constructor. | |
adjacency_matrix (const allocator_type &allocator) noexcept | |
Constructs an empty container with a given allocator. | |
adjacency_matrix (const size_type vertices, const allocator_type &allocator=allocator_type{}) | |
Constructs an empty container with a given allocator and user supplied number of vertices. | |
adjacency_matrix (const adjacency_matrix &)=default | |
Default copy constructor. | |
adjacency_matrix (const adjacency_matrix &other, const allocator_type &allocator) | |
Allocator-extended copy constructor. | |
adjacency_matrix (adjacency_matrix &&) noexcept=default | |
Default move constructor. | |
adjacency_matrix (adjacency_matrix &&other, const allocator_type &allocator) | |
Allocator-extended move constructor. | |
~adjacency_matrix ()=default | |
Default destructor. | |
adjacency_matrix & | operator= (const adjacency_matrix &)=default |
Default copy assignment operator. | |
adjacency_matrix & | operator= (adjacency_matrix &&) noexcept=default |
Default move assignment operator. | |
constexpr allocator_type | get_allocator () const noexcept |
Returns the associated allocator. | |
void | clear () noexcept |
Clears the adjacency matrix. | |
void | swap (adjacency_matrix &other) noexcept |
Exchanges the contents with those of a given adjacency matrix. | |
bool | empty () const noexcept |
Returns true if an adjacency matrix is empty, false otherwise. | |
size_type | size () const noexcept |
Returns the number of vertices. | |
iterable_adaptor< vertex_iterator > | vertices () const noexcept |
Returns an iterable object to visit all vertices of a matrix. | |
iterable_adaptor< edge_iterator > | edges () const noexcept |
Returns an iterable object to visit all edges of a matrix. | |
iterable_adaptor< out_edge_iterator > | out_edges (const vertex_type vertex) const noexcept |
Returns an iterable object to visit all out-edges of a vertex. | |
iterable_adaptor< in_edge_iterator > | in_edges (const vertex_type vertex) const noexcept |
Returns an iterable object to visit all in-edges of a vertex. | |
void | resize (const size_type vertices) |
Resizes an adjacency matrix. | |
std::pair< edge_iterator, bool > | insert (const vertex_type lhs, const vertex_type rhs) |
Inserts an edge into the adjacency matrix, if it does not exist. | |
size_type | erase (const vertex_type lhs, const vertex_type rhs) |
Removes the edge associated with a pair of given vertices. | |
bool | contains (const vertex_type lhs, const vertex_type rhs) const |
Checks if an adjacency matrix contains a given edge. | |
Basic implementation of a directed adjacency matrix.
Category | Either a directed or undirected category tag. |
Allocator | Type of allocator used to manage memory and elements. |
Definition at line 91 of file adjacency_matrix.hpp.
using entt::adjacency_matrix< Category, Allocator >::allocator_type = Allocator |
Allocator type.
Definition at line 99 of file adjacency_matrix.hpp.
using entt::adjacency_matrix< Category, Allocator >::edge_iterator = internal::edge_iterator<typename container_type::const_iterator> |
Edge iterator type.
Definition at line 109 of file adjacency_matrix.hpp.
using entt::adjacency_matrix< Category, Allocator >::edge_type = std::pair<vertex_type, vertex_type> |
Edge type.
Definition at line 105 of file adjacency_matrix.hpp.
using entt::adjacency_matrix< Category, Allocator >::graph_category = Category |
Graph category tag.
Definition at line 115 of file adjacency_matrix.hpp.
using entt::adjacency_matrix< Category, Allocator >::in_edge_iterator = edge_iterator |
In-edge iterator type.
Definition at line 113 of file adjacency_matrix.hpp.
using entt::adjacency_matrix< Category, Allocator >::out_edge_iterator = edge_iterator |
Out-edge iterator type.
Definition at line 111 of file adjacency_matrix.hpp.
using entt::adjacency_matrix< Category, Allocator >::size_type = std::size_t |
Unsigned integer type.
Definition at line 101 of file adjacency_matrix.hpp.
using entt::adjacency_matrix< Category, Allocator >::vertex_iterator = iota_iterator<vertex_type> |
Vertex iterator type.
Definition at line 107 of file adjacency_matrix.hpp.
using entt::adjacency_matrix< Category, Allocator >::vertex_type = size_type |
Vertex type.
Definition at line 103 of file adjacency_matrix.hpp.
|
inlinenoexcept |
Default constructor.
Definition at line 118 of file adjacency_matrix.hpp.
|
inlineexplicitnoexcept |
Constructs an empty container with a given allocator.
allocator | The allocator to use. |
Definition at line 126 of file adjacency_matrix.hpp.
|
inline |
Constructs an empty container with a given allocator and user supplied number of vertices.
vertices | Number of vertices. |
allocator | The allocator to use. |
Definition at line 135 of file adjacency_matrix.hpp.
|
inline |
Allocator-extended copy constructor.
other | The instance to copy from. |
allocator | The allocator to use. |
Definition at line 147 of file adjacency_matrix.hpp.
|
inline |
Allocator-extended move constructor.
other | The instance to move from. |
allocator | The allocator to use. |
Definition at line 159 of file adjacency_matrix.hpp.
|
inlinenoexcept |
Clears the adjacency matrix.
Definition at line 187 of file adjacency_matrix.hpp.
|
inline |
Checks if an adjacency matrix contains a given edge.
lhs | The left hand vertex of the edge. |
rhs | The right hand vertex of the edge. |
Definition at line 324 of file adjacency_matrix.hpp.
|
inlinenoexcept |
Returns an iterable object to visit all edges of a matrix.
Definition at line 235 of file adjacency_matrix.hpp.
|
inlinenoexcept |
Returns true if an adjacency matrix is empty, false otherwise.
Definition at line 210 of file adjacency_matrix.hpp.
|
inline |
Removes the edge associated with a pair of given vertices.
lhs | The left hand vertex of the edge. |
rhs | The right hand vertex of the edge. |
Definition at line 306 of file adjacency_matrix.hpp.
|
inlineconstexprnoexcept |
Returns the associated allocator.
Definition at line 182 of file adjacency_matrix.hpp.
|
inlinenoexcept |
Returns an iterable object to visit all in-edges of a vertex.
vertex | The vertex of which to return all in-edges. |
Definition at line 258 of file adjacency_matrix.hpp.
|
inline |
Inserts an edge into the adjacency matrix, if it does not exist.
lhs | The left hand vertex of the edge. |
rhs | The right hand vertex of the edge. |
Definition at line 287 of file adjacency_matrix.hpp.
|
defaultnoexcept |
Default move assignment operator.
|
default |
Default copy assignment operator.
|
inlinenoexcept |
Returns an iterable object to visit all out-edges of a vertex.
vertex | The vertex of which to return all out-edges. |
Definition at line 246 of file adjacency_matrix.hpp.
|
inline |
Resizes an adjacency matrix.
vertices | The new number of vertices. |
Definition at line 269 of file adjacency_matrix.hpp.
|
inlinenoexcept |
Returns the number of vertices.
Definition at line 219 of file adjacency_matrix.hpp.
|
inlinenoexcept |
Exchanges the contents with those of a given adjacency matrix.
other | Adjacency matrix to exchange the content with. |
Definition at line 196 of file adjacency_matrix.hpp.
|
inlinenoexcept |
Returns an iterable object to visit all vertices of a matrix.
Definition at line 227 of file adjacency_matrix.hpp.