Commit 429a3dc0 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

formatting

parent 01fbad9e
......@@ -12,106 +12,106 @@ struct Exponents;
struct MonteCarloMap : public LevelMap<MonteCarlo> {
int maxLevel = 10;
int maxLevel = 10;
MonteCarloMap() {
config.get("maxLevel", maxLevel);
};
MonteCarloMap() {
config.get("maxLevel", maxLevel);
};
MonteCarloMap(std::initializer_list<std::pair<int, MonteCarlo>> mcMap) :
LevelMap<MonteCarlo>(mcMap) {
config.get("maxLevel", maxLevel);
};
MonteCarloMap(std::initializer_list<std::pair<int, MonteCarlo>> mcMap) :
LevelMap<MonteCarlo>(mcMap) {
config.get("maxLevel", maxLevel);
};
void UpdateSampleCounter(double epsilon);
void UpdateSampleCounter(double epsilon);
void AppendLevel(double epsilon, Exponents exponents, int newLevel);
void AppendLevel(double epsilon, Exponents exponents, int newLevel);
};
struct SampleCounterMap : public LevelMap<SampleCounter> {
SampleCounterMap() {};
SampleCounterMap() {};
SampleCounterMap(std::initializer_list<std::pair<int, SampleCounter>> ctrs) :
LevelMap<SampleCounter>(ctrs) {};
SampleCounterMap(std::initializer_list<std::pair<int, SampleCounter>> ctrs) :
LevelMap<SampleCounter>(ctrs) {};
void Update(const MonteCarloMap &mcMap);
void Update(const MonteCarloMap &mcMap);
bool NoSamplesLeft();
bool NoSamplesLeft();
};
struct MeanMap : public LevelMap<Mean> {
double Q = 0.0;
double Cost = 0.0;
double Q = 0.0;
double Cost = 0.0;
MeanMap() {};
MeanMap() {};
MeanMap(std::initializer_list<std::pair<int, Mean>> avgs) :
LevelMap<Mean>(avgs) {};
MeanMap(std::initializer_list<std::pair<int, Mean>> avgs) :
LevelMap<Mean>(avgs) {};
MeanMap(const MonteCarloMap &mcMap) {
Update(mcMap);
};
MeanMap(const MonteCarloMap &mcMap) {
Update(mcMap);
};
void Update(const MonteCarloMap &mcMap);
void Update(const MonteCarloMap &mcMap);
};
struct SVarMap : public LevelMap<SVar> {
SVarMap() {};
SVarMap() {};
SVarMap(std::initializer_list<std::pair<int, SVar>> vars) :
LevelMap<SVar>(vars) {};
SVarMap(std::initializer_list<std::pair<int, SVar>> vars) :
LevelMap<SVar>(vars) {};
SVarMap(const MonteCarloMap &mcMap) {
Update(mcMap);
};
SVarMap(const MonteCarloMap &mcMap) {
Update(mcMap);
};
void Update(const MonteCarloMap &mcMap);
void Update(const MonteCarloMap &mcMap);
};
struct KurtosisMap : LevelMap<Kurtosis> {
KurtosisMap() {};
KurtosisMap() {};
KurtosisMap(std::initializer_list<std::pair<int, Kurtosis>> kurtosis) :
LevelMap<Kurtosis>(kurtosis) {};
KurtosisMap(std::initializer_list<std::pair<int, Kurtosis>> kurtosis) :
LevelMap<Kurtosis>(kurtosis) {};
KurtosisMap(const MonteCarloMap &mcMap) {
Update(mcMap);
};
KurtosisMap(const MonteCarloMap &mcMap) {
Update(mcMap);
};
void Update(const MonteCarloMap &mcMap);
void Update(const MonteCarloMap &mcMap);
};
struct MultiLevelMonteCarloData {
SampleCounterMap ctrs;
MeanMap avgs;
SVarMap vars;
KurtosisMap kurtosis;
MultiLevelMonteCarloData() {};
MultiLevelMonteCarloData(const MonteCarloMap &mcMap) {
ExtractDataFrom(mcMap);
}
MultiLevelMonteCarloData(const SampleCounterMap &ctrs, const MeanMap &avgs,
const SVarMap &vars, const KurtosisMap &kurtosis) :
ctrs(ctrs), avgs(avgs), vars(vars), kurtosis(kurtosis) {};
void ExtractDataFrom(const MonteCarloMap &mcMap);
friend Logging &operator<<(Logging &s, const MultiLevelMonteCarloData &data) {
return s << "E(Qf-Qc)=" << data.avgs.GetYVector() << endl
<< "E(Qf)=" << data.avgs.GetQVector() << endl
<< "V(Qf-Qc)=" << data.vars.GetYVector() << endl
<< "V(Qf)=" << data.vars.GetQVector() << endl
<< "kurtosis=" << data.kurtosis.GetYVector() << endl
<< "E(cost)=" << data.avgs.GetCostVector() << endl
<< "Used Levels=" << data.avgs.GetLevelVector() << endl
<< "Used Samples" << data.ctrs.GetMVector() << endl;
}
SampleCounterMap ctrs;
MeanMap avgs;
SVarMap vars;
KurtosisMap kurtosis;
MultiLevelMonteCarloData() {};
MultiLevelMonteCarloData(const MonteCarloMap &mcMap) {
ExtractDataFrom(mcMap);
}
MultiLevelMonteCarloData(const SampleCounterMap &ctrs, const MeanMap &avgs,
const SVarMap &vars, const KurtosisMap &kurtosis) :
ctrs(ctrs), avgs(avgs), vars(vars), kurtosis(kurtosis) {};
void ExtractDataFrom(const MonteCarloMap &mcMap);
friend Logging &operator<<(Logging &s, const MultiLevelMonteCarloData &data) {
return s << "E(Qf-Qc)=" << data.avgs.GetYVector() << endl
<< "E(Qf)=" << data.avgs.GetQVector() << endl
<< "V(Qf-Qc)=" << data.vars.GetYVector() << endl
<< "V(Qf)=" << data.vars.GetQVector() << endl
<< "kurtosis=" << data.kurtosis.GetYVector() << endl
<< "E(cost)=" << data.avgs.GetCostVector() << endl
<< "Used Levels=" << data.avgs.GetLevelVector() << endl
<< "Used Samples" << data.ctrs.GetMVector() << endl;
}
};
#endif //EMPIRICMEASURELEVELMAPS_HPP
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment