|
GraphLibrary
0.0.1
A simple library that implements various graph algorithms.
|
Represents a Node in a Graph. More...
#include <Node.hpp>
Public Types | |
| using | val_t = SCALAR |
| Value type. More... | |
| using | idx_t = gl::index_type |
| Index type. More... | |
Public Member Functions | |
| Node (const idx_t &id=0, const val_t &capacity=1, const gl::Color &color=Color("white"), const std::string &label="", const float &x=0., const float &y=0.) | |
| Node (const Node< SCALAR > &)=default | |
| Copy constructor. More... | |
| Node (Node< SCALAR > &&) noexcept=default | |
| Move constructor. More... | |
| Node & | operator= (const Node< SCALAR > &)=default |
| Copy assignment. More... | |
| Node & | operator= (Node< SCALAR > &&) noexcept=default |
| Move assignment. More... | |
| ~Node ()=default | |
| Destructor. More... | |
| bool | operator== (const Node &rhs) const |
| Check whether two nodes are equal. More... | |
| bool | operator!= (const Node &rhs) const |
| Check whether two nodes are not equal. More... | |
id | |
Access to node ID. | |
| idx_t | id () const |
| Checks whether an edge exists. More... | |
| void | id (const idx_t &id) |
| Allows changing of node ID. More... | |
name | |
Access to the label of a node. | |
| std::string | label () const |
| Gets the label of a node. More... | |
| void | label (const std::string &label) |
| Allows changing the label of a node. More... | |
capacity | |
Access to capacity of the edge. | |
| val_t | capacity () const |
| Gets the capacity of the node. More... | |
| void | capacity (const val_t &capacity) |
| Allows changing the capacity of a node. 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... | |
inDegree | |
Access to node in-degree. | |
| idx_t | inDegree () const |
| Gets the in-degree of a node. More... | |
| void | inDegreeIncrement (const idx_t &increment=1) |
| Increments the node in-degree. More... | |
| void | inDegreeDecrement (const idx_t &decrement=1) |
| Decrements the node in-degree. More... | |
outDegree | |
Access to node out-degree. | |
| idx_t | outDegree () const |
| Gets the out-degree of a node. More... | |
| void | outDegreeIncrement (const idx_t &increment=1) |
| Increments the node out-degree. More... | |
| void | outDegreeDecrement (const idx_t &decrement=1) |
| Decrements the node out-degree. More... | |
position | |
Access to node position. | |
| std::pair< float, float > | position () const |
| Get Position of this node. More... | |
| void | position (const std::pair< float, float > &pos) |
| Set Position of node. More... | |
Private Attributes | |
| idx_t | id_ |
| Node ID */. More... | |
| std::string | label_ |
| Node label */. More... | |
| val_t | capacity_ |
| Node capacity */. More... | |
| Color | color_ |
| Node color */. More... | |
| idx_t | inDegree_ |
| In-degree */. More... | |
| idx_t | outDegree_ |
| Out-degree */. More... | |
| std::pair< float, float > | position_ |
| Position of node. More... | |
| SCALAR | Number type used to store node capacities. |
| using gl::Node< SCALAR >::idx_t = gl::index_type |
Index type.
|
inline |
Copy constructor.
Move constructor.
Copy assignment.
Move assignment.
Check whether two nodes are equal.
Check whether two nodes are not equal.
Checks whether an edge exists.
Allows changing of node ID.
| [in] | id | New value of node ID. |
|
inline |
Gets the label of a node.
|
inline |
Allows changing the label of a node.
| [in] | label | New value of node label. |
Gets the capacity of the node.
Allows changing the capacity of a node.
| [in] | capacity | New value of node capacity. |
Gets the edge's color.
Allows changing the edge's RGBA color value.
| [in] | color | New color object. |
Gets the in-degree of a node.
|
inline |
Increments the node in-degree.
| [in] | increment | number that will be added |
|
inline |
Decrements the node in-degree.
| [in] | decrement | number that will be subtracted |
Gets the out-degree of a node.
|
inline |
Increments the node out-degree.
| [in] | increment | number that will be added |
|
inline |
Decrements the node out-degree.
| [in] | decrement | number that will be subtracted |
|
inline |
Get Position of this node.
|
inline |
Set Position of node.
| pos | The position of the node |
|
private |
Position of node.