|
GraphLibrary
0.0.1
A simple library that implements various graph algorithms.
|
Represents an Edge in a Graph. More...
#include <Edge.hpp>
Public Types | |
| using | val_t = SCALAR |
| Value type. More... | |
| using | idx_t = gl::index_type |
| Index type. More... | |
Public Member Functions | |
| Edge (const idx_t &src=0, const idx_t &dest=0, const val_t &weight=0, const Color &color=Color("black"), const bool &exists=false) | |
| Construct Edge from data. More... | |
| Edge (const Edge< SCALAR > &)=default | |
| Copy constructor. More... | |
| Edge (Edge< SCALAR > &&) noexcept=default | |
| Move constructor. More... | |
| Edge & | operator= (const Edge< SCALAR > &)=default |
| Copy assignment. More... | |
| Edge & | operator= (Edge< SCALAR > &&) noexcept=default |
| Move assignment. More... | |
| ~Edge ()=default | |
| Destructor. More... | |
| bool | operator== (const Edge &rhs) const |
| Check whether two edges are equal. More... | |
| bool | operator!= (const Edge &rhs) const |
| Check whether two edges are not equal. More... | |
exists | |
Access to boolean value exists. This signifies the existance of an edge in the graph. | |
| bool | exists () const |
| Checks whether an edge exists. More... | |
| void | exists (bool exists) |
| Allows changing of existance status of an edge. More... | |
source | |
Access to index of source node. | |
| idx_t | source () const |
| Gets the index of the source of the edge. More... | |
| void | source (idx_t src) |
| Allows changing the source of an edge. More... | |
dest | |
Access to index of destination node. | |
| idx_t | dest () const |
| Gets the index of the destination of the edge. More... | |
| void | dest (idx_t dest) |
| Allows changing the destination of an edge. More... | |
weight | |
Access to weight of the edge. | |
| val_t | weight () const |
| Gets the weight of the edge. More... | |
| void | weight (val_t weight) |
| Allows changing the weight of an edge. More... | |
color | |
Access to the edge's RGBA color value. | |
| Color | color () const |
| Gets the edge's color. More... | |
| void | color (const Color &color) |
| Allows changing the edge's RGBA color value. More... | |
Private Attributes | |
| idx_t | src_ |
| Source index. More... | |
| idx_t | dest_ |
| Destination index. More... | |
| val_t | weight_ |
| Edge weight. More... | |
| bool | exists_ |
| Edge existance. More... | |
| Color | color_ |
| Edge color. More... | |
Represents an Edge in a Graph.
| SCALAR | Number type used to store edge weights. |
| using gl::Edge< SCALAR >::idx_t = gl::index_type |
Index type.
Copy constructor.
Move constructor.
Copy assignment.
|
defaultnoexcept |
Move assignment.
Check whether two edges are equal.
Check whether two edges are not equal.
|
inline |
Checks whether an edge exists.
|
inline |
Allows changing of existance status of an edge.
| [in] | exists | New value of boolean exists. |
Gets the index of the source of the edge.
Allows changing the source of an edge.
| [in] | src | New value of source index. |
Gets the index of the destination of the edge.
Allows changing the destination of an edge.
| [in] | dest | New value of destination index. |
Gets the weight of the edge.
Allows changing the weight of an edge.
| [in] | weight | New value of edge weight. |
Gets the edge's color.
Allows changing the edge's RGBA color value.
| [in] | color | New color object. |