#ifndef CONSTANT_MODEL_H_ #define CONSTANT_MODEL_H_ #define OPT_HEADER #include #include namespace opt_utilities { template class constant :public model,std::string> { private: model >* do_clone()const { return new constant(*this); } public: constant() { this->push_param_info(param_info >("c",1)); } public: T do_eval(const T& x,const std::vector& param) { //return x*param[0]+param[1]; return get_element(param,0); } private: std::string do_to_string()const { return "Constant\n" "y=C\n"; } }; } #endif //EOF