forked from mcf171/SocialNetWork
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEdge.hpp
More file actions
64 lines (48 loc) · 1.05 KB
/
Copy pathEdge.hpp
File metadata and controls
64 lines (48 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//
// Edage.h
// SocialNetWork
//
// Created by 王珏 on 15/12/22.
// Copyright © 2015年 王珏. All rights reserved.
//
#ifndef Edage_h
#define Edage_h
#include <vector>
class Node;
using namespace std;
class Edge{
public:
Node* targetNode;
//topic分布
vector<double> realDistribution;
Node* sourceNode;
double weight;
double distance;
~Edge();
bool operator == (const Edge& target)
{
return this->targetNode == target.targetNode;
}
bool operator != (const Edge& target)
{
return this->targetNode != target.targetNode;
}
bool operator < ( const Edge& target)
{
return this->distance > target.distance;
}
bool smallerThan(const Edge* edge)const
{
return this->distance < edge->distance;
}
};
class EdgeCompare{
public:
EdgeCompare(){}
bool operator()(const Edge* source, const Edge* target)
{
return source->smallerThan(target);
}
};
bool findEdge(vector<Edge> edges, Edge edge);
#endif /* Edage_h */