|
EnTT 3.15.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. | |
| void | swap (adjacency_matrix &other) noexcept |
| Exchanges the contents with those of a given adjacency matrix. | |
| constexpr allocator_type | get_allocator () const noexcept |
| Returns the associated allocator. | |
| void | clear () noexcept |
| Clears the 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 96 of file adjacency_matrix.hpp.
| using entt::adjacency_matrix< Category, Allocator >::allocator_type = Allocator |
Allocator type.
Definition at line 104 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 114 of file adjacency_matrix.hpp.
| using entt::adjacency_matrix< Category, Allocator >::edge_type = std::pair<vertex_type, vertex_type> |
Edge type.
Definition at line 110 of file adjacency_matrix.hpp.
| using entt::adjacency_matrix< Category, Allocator >::graph_category = Category |
Graph category tag.
Definition at line 120 of file adjacency_matrix.hpp.
| using entt::adjacency_matrix< Category, Allocator >::in_edge_iterator = edge_iterator |
In-edge iterator type.
Definition at line 118 of file adjacency_matrix.hpp.
| using entt::adjacency_matrix< Category, Allocator >::out_edge_iterator = edge_iterator |
Out-edge iterator type.
Definition at line 116 of file adjacency_matrix.hpp.
| using entt::adjacency_matrix< Category, Allocator >::size_type = std::size_t |
Unsigned integer type.
Definition at line 106 of file adjacency_matrix.hpp.
| using entt::adjacency_matrix< Category, Allocator >::vertex_iterator = iota_iterator<vertex_type> |
Vertex iterator type.
Definition at line 112 of file adjacency_matrix.hpp.
| using entt::adjacency_matrix< Category, Allocator >::vertex_type = size_type |
Vertex type.
Definition at line 108 of file adjacency_matrix.hpp.
|
inlinenoexcept |
Default constructor.
Definition at line 123 of file adjacency_matrix.hpp.
|
inlineexplicitnoexcept |
Constructs an empty container with a given allocator.
| allocator | The allocator to use. |
Definition at line 131 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 140 of file adjacency_matrix.hpp.
|
inline |
Allocator-extended copy constructor.
| other | The instance to copy from. |
| allocator | The allocator to use. |
Definition at line 152 of file adjacency_matrix.hpp.
|
inline |
Allocator-extended move constructor.
| other | The instance to move from. |
| allocator | The allocator to use. |
Definition at line 164 of file adjacency_matrix.hpp.
|
inlinenoexcept |
Clears the adjacency matrix.
Definition at line 202 of file adjacency_matrix.hpp.
|
inlinenodiscard |
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 329 of file adjacency_matrix.hpp.
|
inlinenodiscardnoexcept |
Returns an iterable object to visit all edges of a matrix.
Definition at line 240 of file adjacency_matrix.hpp.
|
inlinenodiscardnoexcept |
Returns true if an adjacency matrix is empty, false otherwise.
Definition at line 215 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 311 of file adjacency_matrix.hpp.
|
inlinenodiscardconstexprnoexcept |
Returns the associated allocator.
Definition at line 197 of file adjacency_matrix.hpp.
|
inlinenodiscardnoexcept |
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 263 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 292 of file adjacency_matrix.hpp.
|
defaultnoexcept |
Default move assignment operator.
|
default |
Default copy assignment operator.
|
inlinenodiscardnoexcept |
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 251 of file adjacency_matrix.hpp.
|
inline |
Resizes an adjacency matrix.
| vertices | The new number of vertices. |
Definition at line 274 of file adjacency_matrix.hpp.
|
inlinenodiscardnoexcept |
Returns the number of vertices.
Definition at line 224 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 187 of file adjacency_matrix.hpp.
|
inlinenodiscardnoexcept |
Returns an iterable object to visit all vertices of a matrix.
Definition at line 232 of file adjacency_matrix.hpp.