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

added functions - not sure if they will be needed in the end

parent dc9d60ae
......@@ -21,6 +21,10 @@ public:
virtual void DrawSample(const SampleID &id) = 0;
virtual double SampleWeight(const SampleID &id) { return 1.0; }
virtual int NumOfSamples() { return 0; };
virtual string Name() const = 0;
};
......@@ -198,7 +202,7 @@ public:
}
double FunctionEvaluation() override {
return std::exp(this->generator.EvalSample()*this->generator.EvalSample());
return std::exp(this->generator.EvalSample() * this->generator.EvalSample());
}
string Name() const override {
......@@ -217,11 +221,19 @@ public:
generator.DrawSample(id);
}
double SampleWeight(const SampleID &id) override {
return generator.SampleWeight(id);
}
int NumOfSamples() override {
return generator.GetNumPoints();
}
double FunctionEvaluation() override {
RVector sample = this->generator.EvalSample();
double y1 = sample[0];
double y2 = sample[1];
return std::exp(-y1*y1) * std::cos(y2);
return std::exp(-y1 * y1) * std::cos(y2);
}
string Name() const override {
......@@ -229,7 +241,6 @@ public:
}
};
StochasticDummyProblem *
CreateStochasticDummyProblem(const std::string &problemName, const Meshes &meshes);
......
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