#ifndef POWER_LAW_MODEL_H_ #define POWER_LAW_MODEL_H_ #define OPT_HEADER #include #include namespace opt_utilities { template class pl1d :public model,std::string> { private: model >* do_clone()const { return new pl1d(*this); } public: pl1d() { this->push_param_info(param_info >("Ampl",1)); this->push_param_info(param_info >("gamma",1)); } T do_eval(const T& x,const std::vector& param) { T A=get_element(param,0); T gamma=get_element(param,1); return A*pow(x,gamma); } private: std::string do_to_string()const { return "Simple power law model\n" "y=A*x^gamma\n"; } }; } #endif //EOF