NANA
graphCore.hpp
浏览该文件的文档.
1#pragma once
16#include "core_global.h"
17
18namespace NANA {
19namespace GRAPH {
20
23
27template <typename T>
28class Edge {
29
30public:
31 std::string vertex;
32 T weight;
33 Edge() {
34
35 }
36 Edge(std::string neighbour_vertex) {
37 this->vertex = neighbour_vertex;
38 this->weight = 0;
39 }
40
41 Edge(std::string neighbour_vertex, T weight) {
42 this->vertex = neighbour_vertex;
43 this->weight = weight;
44 }
45
46 bool operator<(const Edge& obj) const {
47 return obj.vertex > vertex;
48 }
49
50 bool operator==(const Edge& obj) const {
51 return obj.vertex == vertex;
52 }
53};
54
55
56
57
59}
60}
61
全局头文件