-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnode.cpp
More file actions
54 lines (38 loc) · 1.06 KB
/
node.cpp
File metadata and controls
54 lines (38 loc) · 1.06 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
#include "node.h"
#include <iostream>
//Node Functions
Node::Node(int id, int l):id(id),label(l){
}
Node::Node(int id, int l, std::vector<int> e):id(id),label(l),extra(e){
}
int Node::getId() const{
return this->id;
}
void Node::setId(int id){
this->id = id;
}
int Node::getLabel() const {
return this->label;
}
void Node::setLabel(int l){
this->label = l;
}
std::vector<int> &Node::getExtra() {
return this->extra;
}
void Node::setExtra(std::vector<int> &e){
this->extra = e;
}
bool Node::compareIdEqual(const Node &a, const Node &b){
return (a.id == b.id);
}
bool Node::compareLabelEqual(const Node &a, const Node &b){
return (a.label == b.label);
}
bool Node::compareNodeEqual(const Node &a, const Node &b) {
return (compareLabelEqual(a,b) && compareIdEqual(a,b));
}
void Node::print(){
//std::cout << "====Node Id " << id << " label " << label << " index " << idxEdgeBegin << ":" << idxEdgeEnd << std::endl;
std::cout << "====Node Id " << id << " label " << label << std::endl;
}