-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdata.h
58 lines (43 loc) · 1.39 KB
/
data.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
//
// Created by wang mengbo on 2019-09-01.
//
#ifndef PROGRAM_DATA_H
#define PROGRAM_DATA_H
#include <vector>
#include <string>
#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <map>
#include <ctime>
#include <cmath>
#include "params.h"
#include "inputAndOutput.h"
#include "utils.h"
namespace SuperTAD
{
class Data {
private:
double **_contactTable=NULL;
bool _initByPointer=false;
public:
double **_edgeCountTable=NULL; // upper triangular is intra cluster conductance; lower triangular is inter clusters conductance
double _edgeSum, _doubleEdgeSum, **_logVolTable=NULL;
std::vector<double> _sumOfGtimesLogG; // the sum of glog(g) of bins
Data(std::string input);
Data(double **array, int n);
~Data();
void init();
static void parseSubMatrix(double **&subMatrix, Data &Matrix, int start, int end);
// return intra conductance(g) of node(s, e)
double getG(int s, int e);
// calculate and return volume of node(s, e)
double getVol(int s, int e);
// calculate and return structure entropy given s, e, ps, pe
double getSE(int s, int e, int ps, int pe);
// calculate and return g*log(g)
double getGtimesLogG(double binG);
};
}
#endif //PROGRAM_DATA_H