#ifndef BROKEN_POWER_LAW_MODEL_H_ #define BROKEN_POWER_LAW_MODEL_H_ #define OPT_HEADER #include #include #include namespace opt_utilities { template class bpl1d :public model,optvec,optvec,std::string> { private: bpl1d* do_clone()const { return new bpl1d(*this); } const char* do_get_type_name()const { return "broken power law"; } public: bpl1d() { this->push_param_info(param_info >("bpx",1)); this->push_param_info(param_info >("bpy",1)); this->push_param_info(param_info >("gamma1",1)); this->push_param_info(param_info >("gamma2",1)); } optvec do_eval(const optvec& x,const optvec& param) { T x_b=get_element(param,0); T f_b=get_element(param,1); T gamma1=get_element(param,2); T gamma2=get_element(param,3); optvec result(x.size()); for(int i=0;i