MonteCarlo.hpp 1.13 KB
Newer Older
1
2
3
#ifndef MLMC_MC_HPP
#define MLMC_MC_HPP

niklas.baumgarten's avatar
niklas.baumgarten committed
4
#include "montecarlo/datastructure/EmpiricMeasures.hpp"
niklas.baumgarten's avatar
niklas.baumgarten committed
5
#include "pdesolver/PDESolver.hpp"
6
7


8
class MonteCarlo {
niklas.baumgarten's avatar
niklas.baumgarten committed
9
protected:
niklas.baumgarten's avatar
niklas.baumgarten committed
10
    int verbose = 1;
11

niklas.baumgarten's avatar
niklas.baumgarten committed
12
13
    int plotting = 0;

14
    void method();
15

16
    void computeSampleSolution(int m, SampleID &id, SampleSolution &solution);
niklas.baumgarten's avatar
niklas.baumgarten committed
17

niklas.baumgarten's avatar
niklas.baumgarten committed
18
public:
19
    Level level;
niklas.baumgarten's avatar
niklas.baumgarten committed
20
    bool onlyFine;
niklas.baumgarten's avatar
niklas.baumgarten committed
21
22
23
24
25
26
27
28

    SampleCounter ctr;
    Sums sums;
    Averages avgs;
    Variances vars;
    Kurtosis kurtosis;

    PDESolver *pdeSolver;
29
    MatrixGraphs *solMGraphs;
30

niklas.baumgarten's avatar
niklas.baumgarten committed
31

niklas.baumgarten's avatar
niklas.baumgarten committed
32

33
34
35
    MonteCarlo(Level level, int dM, bool onlyFine,
               MatrixGraphs *solMGraphs, PDESolver *pdeSolver) :
        level(level), onlyFine(onlyFine),
niklas.baumgarten's avatar
niklas.baumgarten committed
36
37
38
        solMGraphs(solMGraphs), pdeSolver(pdeSolver) {
//        coarseSolution(SampleSolution(*solMGraphs, level.mGcoarse)),
//        fineSolution(SampleSolution(*solMGraphs, level.mGfine)) {
39

40
        config.get("MCPlotting", plotting);
41
        config.get("MCVerbose", verbose);
niklas.baumgarten's avatar
niklas.baumgarten committed
42
43

        ctr.dM = dM;
niklas.baumgarten's avatar
niklas.baumgarten committed
44
45
46
47
//        fineId.level = level;
//        fineId.coarse = false;
//        coarseId.level = level;
//        coarseId.coarse = true;
niklas.baumgarten's avatar
niklas.baumgarten committed
48
    }
49

50
    void Method();
51
52
53
};

#endif //MLMC_MC_HPP