17 #ifndef GZ_MATH_GRAPH_EDGE_HH_
18 #define GZ_MATH_GRAPH_EDGE_HH_
27 #include <gz/math/config.hh>
33 inline namespace GZ_MATH_VERSION_NAMESPACE {
51 const double _weight = 1)
52 : vertices(_vertices),
65 public:
double weight = 1;
104 return this->vertices;
133 this->weight = _newWeight;
186 private:
double weight = 1.0;
196 template<
typename EdgeType>
217 :
Edge<E>(_vertices, _data, _weight, _id)
227 if (this->Vertices().first != _from && this->Vertices().second != _from)
230 if (this->Vertices().first == _from)
231 return this->Vertices().second;
233 return this->Vertices().first;
239 return this->From(_to);
251 _out <<
" " << vertices.first <<
" -- " << vertices.second
259 UndirectedEdge<E> UndirectedEdge<E>::NullEdge(
280 :
Edge<E>(_vertices, _data, _weight, _id)
289 return this->Vertices().first;
297 return this->Vertices().second;
303 if (_from != this->Tail())
312 if (_to != this->Head())
326 _out <<
" " << _e.
Tail() <<
" -> " << _e.
Head()
334 DirectedEdge<E> DirectedEdge<E>::NullEdge(