-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAbstractSalesmanSearchMethod.cpp
More file actions
46 lines (40 loc) · 968 Bytes
/
AbstractSalesmanSearchMethod.cpp
File metadata and controls
46 lines (40 loc) · 968 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
#include "stdafx.h"
#include "AbstractSalesmanSearchMethod.h"
using namespace Salesman;
void Salesman::AbstractSalesmanSearchMethod::printMatrix() {
const matrix& matr = getMatrix();
for (auto row : matr) {
PrintVectorValue(row, false);clog << endl;
}
}
void Salesman::AbstractSalesmanSearchMethod::printSet(set X) {
clog << "[";
for (num xi : X) {
clog << xi << ",";
}
clog << "]";
}
void Salesman::AbstractSalesmanSearchMethod::PrintVectorValue(const vector<value>& X, bool printIndex) {
clog << "[";
int i = 0;
for (num xi : X) {
i++;
if (printIndex)
{
clog << i << ":" << xi << ",";
}
else
{
clog << xi << ",";
}
}
clog << "]";
}
inline const matrix Salesman::AbstractSalesmanSearchMethod::getMatrix() {
return data;
}
value Salesman::AbstractSalesmanSearchMethod::getDistance(int i, int j) {
return data[i][j];
}
Salesman::AbstractSalesmanSearchMethod::AbstractSalesmanSearchMethod(const matrix & data) :data(data) {
}