20 #ifndef __CXXGRAPH_UNDIRECTEDWEIGHTEDEDGE_H__
21 #define __CXXGRAPH_UNDIRECTEDWEIGHTEDEDGE_H__
25 #include "UndirectedEdge.hpp"
26 #include "Weighted.hpp"
32 class DirectedWeightedEdge;
35 class UndirectedWeightedEdge;
39 std::ostream &operator<<(std::ostream &o,
const UndirectedWeightedEdge<T> &edge);
53 const std::optional<bool> isWeighted()
const override;
66 UndirectedWeightedEdge<T>::UndirectedWeightedEdge(
const unsigned long id,
const std::pair<
const Node<T> *,
const Node<T> *> &nodepair,
const double weight) : UndirectedEdge<T>(id, nodepair), Weighted(weight)
71 UndirectedWeightedEdge<T>::UndirectedWeightedEdge(
const UndirectedEdge<T> &edge,
const double weight) : UndirectedEdge<T>(edge), Weighted(weight)
76 UndirectedWeightedEdge<T>::UndirectedWeightedEdge(
const Edge<T> &edge,
const double weight) : UndirectedEdge<T>(edge), Weighted(weight)
81 UndirectedWeightedEdge<T>::UndirectedWeightedEdge(
const UndirectedEdge<T> &edge) : UndirectedEdge<T>(edge), Weighted()
86 UndirectedWeightedEdge<T>::UndirectedWeightedEdge(
const Edge<T> &edge) : UndirectedEdge<T>(edge), Weighted()
91 UndirectedWeightedEdge<T>::UndirectedWeightedEdge(
const DirectedWeightedEdge<T> &edge) : UndirectedEdge<T>(edge), Weighted(edge.getWeight())
96 const std::optional<bool> UndirectedWeightedEdge<T>::isWeighted()
const
101 template <
typename T>
102 std::ostream &operator<<(std::ostream &os,
const UndirectedWeightedEdge<T> &edge)
104 os <<
"((Node: " << edge.getNode1().getId() <<
")) <----- |Edge: #" << edge.getId() <<
" W:" << edge.getWeight() <<
"|-----> ((Node: " << edge.getNode2().getId() <<
"))";
Definition: DirectedWeightedEdge.hpp:42
Definition: UndirectedEdge.hpp:39
Definition: UndirectedWeightedEdge.hpp:43
Definition: Weighted.hpp:28