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