Commit cc93c0dd authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

refactored destructor

parent 879e38df
......@@ -15,7 +15,7 @@ MonteCarlo *MultilevelMonteCarlo::getMonteCarlo(int l, int dM, bool baseLevel) {
}
void MultilevelMonteCarlo::initializeMapMC() {
map_mc.clear();
clearMapMC();
for (unsigned long i = 0; i < l_init.size(); i++) {
bool baseLevel = i == 0;
int l = l_init[i], M = M_init[i];
......@@ -29,6 +29,14 @@ void MultilevelMonteCarlo::initializeValuesMLMC() {
alpha = 0.0, beta = 0.0, gamma = 0.0;
}
void MultilevelMonteCarlo::clearMapMC() {
for (auto &iter: map_mc) {
delete iter.second;
}
map_mc.clear();
}
void MultilevelMonteCarlo::method() {
Date Start;
vout (1) << "Start multilevel Monte Carlo method only for initial values" << endl;
......@@ -292,3 +300,4 @@ void MultilevelMonteCarlo::showResultsOverEpsilon(const vector<double> &eps_lst)
......@@ -45,11 +45,11 @@ public:
void initializeValuesMLMC();
~MultilevelMonteCarlo() {
for (auto &iter: map_mc) {
delete iter.second;
}
clearMapMC();
}
void clearMapMC();
void estimateExponents(bool excludeBaseLevel = true);
void updateNumSamples(const double &eps);
......
Supports Markdown
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