/** \file nfw.hpp \brief NFW model \author Junhua Gu */ #ifndef NFW_MODEL_H_ #define NFW_MODEL_H_ #define OPT_HEADER #include #include #include namespace opt_utilities { template class nfw :public model,optvec,optvec,std::string> { private: nfw* do_clone()const { return new nfw(*this); } const char* do_get_type_name()const { return "nfw mass profile"; } public: nfw() { this->push_param_info(param_info >("rho0",1)); this->push_param_info(param_info >("rs",1)); } optvec do_eval(const optvec& x,const optvec& param) { T rho0=get_element(param,0); T rs=get_element(param,1); return rho0/(x/rs*(x/rs+T(1))*(x/rs+T(1))); } private: std::string do_get_information()const { return "NFW mass profile\n" "y=rho0/(x/rs*(1+x/rs)^2)\n"; } }; } #endif //EOF