-
Notifications
You must be signed in to change notification settings - Fork 0
/
util.h
45 lines (34 loc) · 1.57 KB
/
util.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
#pragma once
#include <cstdio>
#include <iostream>
#include <fstream>
#include <utility>
#include <thread>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <tuple>
#include <string>
#include <cstdlib>
#include "STTrajectory.h"
//using namespace std;
#pragma once
//bool IfSorting = 1;
// only simple fuction, no while, no switch, no recursion
float calculateDistance(float LatA, float LonA, float LatB, float LonB); // Question: ÄÚÁªº¯ÊýÈçºÎʵÏÖ£¿
void split(std::string s, std::string delim, std::vector<std::string>* ret);
void split2(std::string s, std::string delim, std::vector<std::string>* ret);
void split3(std::string s, std::string delim, std::vector<std::string>* ret);
void GetSample(std::vector<size_t> &taskSet1, std::vector<size_t> &taskSet2, int sizeP, int sizeQ);
void GetSample2(std::vector<STTrajectory> &dataptr,std::vector<size_t> &taskSet1, std::vector<size_t> &taskSet2, int sizeP, int sizeQ);
void GetSample_Sorting(std::vector<STTrajectory> &dataptr, std::vector<size_t> &taskSet1, std::vector<size_t> &taskSet2, int sizeP, int sizeQ);
void GetSample_Filtering_Sorting(std::vector<STTrajectory> &dataptr, std::vector<size_t> &taskSet1, std::vector<size_t> &taskSet2, int sizeP, int sizeQ);
void GetSample_Filtering_NoSorting(std::vector<STTrajectory> &dataptr, std::vector<size_t> &taskSet1, std::vector<size_t> &taskSet2, int sizeP, int sizeQ);
// this is a wrong coding!! -> stupid!
//template<class T>
//int getlength(T& arr)
//{
// return sizeof(arr) / sizeof(arr[0]);
//}
//void OutGPUMemNeeded(size_t pmqnid, size_t pmqid, size_t pqid);