/** \file constant.hpp \brief constant model \author Junhua Gu */ #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); } const char* do_get_type_name()const { return "constant"; } 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_get_information()const { return "Constant\n" "y=C\n"; } }; } #endif //EOF