|
|
| Edge ()=default |
| | Default constructor. Initializes source, target, and weight to zero.
|
|
| Edge (const Edge &)=default |
| | Copy constructor.
|
|
| Edge (Edge &&)=default |
| | Move constructor.
|
| | Edge (Index source, Index target, Real weight) |
| | Constructs an edge with specified source, target, and weight.
|
|
| ~Edge ()=default |
| | Destructor.
|
| Index & | getSource () |
| | Returns the source vertex index (modifiable version).
|
| const Index & | getSource () const |
| | Returns the source vertex index (const version).
|
| Index & | getTarget () |
| | Returns the target vertex index (modifiable version).
|
| const Index & | getTarget () const |
| | Returns the target vertex index (const version).
|
| Real & | getWeight () |
| | Returns the edge weight (modifiable version).
|
| const Real & | getWeight () const |
| | Returns the edge weight (const version).
|
| bool | operator!= (const Edge &other) const |
| | Inequality comparison.
|
| bool | operator< (const Edge &other) const |
| | Less-than comparison based on edge weight.
|
| bool | operator<= (const Edge &other) const |
| | Less-than-or-equal comparison based on edge weight.
|
|
Edge & | operator= (const Edge &)=default |
| | Copy assignment operator.
|
|
Edge & | operator= (Edge &&)=default |
| | Move assignment operator.
|
| bool | operator== (const Edge &other) const |
| | Equality comparison.
|
| bool | operator> (const Edge &other) const |
| | Greater-than comparison based on edge weight.
|
| bool | operator>= (const Edge &other) const |
| | Greater-than-or-equal comparison based on edge weight.
|
template<typename Real = double, typename Index = int>
struct TNL::Graphs::Edge< Real, Index >
Represents a weighted edge in a graph.
The Edge structure stores information about a single edge in a graph, including the source vertex, target vertex, and edge weight. It provides comparison operators based on edge weights and accessor methods for all edge attributes.
- Template Parameters
-
| Real | Type for the edge weight. |
| Index | Type for vertex indices. |