-
Notifications
You must be signed in to change notification settings - Fork 0
/
estimator.h
47 lines (37 loc) · 1.17 KB
/
estimator.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
#ifndef _ESTIMATOR_H_
#define _ESTIMATOR_H_
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <utility>
#include "path.h"
using std::string;
using std::vector;
using std::pair;
using std::map;
class Estimator {
public:
Estimator(int _nsteps, int _nbins, int _nbeads, string _method = "T");
~Estimator();
void accumulate(Path _path);
void accumulate_ctau(Path _path);
void output();
private:
int nbins; // bin size
int len; // number of binned data
int icount; // counter for data accumulation
int ccount; // counter for correlation function accumulation
int idx;
int cidx;
// choose estimators: T (thermodynamic), CV (centroid viral) and their projected version PT, PCV
string method;
map<string, double> accmltr; // accumulator
map<string, vector<double>> estimators;
vector<double> accmltr_ctau; // accumulator for imaginary-time correlation function
vector<vector<double>> ctau; // imaginary-time correlation function
double calc_pot(double _pos);
double calc_kcv(Path _path);
pair<double, double> calc_avg_and_err_jackknife(vector<double> _data);
};
#endif