From 4f4daacdfd12965d0044a7fec04b45672b5fe780 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Thu, 3 Mar 2011 17:36:55 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@181 ed2142bd-67ad-457f-ba7c-d818d4011675 --- pre_estimaters/vgauss1d_estimater.hpp | 52 +++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 pre_estimaters/vgauss1d_estimater.hpp (limited to 'pre_estimaters') diff --git a/pre_estimaters/vgauss1d_estimater.hpp b/pre_estimaters/vgauss1d_estimater.hpp new file mode 100644 index 0000000..e3d1526 --- /dev/null +++ b/pre_estimaters/vgauss1d_estimater.hpp @@ -0,0 +1,52 @@ +#ifndef VGAUSS1D_ESTIMATER +#define VGAUSS1D_ESTIMATER +#include +#include +#include +#include + +namespace opt_utilities +{ + template + class gauss1d_estimater + :public pre_estimater,optvec,optvec,std::string> + { + public: + gauss1d_estimater() + { + this->set_model_id("1d gaussian"); + } + + gauss1d_estimater* do_clone()const + { + return new gauss1d_estimater(*this); + } + + void do_estimate(const data_set,optvec >& d,model,optvec,optvec,std::string>& m)const + { + int n=d.size(); + T xmean=0; + T x2mean=0; + T wgt=0; + T wgt2=0; + for(int i=0;i