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

maintest fix

parent b41ca6f2
Pipeline #149275 failed with stages
in 13 minutes and 17 seconds
......@@ -6,8 +6,8 @@ EstimatorMap CreateCollocationMap(Levels initLevels, Samples initSamples) {
return estimatorMap;
}
EstimatorMap CreateMonteCarloMap(Levels initLevels, Samples initSamples) {
EstimatorMap estimatorMap;
void CreateMonteCarloMap(EstimatorMap &estimatorMap,
Levels initLevels, Samples initSamples) {
for (unsigned long i = 0; i < initLevels.size(); i++) {
bool onlyFine = (i == 0);
int M = initSamples[i];
......@@ -15,7 +15,6 @@ EstimatorMap CreateMonteCarloMap(Levels initLevels, Samples initSamples) {
{initLevels[i], new MonteCarlo(initLevels[i], M, onlyFine, true)}
);
}
return estimatorMap;
}
void MultilevelEstimator::Method() {
......
......@@ -41,7 +41,9 @@ typedef std::vector<int> Samples;
EstimatorMap CreateCollocationMap(Levels initLevels, Samples initSamples);
EstimatorMap CreateMonteCarloMap(Levels initLevels, Samples initSamples);
void CreateMonteCarloMap(EstimatorMap &estimatorMap,
Levels initLevels,
Samples initSamples);
class MultilevelEstimator : public Estimator {
private:
......@@ -69,7 +71,7 @@ public:
config.get("initLevels", initLevels);
config.get("initSamples", initSamples);
estimatorMap = CreateMonteCarloMap(initLevels, initSamples);
CreateMonteCarloMap(estimatorMap, initLevels, initSamples);
}
MultilevelEstimator(const EstimatorMap &mcMap) : Estimator(), estimatorMap(mcMap) {
......
......@@ -17,10 +17,10 @@ protected:
MultilevelEstimator mlmc;
TestEllipticMultilevelMonteCarlo() :
estimatorMap(CreateMonteCarloMap(GetParam().levels, GetParam().samples)),
mlmc(MultilevelEstimator(estimatorMap)) {
mlmc.Method();
TestEllipticMultilevelMonteCarlo() {
CreateMonteCarloMap(estimatorMap, GetParam().levels, GetParam().samples);
mlmc = MultilevelEstimator(estimatorMap);
mlmc.Method();
}
};
......
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