This repository has been archived by the owner on Nov 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLittle.h
99 lines (73 loc) · 2.18 KB
/
Little.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
#ifndef TBP_LITTLE_LITTLE_H
#define TBP_LITTLE_LITTLE_H
#include <stack>
#include <limits>
#include <vector>
#include <iostream>
#include <fstream>
#include <chrono>
#include "LittleNode.h"
#include "Segment.h"
#include "Coordinates.h"
using namespace std;
typedef chrono::high_resolution_clock Clock;
class Little {
private:
stack<LittleNode> nodes;
vector<Segment> segments;
double reference;
MatrixXd *distanceMatrix;
string fileName;
size_t nbOfVisitedNodes;
public:
Little();
Little(const string &fileName);
virtual ~Little();
const stack<LittleNode> & getNodes() const;
void setNodes(const stack<LittleNode> &nodes);
const vector<Segment> & getSegments() const;
void setSegments(const vector<Segment> &segments);
double getReference() const;
void setReference(double reference);
MatrixXd *getDistanceMatrix() const;
void setDistanceMatrix(MatrixXd *distanceMatrix);
const string &getFileName() const;
void setFileName(const string &fileName);
/**
* Satrt the algorithm
*/
void start();
/**
* Sort the segments for better readability
* 7-6, 8-7, 6-8 -> 7-6, 6-8, 8-7
*/
void sortSegments();
/**
* Print the results of the algorithm
*/
void printResults();
/**
* Examine the node
* @param node
*/
void examineNode(LittleNode node);
/**
* Return a vector of Coordinates containing the coordinates of all towers described inside fileName
* @param fileName the name of the file containing all the points coordinates
* @return a vector of coordinates
*/
vector<Coordinates> getCoordinates(string fileName);
/**
* Return the matrix of distances between all points
* @param coordinates a vector of coordinates
* @return A matrix of doubles
*/
MatrixXd *getDistancesMatrix(vector<Coordinates> coordinates);
/**
* Compute the maximum number of nodes the matrix size can create
* @param nbRows the matrix's number of rows
* @return the number of nodes this matrix can create at most
*/
size_t computeMaxNumberOfNodes(size_t nbRows);
};
#endif //TBP_LITTLE_LITTLE_H