aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pre_estimater/lin1d_estimater.hpp38
-rw-r--r--pre_estimater/pre_estimater.hpp29
2 files changed, 67 insertions, 0 deletions
diff --git a/pre_estimater/lin1d_estimater.hpp b/pre_estimater/lin1d_estimater.hpp
new file mode 100644
index 0000000..1ec62cb
--- /dev/null
+++ b/pre_estimater/lin1d_estimater.hpp
@@ -0,0 +1,38 @@
+#ifndef LIN1D_ESTIMATER
+#define LIN1D_ESTIMATER
+#include "pre_estimater.hpp"
+#include <misc/optvec.hpp>
+#include <vmodels/lin1d.hpp>
+
+
+namespace opt_utilities
+{
+ template <typename T>
+ class lin1d_estimater
+ :public pre_estimater<optvec<T>,optvec<T>,optvec<T>,T,std::string>
+ {
+ private:
+ const std::string model_id;
+ private:
+ lin1d_estimater()
+ :model_id(lin1d<T>().get_type_name())
+ {}
+
+ lin1d_estimater<T> do_clone()const
+ {
+ return new lin1d_estimater<T>(*this);
+ }
+
+ void do_estimate(fitter<optvec<T>,optvec<T>,optvec<T>,T,std::string>& fit)const
+ {
+ if(model_id!=fit.get_model().get_type_name())
+ {
+ return;
+ }
+ }
+ };
+}
+
+
+
+#endif
diff --git a/pre_estimater/pre_estimater.hpp b/pre_estimater/pre_estimater.hpp
new file mode 100644
index 0000000..db21e94
--- /dev/null
+++ b/pre_estimater/pre_estimater.hpp
@@ -0,0 +1,29 @@
+#ifndef PRE_ESTIMATER_HPP
+#define PRE_ESTIMATER_HPP
+
+#include <core/fitter.hpp>
+
+
+namespace opt_utilities
+{
+ template <typename Ty,typename Tx,typename Tp,typename Ts=Ty,typename Tstr=std::string>
+ class pre_estimater
+ {
+ private:
+ virtual void do_estimate(fitter<Ty,Tx,Tp,Ts,Tstr>& fit)const=0;
+ virtual pre_estimater* do_clone()const=0;
+ public:
+ void estimate(fitter<Ty,Tx,Tp,Ts,Tstr>& fit)const
+ {
+ do_estimate(fit);
+ }
+
+ pre_estimater* clone()const
+ {
+ return this->do_clone();
+ }
+ };
+}
+
+
+#endif