-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathevppi.hpp
55 lines (43 loc) · 1.18 KB
/
evppi.hpp
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
#ifndef EVPPI_HPP
#define EVPPI_HPP
#include <vector>
using namespace std;
typedef struct ModelInfo ModelInfo;
typedef struct {
int level;
int m; // inner loop の回数
int model_num;
vector <double> sample;
vector <double> val;
ModelInfo *model_info;
} EvppiInfo;
typedef struct {
double p1, p2;
double z1, z2, z3, z4;
clock_t time;
} Result;
typedef struct {
int n; // outer loop の回数
clock_t time;
double cost;
double aveZ, aveP, varZ, varP, kurt, check;
EvppiInfo *evppi_info;
Result *result;
} MlmcLayerInfo;
typedef struct {
int max_level;
double alpha;
double beta;
double gamma;
double theta;
vector <MlmcLayerInfo> layer;
} MlmcInfo;
void sampling_init(EvppiInfo *info);
void pre_sampling(ModelInfo *model);
void post_sampling(ModelInfo *model);
void f(EvppiInfo *info);
void smc_evpi_calc(EvppiInfo *info, int n);
void mlmc_test(MlmcInfo *info, int test_level, int n_sample, const char *file_name = "output.txt");
void mlmc_test_eval_eps(MlmcInfo *info, vector <double> &eps, const char *file_name = "output.txt");
MlmcInfo *mlmc_init(int m0, int s, int max_level, double gamma, double theta);
#endif