-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVertex.cpp
More file actions
70 lines (58 loc) · 1.07 KB
/
Copy pathVertex.cpp
File metadata and controls
70 lines (58 loc) · 1.07 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
65
66
67
68
#include "Vertex.h"
#include "Edge.h"
Vertex::Vertex(int v)
{
this->value = v;
this->coarsed[v] = 0;
this->w = 1;
}
void Vertex::init(int v) {
this->value = v;
this->coarsed[v] = 0;
this->w = 1;
}
void Vertex::addNeighbour(Vertex* v)
{
this->neighbour[(*v).getValue()] = 0;
}
void Vertex::deleteNeighbour(Vertex* v)
{
this->neighbour.erase((*v).getValue());
}
map<int,int> Vertex::getNeighbour()
{
return this->neighbour;
}
map<int,int>& Vertex::getCoarsed()
{
return this->coarsed;
}
void Vertex::addCoarsed(map<int,int> s)
{
map<int,int>::iterator cit;
for (cit = s.begin(); cit != s.end(); cit++) {
this->coarsed[cit->first] = 0;
}
}
void Vertex::addsavedEdge(int arg1, Edge* arg2) {
this->savedEdge[arg1] = arg2;
}
map <int, Edge*> Vertex::getsavedEdge() {
return this->savedEdge;
}
void Vertex::deletesavedEdge(int arg1) {
auto it = this->savedEdge.find(arg1);
if(it!=this->savedEdge.end())
this->savedEdge.erase(it);
}
int Vertex::getValue()
{
return this->value;
}
int Vertex::getW()
{
return this->w;
}
void Vertex::setW(int ww) {
this->w = ww;
}