Commit 842f6b93 authored by niklas.baumgarten's avatar niklas.baumgarten
Browse files

formatting

parent 8f2c957a
......@@ -10,167 +10,167 @@
class IStochasticProblem {
private:
int verbose = 1;
int verbose = 1;
GeneratorNames genNames;
GeneratorNames genNames;
protected:
SampleGeneratorContainer genContainer;
SampleGeneratorContainer genContainer;
public:
IStochasticProblem(Meshes &meshes, GeneratorNames genNames) :
genNames(genNames), genContainer(genNames, meshes) {
config.get("ProblemVerbose", verbose);
}
void DrawSample(const SampleID &id) {
genContainer.DrawSample(id);
}
virtual void PrintInfo() const {
mout.PrintInfo("Stochastic Problem", verbose,
PrintInfoEntry("Problem Name", Name()),
PrintInfoEntry("Generators", vec2str(genNames)));
};
virtual string Name() const = 0;
IStochasticProblem(Meshes &meshes, GeneratorNames genNames) :
genNames(genNames), genContainer(genNames, meshes) {
config.get("ProblemVerbose", verbose);
}
void DrawSample(const SampleID &id) {
genContainer.DrawSample(id);
}
virtual void PrintInfo() const {
mout.PrintInfo("Stochastic Problem", verbose,
PrintInfoEntry("Problem Name", Name()),
PrintInfoEntry("Generators", vec2str(genNames)));
};
virtual string Name() const = 0;
};
class StochasticDummyProblem : public IStochasticProblem {
public:
StochasticDummyProblem(
Meshes &meshes, GeneratorNames genNames = {}) :
IStochasticProblem(meshes, genNames) {}
StochasticDummyProblem(
Meshes &meshes, GeneratorNames genNames = {}) :
IStochasticProblem(meshes, genNames) {}
virtual double GeneratorValue() {
return 0.0;
};
virtual double GeneratorValue() {
return 0.0;
};
virtual string Name() const {
return "StochasticDummyProblem";
}
virtual string Name() const {
return "StochasticDummyProblem";
}
};
class StochasticDummyScalarGeneratorProblem : public StochasticDummyProblem {
public:
StochasticDummyScalarGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {"NormalDistributionReal"})
: StochasticDummyProblem(meshes, genNames) {}
StochasticDummyScalarGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {"NormalDistributionReal"})
: StochasticDummyProblem(meshes, genNames) {}
double GeneratorValue() override {
return this->genContainer.scalarGenerator->EvalSample();
}
double GeneratorValue() override {
return this->genContainer.scalarGenerator->EvalSample();
}
virtual string Name() const override {
return "StochasticDummyScalarGeneratorProblem";
}
virtual string Name() const override {
return "StochasticDummyScalarGeneratorProblem";
}
};
class StochasticDummyComplexGeneratorProblem : public StochasticDummyProblem {
public:
StochasticDummyComplexGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {"NormalDistributionComplex"})
: StochasticDummyProblem(meshes, genNames) {}
StochasticDummyComplexGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {"NormalDistributionComplex"})
: StochasticDummyProblem(meshes, genNames) {}
double GeneratorValue() override {
return abs_compl(this->genContainer.complexGenerator->EvalSample());
}
double GeneratorValue() override {
return abs_compl(this->genContainer.complexGenerator->EvalSample());
}
virtual string Name() const override {
return "StochasticDummyComplexGeneratorProblem";
}
virtual string Name() const override {
return "StochasticDummyComplexGeneratorProblem";
}
};
// TODO
class StochasticDummyVectorFieldGeneratorProblem : public StochasticDummyProblem {
public:
StochasticDummyVectorFieldGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {})
: StochasticDummyProblem(meshes, genNames) {}
StochasticDummyVectorFieldGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {})
: StochasticDummyProblem(meshes, genNames) {}
double GeneratorValue() override {
return 0.0;
}
double GeneratorValue() override {
return 0.0;
}
virtual string Name() const override {
return "StochasticDummyVectorFieldGeneratorProblem";
}
virtual string Name() const override {
return "StochasticDummyVectorFieldGeneratorProblem";
}
};
// TODO
class StochasticDummyTensorGeneratorProblem : public StochasticDummyProblem {
public:
StochasticDummyTensorGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {}) :
StochasticDummyProblem(meshes, genNames) {}
StochasticDummyTensorGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {}) :
StochasticDummyProblem(meshes, genNames) {}
double GeneratorValue() override {
return 0.0;
}
double GeneratorValue() override {
return 0.0;
}
virtual string Name() const override {
return "StochasticDummyTensorGeneratorProblem";
}
virtual string Name() const override {
return "StochasticDummyTensorGeneratorProblem";
}
};
class StochasticDummyRVectorGeneratorProblem : public StochasticDummyProblem {
public:
StochasticDummyRVectorGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {"NormalDistributionRVector"})
: StochasticDummyProblem(meshes, genNames) {}
StochasticDummyRVectorGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {"NormalDistributionRVector"})
: StochasticDummyProblem(meshes, genNames) {}
double GeneratorValue() override {
return this->genContainer.rVectorGenerator->EvalSample().Mean();
}
double GeneratorValue() override {
return this->genContainer.rVectorGenerator->EvalSample().Mean();
}
virtual string Name() const override {
return "StochasticDummyRVectorGeneratorProblem";
}
virtual string Name() const override {
return "StochasticDummyRVectorGeneratorProblem";
}
};
class StochasticDummyCVectorGeneratorProblem : public StochasticDummyProblem {
public:
StochasticDummyCVectorGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {"NormalDistributionCVector"})
: StochasticDummyProblem(meshes, genNames) {}
StochasticDummyCVectorGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {"NormalDistributionCVector"})
: StochasticDummyProblem(meshes, genNames) {}
double GeneratorValue() override {
return abs_compl(this->genContainer.cVectorGenerator->EvalSample().Mean());
}
double GeneratorValue() override {
return abs_compl(this->genContainer.cVectorGenerator->EvalSample().Mean());
}
virtual string Name() const override {
return "StochasticDummyCVectorGeneratorProblem";
}
virtual string Name() const override {
return "StochasticDummyCVectorGeneratorProblem";
}
};
class StochasticDummyRMatrixGeneratorProblem : public StochasticDummyProblem {
public:
StochasticDummyRMatrixGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {"NormalDistributionRMatrix"})
: StochasticDummyProblem(meshes, genNames) {}
StochasticDummyRMatrixGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {"NormalDistributionRMatrix"})
: StochasticDummyProblem(meshes, genNames) {}
double GeneratorValue() override {
return 0.0;
}
double GeneratorValue() override {
return 0.0;
}
virtual string Name() const override {
return "StochasticDummyRMatrixGeneratorProblem";
}
virtual string Name() const override {
return "StochasticDummyRMatrixGeneratorProblem";
}
};
class StochasticDummyCMatrixGeneratorProblem : public StochasticDummyProblem {
public:
StochasticDummyCMatrixGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {"NormalDistributionCMatrix"})
: StochasticDummyProblem(meshes, genNames) {}
StochasticDummyCMatrixGeneratorProblem(
Meshes &meshes, GeneratorNames genNames = {"NormalDistributionCMatrix"})
: StochasticDummyProblem(meshes, genNames) {}
double GeneratorValue() override {
return 0.0;
}
double GeneratorValue() override {
return 0.0;
}
virtual string Name() const override {
return "StochasticDummyCMatrixGeneratorProblem";
}
virtual string Name() const override {
return "StochasticDummyCMatrixGeneratorProblem";
}
};
StochasticDummyProblem *
......
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