Commit 20a69789 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

renaming

parent 268f5ef8
......@@ -6,14 +6,14 @@ void EstimatorMap::UpdateSampleCounter(double epsilon) {
int optimalM;
double factor = 0.0;
for (auto &[level, mc] : _levelMap)
factor += sqrt(mc.aggregate.sVar.Y * mc.aggregate.mean.C);
for (auto &[level, estimator] : _levelMap)
factor += sqrt(estimator.aggregate.sVar.Y * estimator.aggregate.mean.C);
for (auto &[level, mc] : _levelMap) {
for (auto &[level, estimator] : _levelMap) {
optimalM = (int) (ceil(2 * pow(epsilon, -2) * factor *
sqrt(mc.aggregate.sVar.Y / mc.aggregate.mean.C)));
sqrt(estimator.aggregate.sVar.Y / estimator.aggregate.mean.C)));
if (optimalM == 1) optimalM++; // Hack
mc.aggregate.UpdateSampleCounter(optimalM - mc.aggregate.ctr.M);
estimator.aggregate.UpdateSampleCounter(optimalM - estimator.aggregate.ctr.M);
}
}
......@@ -36,9 +36,9 @@ void EstimatorMap::AppendLevel(double epsilon, Exponents exponents, int newLevel
}
}
void SampleCounterMap::Update(const EstimatorMap &mcMap) {
for (auto &[level, mc]: mcMap)
_levelMap[level] = SampleCounter(mc.aggregate.ctr);
void SampleCounterMap::Update(const EstimatorMap &estimatorMap) {
for (auto &[level, estimator]: estimatorMap)
_levelMap[level] = SampleCounter(estimator.aggregate.ctr);
}
bool SampleCounterMap::NoSamplesLeft() {
......@@ -51,20 +51,20 @@ bool SampleCounterMap::NoSamplesLeft() {
return noSamplesLeft;
}
void MeanMap::Update(const EstimatorMap &mcMap) {
for (auto &&[level, mc]: mcMap) {
_levelMap[level] = mc.aggregate.mean;
Q += mc.aggregate.mean.Y;
Cost += mc.aggregate.mean.C; // Todo at the right place?
void MeanMap::Update(const EstimatorMap &estimatorMap) {
for (auto &&[level, estimator]: estimatorMap) {
_levelMap[level] = estimator.aggregate.mean;
Q += estimator.aggregate.mean.Y;
Cost += estimator.aggregate.mean.C; // Todo at the right place?
}
}
void SVarMap::Update(const EstimatorMap &mcMap) {
for (auto &[level, mc]: mcMap)
_levelMap[level] = mc.aggregate.sVar;
void SVarMap::Update(const EstimatorMap &estimatorMap) {
for (auto &[level, estimator]: estimatorMap)
_levelMap[level] = estimator.aggregate.sVar;
}
void KurtosisMap::Update(const EstimatorMap &mcMap) {
for (auto &[level, mc]: mcMap)
_levelMap[level] = mc.aggregate.kurtosis;
void KurtosisMap::Update(const EstimatorMap &estimatorMap) {
for (auto &[level, estimator]: estimatorMap)
_levelMap[level] = estimator.aggregate.kurtosis;
}
......@@ -35,7 +35,7 @@ struct SampleCounterMap : public LevelMap<SampleCounter> {
SampleCounterMap(std::initializer_list<std::pair<int, SampleCounter>> ctrs) :
LevelMap<SampleCounter>(ctrs) {};
void Update(const EstimatorMap &mcMap);
void Update(const EstimatorMap &estimatorMap);
bool NoSamplesLeft();
};
......@@ -53,7 +53,7 @@ struct MeanMap : public LevelMap<Mean> {
Update(mcMap);
};
void Update(const EstimatorMap &mcMap);
void Update(const EstimatorMap &estimatorMap);
};
struct SVarMap : public LevelMap<SVar> {
......@@ -67,7 +67,7 @@ struct SVarMap : public LevelMap<SVar> {
Update(mcMap);
};
void Update(const EstimatorMap &mcMap);
void Update(const EstimatorMap &estimatorMap);
};
struct KurtosisMap : LevelMap<Kurtosis> {
......@@ -81,7 +81,7 @@ struct KurtosisMap : LevelMap<Kurtosis> {
Update(mcMap);
};
void Update(const EstimatorMap &mcMap);
void Update(const EstimatorMap &estimatorMap);
};
struct MultilevelData {
......
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