Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Mpp
MLUQ
Commits
d52e044f
Commit
d52e044f
authored
May 12, 2021
by
niklas.baumgarten
Browse files
added create functions
parent
c2b46088
Changes
2
Hide whitespace changes
Inline
Side-by-side
mlmc/src/estimators/Estimator.cpp
0 → 100644
View file @
d52e044f
#include "StochasticCollocation.hpp"
#include "MultilevelEstimator.hpp"
#include "MonteCarlo.hpp"
#include "Estimator.hpp"
Estimator
*
CreateEstimator
(
const
std
::
string
&
estimatorName
)
{
if
(
estimatorName
==
"StochasticCollocation"
)
return
new
StochasticCollocation
();
if
(
estimatorName
==
"MultilevelMonteCarlo"
)
return
new
MultilevelEstimator
();
if
(
estimatorName
==
"MonteCarlo"
)
return
new
MonteCarlo
();
else
Exit
(
"Estimator is not implemented"
)
}
std
::
unique_ptr
<
Estimator
>
CreateEstimatorUniquePtr
(
const
std
::
string
&
estimatorName
)
{
if
(
estimatorName
==
"StochasticCollocation"
)
return
std
::
make_unique
<
StochasticCollocation
>
();
if
(
estimatorName
==
"MultilevelMonteCarlo"
)
return
std
::
make_unique
<
MultilevelEstimator
>
();
if
(
estimatorName
==
"MonteCarlo"
)
return
std
::
make_unique
<
MonteCarlo
>
();
else
Exit
(
"Estimator is not implemented"
)
}
mlmc/src/estimators/Estimator.hpp
View file @
d52e044f
...
...
@@ -27,7 +27,6 @@ public:
double
Epsilon
()
const
{
return
epsilon
;
}
virtual
void
Method
()
{};
virtual
std
::
string
Name
()
const
{
return
"Estimator"
;
};
...
...
@@ -39,4 +38,8 @@ public:
virtual
void
ExponentResults
()
const
{};
};
Estimator
*
CreateEstimator
(
const
std
::
string
&
estimatorName
);
std
::
unique_ptr
<
Estimator
>
CreateEstimatorUniquePtr
(
const
std
::
string
&
estimatorName
);
#endif //ESTIMATOR_HPP
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment