-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathNode.h
52 lines (48 loc) · 818 Bytes
/
Node.h
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
#ifndef NODE_HEAD_H
#define NODE_HEAD_H
#include <functional>
class Node
{
public:
int row;
int col;
float spill;
Node()
{
row = 0;
col = 0;
spill = -9999.0;
}
struct Greater : public std::binary_function< Node, Node, bool >
{
bool operator()(const Node n1, const Node n2) const
{
return n1.spill > n2.spill;
}
};
bool operator==(const Node& a)
{
return (this->col == a.col) && (this->row == a.row);
}
bool operator!=(const Node& a)
{
return (this->col != a.col) || (this->row != a.row);
}
bool operator<(const Node& a)
{
return this->spill < a.spill;
}
bool operator>(const Node& a)
{
return this->spill > a.spill;
}
bool operator>=(const Node& a)
{
return this->spill >= a.spill;
}
bool operator<=(const Node& a)
{
return this->spill <= a.spill;
}
};
#endif