-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathedge.cpp
More file actions
48 lines (45 loc) · 771 Bytes
/
Copy pathedge.cpp
File metadata and controls
48 lines (45 loc) · 771 Bytes
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
#include "edge.h"
#include "node.h"
#include <sstream>
using namespace std;
Edge::Edge(const Node* u, const Node* v) {
start.lv = u->level;
start.cc = u->concentration;
start.type = u->type;
end.lv = v->level;
end.cc = v->concentration;
end.type = v->type;
}
Edge::Edge() {
start.lv = -1;
start.cc = -1;
start.type = ORD;
end.lv = -1;
end.cc = -1;
end.type = ORD;
}
string Edge::name() const {
string out;
string num;
stringstream ss;
out += "L";
ss << start.lv;
ss >> num;
out += num;
out += "C";
ss.clear();
ss << start.cc;
ss >> num;
out += num;
out += "toL";
ss.clear();
ss << end.lv;
ss >> num;
out += num;
out += "C";
ss.clear();
ss << end.cc;
ss >> num;
out += num;
return out;
}