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

niklas.baumgarten's avatar
niklas.baumgarten committed
4
//#include "main/MultilevelPlotter.hpp"
niklas.baumgarten's avatar
niklas.baumgarten committed
5
#include "EmpiricMeasures.hpp"
niklas.baumgarten's avatar
niklas.baumgarten committed
6
#include "PDESolver.hpp"
niklas.baumgarten's avatar
niklas.baumgarten committed
7
#include "Sample.hpp"
8
9


10
class MonteCarlo {
niklas.baumgarten's avatar
niklas.baumgarten committed
11
protected:
niklas.baumgarten's avatar
niklas.baumgarten committed
12
    int plotting = 0;
niklas.baumgarten's avatar
niklas.baumgarten committed
13
    int verbose = 1;
14

15
    void method();
16

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

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

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

    PDESolver *pdeSolver;
30
    MatrixGraphs *solMGraphs;
31

niklas.baumgarten's avatar
niklas.baumgarten committed
32

niklas.baumgarten's avatar
niklas.baumgarten committed
33

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

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

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

51
    void Method();
52
53
54
};

#endif //MLMC_MC_HPP