#ifndef BROKEN_LINE_MODEL_H_ #define BROKEN_LINE_MODEL_H_ #define OPT_HEADER #include #include #include namespace opt_utilities { template class bl :public model,optvec,optvec,std::string> { private: model,optvec,optvec,std::string >* do_clone()const { return new bl(*this); } const char* do_get_type_name()const { return "broken linear model"; } public: bl() { this->push_param_info(param_info >("break point y value",1)); this->push_param_info(param_info >("break point x value",1)); this->push_param_info(param_info >("slop 1",1)); this->push_param_info(param_info >("slop 2",1)); } public: optvec do_eval(const optvec& x,const optvec& param) { T x_b=get_element(param,0); T f_b=get_element(param,1); T k1=get_element(param,2); T k2=get_element(param,3); optvec result(x.size()); for(int i=0;i