edge.cpp (526B)
1 #include "../headers/edge.hpp" 2 #include <cstddef> 3 4 Edge::Edge(std::size_t v1, std::size_t v2, double length2, std::size_t identifier) 5 : v1Index(v1), v2Index(v2), length2(length2), identifier(identifier) {} 6 7 std::string Edge::toString() const noexcept { 8 return "(" + std::to_string(this->v1Index) + ", " + std::to_string(this->v2Index) + ")"; 9 } 10 11 bool Edge::operator<(const Edge& other) const { 12 return length2 < other.length2; 13 } 14 15 bool Edge::operator>(const Edge& other) const { 16 return length2 > other.length2; 17 }