-
Notifications
You must be signed in to change notification settings - Fork 0
/
pointgraph.cpp
59 lines (46 loc) · 1.16 KB
/
pointgraph.cpp
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
#include "pointgraph.h"
PointGraph::PointGraph()
{
}
PointGraph::PointGraph(Fractions x, Fractions y, vector<Fractions> equation1, vector<Fractions> equation2)
{
point = {x, y};
first_equation = equation1;
second_equation = equation2;
}
Fractions PointGraph::getX() const
{
return point.first;
}
Fractions PointGraph::getY() const
{
return point.second;
}
PointGraph *PointGraph::getFirst_neighbour() const
{
return first_neighbour;
}
void PointGraph::setFirst_neighbour(PointGraph *newFirst_neighbour)
{
first_neighbour = newFirst_neighbour;
}
PointGraph *PointGraph::getSecond_neigbour() const
{
return second_neigbour;
}
void PointGraph::setSecond_neigbour(PointGraph *newSecond_neigbour)
{
second_neigbour = newSecond_neigbour;
}
const vector<Fractions> &PointGraph::getFirst_equation() const
{
return first_equation;
}
const vector<Fractions> &PointGraph::getSecond_equation() const
{
return second_equation;
}
bool PointGraph::operator <(const PointGraph &pg) const
{
return this->getX() < pg.getX() || (this->getX() == pg.getX() && pg.getY() < this->getY());
}