-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathNode.hpp
91 lines (65 loc) · 1.74 KB
/
Node.hpp
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//
// Node.h
// SocialNetWork
//
// Created by 王珏 on 15/12/21.
// Copyright © 2015年 王珏. All rights reserved.
//
#ifndef Node_h
#define Node_h
#include <vector>
#include <map>
#include <iostream>
#include "ConstantFile.h"
using namespace std;
class Edge;
class Tree;
class Node{
public:
//vector<Edge*> neighbourEdge;
map<int, Edge*> neighbourEdge;
Tree* MIA;
Node();
Node(int num);
void Init();
~Node();
void insertEdge(int targetPoint, Edge* edge);
status currentStatus;
//Node的影响力
double weight;
double influence;
double ap_node_S_gamma;
double hat_delta_sigma_p;
//Node在图中的序号
int number;
double deta_u;
bool operator < (const Node &target) const{
return this->influence < target.influence;
}
bool operator == (const Node& target)
{
return this->number == target.number;
}
bool operator == (Node* target)
{
return this->number == target->number;
}
bool operator != (const Node& target)
{
return this->number != target.number;
}
bool operator < ( Node* target) const
{
return this->influence < target->influence;
}
bool operator <=(const Node& target) const
{
return this->influence <= target.influence;
}
};
Node findNode(map<int, Node> S, int key);
bool findNode(vector<Node> nodes, Node node);
bool findKey(map<int, Node> S, int key);
vector<Node>::const_iterator findNodeIter(vector<Node> nodes, Node node);
vector<int>::const_iterator findIntIter(vector<int> nodes, int nodeid);
#endif /* Node_h */