From d9f662d8857c1ae15d72d6212b616a10a5181f67 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Sun, 14 Nov 2010 17:15:48 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@143 ed2142bd-67ad-457f-ba7c-d818d4011675 --- distributions/uniformed.hpp | 58 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 distributions/uniformed.hpp (limited to 'distributions') diff --git a/distributions/uniformed.hpp b/distributions/uniformed.hpp new file mode 100644 index 0000000..ccafd01 --- /dev/null +++ b/distributions/uniformed.hpp @@ -0,0 +1,58 @@ +#ifndef UNIFORMED_MODEL_H_ +#define UNIFORMED_MODEL_H_ +#define OPT_HEADER +#include +#include +#include + +namespace opt_utilities +{ + template + class uniformed + :public model,optvec,optvec,std::string> + { + private: + uniformed* do_clone()const + { + return new uniformed(*this); + } + + const char* do_get_type_name()const + { + return "1d normed gaussian"; + } + public: + uniformed() + { + this->push_param_info(param_info >("a",0.)); + this->push_param_info(param_info >("b",1.)); + } + + + public: + optvec do_eval(const optvec& x,const optvec& param) + { + T a=get_element(param,0); + T b=get_element(param,1); + optvec y; + resize(y,get_size(x)); + for(int i=0;i