From fd6197d5d08da27bc3f8f4c7787aadf31f91b032 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Sun, 1 May 2011 13:12:34 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@189 ed2142bd-67ad-457f-ba7c-d818d4011675 --- pre_estimaters/vdualgauss1d_estimater.hpp | 73 +++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 pre_estimaters/vdualgauss1d_estimater.hpp diff --git a/pre_estimaters/vdualgauss1d_estimater.hpp b/pre_estimaters/vdualgauss1d_estimater.hpp new file mode 100644 index 0000000..2be4cfb --- /dev/null +++ b/pre_estimaters/vdualgauss1d_estimater.hpp @@ -0,0 +1,73 @@ +#ifndef VDUALGAUSS1D_ESTIMATER +#define VDUALGAUSS1D_ESTIMATER +#include +#include +#include +#include + +namespace opt_utilities +{ + template + class dualgauss1d_estimater + :public pre_estimater,optvec,optvec,std::string> + { + public: + dualgauss1d_estimater() + { + this->set_model_id("1d dualgaussian"); + } + + dualgauss1d_estimater* do_clone()const + { + return new dualgauss1d_estimater(*this); + } + + void do_estimate(const data_set,optvec >& d,model,optvec,optvec,std::string>& m)const + { + int n=d.size(); + + T xp1st=0; + T xp2nd=0; + T yp1st=d.get_data(0).get_y()[0]; + T yp2nd=d.get_data(0).get_y()[0]; + + for(int i=0;iyp1st) + { + yp1st=d.get_data(i).get_y()[0]; + xp1st=d.get_data(i).get_x()[0]; + } + } + + for(int i=0;i