Edge.hh
Go to the documentation of this file.
A directed edge represents a connection between two vertices. The connection is unidirectional,...
Definition: Edge.hh:268
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
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
VertexId To(const VertexId &_to) const override
Get the source end that can reach the destination end of an edge.
Definition: Edge.hh:311
VertexId Head() const
Get the Id of the head vertex in this edge.
Definition: Edge.hh:296
static DirectedEdge< E > NullEdge
An invalid directed edge.
Definition: Edge.hh:270
VertexId Tail() const
Get the Id of the tail vertex in this edge.
Definition: Edge.hh:288
DirectedEdge(const VertexId_P &_vertices, const E &_data, const double _weight, const EdgeId &_id=kNullId)
Constructor.
Definition: Edge.hh:277
Generic edge class. An edge has two ends and some constraint between them. For example,...
Definition: Edge.hh:74
double Weight() const
The cost of traversing the _from end to the other end of the edge.
Definition: Edge.hh:125
void SetWeight(const double _newWeight)
Set the cost of the edge.
Definition: Edge.hh:132
virtual VertexId From(const VertexId &_from) const =0
Get the destination end that is reachable from a source end of an edge.
bool Valid() const
An edge is considered valid when its id is not kNullId.
Definition: Edge.hh:171
E & Data()
Get a mutable reference to the user data stored in the edge.
Definition: Edge.hh:117
Edge(const VertexId_P &_vertices, const E &_data, const double _weight, const EdgeId &_id=kNullId)
Constructor.
Definition: Edge.hh:80
const E & Data() const
Get a non-mutable reference to the user data stored in the edge.
Definition: Edge.hh:110
virtual VertexId To(const VertexId &_to) const =0
Get the source end that can reach the destination end of an edge.
VertexId_P Vertices() const
Get the two vertices contained in the edge.
Definition: Edge.hh:100
An undirected edge represents a connection between two vertices. The connection is bidirectional,...
Definition: Edge.hh:205
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
VertexId To(const VertexId &_to) const override
Get the source end that can reach the destination end of an edge.
Definition: Edge.hh:238
static UndirectedEdge< E > NullEdge
An invalid undirected edge.
Definition: Edge.hh:207
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
UndirectedEdge(const VertexId_P &_vertices, const E &_data, const double _weight, const EdgeId &_id=kNullId)
Constructor.
Definition: Edge.hh:214
T endl(T... args)
uint64_t VertexId
The unique Id of each vertex.
Definition: Vertex.hh:41
static const VertexId kNullId
Represents an invalid Id.
Definition: Vertex.hh:48
Definition: Angle.hh:43
Used in the Graph constructors for uniform initialization.
Definition: Edge.hh:45
EdgeInitializer(const VertexId_P &_vertices, const E &_data=E(), const double _weight=1)
Constructor.
Definition: Edge.hh:50
VertexId_P vertices
IDs of the vertices.
Definition: Edge.hh:57