Edge.hh
Go to the documentation of this file.
57 };
double Weight() const
The cost of traversing the _from end to the other end of the edge.
Definition: Edge.hh:125
static UndirectedEdge< E > NullEdge
An invalid undirected edge.
Definition: Edge.hh:207
E & Data()
Get a mutable reference to the user data stored in the edge.
Definition: Edge.hh:117
VertexId Tail() const
Get the Id of the tail vertex in this edge.
Definition: Edge.hh:288
EdgeInitializer(const VertexId_P &_vertices, const E &_data=E(), const double _weight=1)
Constructor.
Definition: Edge.hh:50
VertexId Head() const
Get the Id of the head vertex in this edge.
Definition: Edge.hh:296
T endl(T... args)
UndirectedEdge(const VertexId_P &_vertices, const E &_data, const double _weight, const EdgeId &_id=kNullId)
Constructor.
Definition: Edge.hh:214
friend std::ostream & operator<<(std::ostream &_out, const DirectedEdge< E > &_e)
Stream insertion operator. The output uses DOT graph description language.
Definition: Edge.hh:324
friend std::ostream & operator<<(std::ostream &_out, const UndirectedEdge< E > &_e)
Stream insertion operator. The output uses DOT graph description language.
Definition: Edge.hh:248
An undirected edge represents a connection between two vertices. The connection is bidirectional...
Definition: Edge.hh:204
VertexId_P Vertices() const
Get the two vertices contained in the edge.
Definition: Edge.hh:100
STL class.
void SetWeight(const double _newWeight)
Set the cost of the edge.
Definition: Edge.hh:132
DirectedEdge(const VertexId_P &_vertices, const E &_data, const double _weight, const EdgeId &_id=kNullId)
Constructor.
Definition: Edge.hh:277
static const VertexId kNullId
Represents an invalid Id.
Definition: Vertex.hh:48
const E & Data() const
Get a non-mutable reference to the user data stored in the edge.
Definition: Edge.hh:110
bool Valid() const
An edge is considered valid when its id is not kNullId.
Definition: Edge.hh:171
static DirectedEdge< E > NullEdge
An invalid directed edge.
Definition: Edge.hh:270
VertexId To(const VertexId &_to) const override
Get the source end that can reach the destination end of an edge.
Definition: Edge.hh:311
STL class.
Used in the Graph constructors for uniform initialization.
Definition: Edge.hh:44
Generic edge class. An edge has two ends and some constraint between them. For example, a directed edge only allows traversing the edge in one direction.
Definition: Edge.hh:73
VertexId_P vertices
IDs of the vertices.
Definition: Edge.hh:57
VertexId From(const VertexId &_from) const override
Get the destination end that is reachable from a source end of an edge.
Definition: Edge.hh:302
uint64_t VertexId
The unique Id of each vertex.
Definition: Vertex.hh:41
VertexId To(const VertexId &_to) const override
Get the source end that can reach the destination end of an edge.
Definition: Edge.hh:238
Definition: Angle.hh:42
STL class.
VertexId From(const VertexId &_from) const override
Get the destination end that is reachable from a source end of an edge.
Definition: Edge.hh:223
A directed edge represents a connection between two vertices. The connection is unidirectional, it's only possible to traverse the edge in one direction (from the tail to the head).
Definition: Edge.hh:267
Edge(const VertexId_P &_vertices, const E &_data, const double _weight, const EdgeId &_id=kNullId)
Constructor.
Definition: Edge.hh:80