#ifndef DBETA_MODEL_H_ #define DBETA_MODEL_H_ #define OPT_HEADER #include #include #include namespace opt_utilities { template class dbeta1d :public model,std::string> { private: model >* do_clone()const { return new dbeta1d(*this); } public: dbeta1d() { this->push_param_info(param_info >("S01",1)); this->push_param_info(param_info >("rc1",30)); this->push_param_info(param_info >("beta1",.6)); this->push_param_info(param_info >("S02",.5)); this->push_param_info(param_info >("rc2",20)); this->push_param_info(param_info >("beta2",.4)); this->push_param_info(param_info >("bkg",0)); } T do_eval(const T& x,const std::vector& param) { T S01=get_element(param,0); T r_c1=get_element(param,1); T beta1=get_element(param,2); T S02=get_element(param,3); T r_c2=get_element(param,4); T beta2=get_element(param,5); T bkg=get_element(param,6); return bkg+S01*pow(1+(x*x)/(r_c1*r_c1),-3*beta1+static_cast(.5)) +S02*pow(1+(x*x)/(r_c2*r_c2),-3*beta2+static_cast(.5)); } private: std::string do_to_string()const { return "double 1d beta model\n" "S=beta(S01,beta1,rc1)+beta(S02,beta2,rc2)\n"; } }; } #endif //EOF