-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.h
37 lines (29 loc) · 1.36 KB
/
main.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
#ifndef FINAL_PARALLELSA_MAIN_H_
#define FINAL_PARALLELSA_MAIN_H_
#include <time.h>
#include <iostream>
#include <fstream>
#include "sa.h"
#include <string>
#include <vector>
#include <math.h>
#include <sstream>
#include <iostream>
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
#include <thrust/transform.h>
using namespace std;
//Some constants
const std::string BASE_FILE_PATH = "../DataGenerator/"; /*Where input files are located*/
const std::string BASE_FILE_NAME = "data_"; /*Name of data files*/
const std::string FILE_EXT = ".txt"; /*file extension to use*/
long double cost(vector< pair<int, int> >&); //cost function calculates the cost of a certain configuration
pair<int, int> nextConfiguration(vector< pair<int, int> >&); //find another configuration
void loadData(std::fstream&); //load all data from the input file
void revert(pair<int, int>, vector< pair<int, int> >&); //revert a configuration change
void sa(int, int, vector< pair<int, int> >&); //perform the sequential SA algorithm
void experiment(); //manage the experiment
__host__ thrust::host_vector< thrust::host_vector<double> > loadLandUses(std::fstream& dataFile);
__host__ thrust::host_vector< thrust::host_vector<double> > loadPlots(std::fstream& dataFile);
__host__ thrust::host_vector< pair<int, int> > loadAssignments(std::fstream& dataFile, int n);
#endif // FINAL_PARALLELSA_MAIN_H_