-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfunctions.cuh
63 lines (53 loc) · 2.74 KB
/
functions.cuh
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
#pragma once
#include <iostream>
#include <cstring>
#include <filesystem>
#include <fstream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <thread>
#include <future>
#include "cuda_runtime.h"
#include "device_launch_parameters.h"
using namespace std;
class functions
{
private:
public:
functions();
int calc_Pairwise(string &line, int N, int tot_Blocks, int tot_ThreadsperBlock);
void split_Convert(int *line_temp, string line, string delim);
/**
* Administrative function responsible for calculating the values needed for Tajima's D.
* Function directly calls upon the GPU function.
**/
void process_Seg_sites_tajima(vector<string> &total_Segregrating_sites, int N, int &real_segregrating_Sites, float &tot_pairwise_Differences, int tot_Blocks, int tot_ThreadsperBlock);
/**
* Administrative function responsible for calculating the values needed for Fu and Li values.
* Function directly calls upon the GPU function.
**/
void process_Seg_sites_fu_li(vector<string> &total_Segregrating_sites, float N, int &real_segregrating_Sites, float &tot_pairwise_Differences, int &singletons_ne, int &singletons_ns, int tot_Blocks, int tot_ThreadsperBlock);
vector<string> get_Countries(string &input_Folder);
vector<pair<string, string>> index_Folder(string &country);
int single_segment_retrieval(int SNP_position, vector<pair<string, string>> &folder_Index);
vector<string> compound_interpolationSearch(vector<pair<string, string>> &folder_Index, int &start_Co, int &end_Co);
vector<string> compound_interpolationSearch_ordered(vector<pair<string, string>> &folder_Index, int &start_Co, int &end_Co);
void forward_Search(int pos, vector<pair<string, string>> folder_Index, int start_Co, int end_Co, promise<vector<int>> &forward_Found);
void backward_Search(int pos, vector<pair<string, string>> folder_Index, int start_Co, int end_Co, promise<vector<int>> &backward_Found);
// vector<string> forward_Search_Only(int pos, vector<pair<string, string>> &folder_Index, int start_Co, int end_Co);
void split(vector<string> &line_Data, string line, char delim);
void split_space(vector<string> &line_Data, string line, string delim);
void split_getPos_ONLY(vector<string> &line_Data, string line, char delim);
// void split_getPos(vector<string> &line_Data, string line, string delim);
int getN_Split(string file);
int get_Valid(string line);
void split_to_MA(vector<string> &line_Data, string line, char delim);
long int fact_half(int count);
long int combos_N(int count);
float add(int N, float *array);
string roundoff(float value, unsigned char prec);
void createFile(string path, string text);
void createFile(string path);
};