diff options
author | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2011-05-25 16:43:23 +0000 |
---|---|---|
committer | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2011-05-25 16:43:23 +0000 |
commit | 8fc9f8375a8531fdf1b48eebdee2c5668448f0e0 (patch) | |
tree | 10cd56ef5208a70368ffadaa45a9c2fa2820fcc5 | |
parent | 3b35e76b5bc121b48fd7e91810d09f5f62f1ecf1 (diff) | |
download | opt-utilities-8fc9f8375a8531fdf1b48eebdee2c5668448f0e0.tar.bz2 |
git-svn-id: file:///home/svn/opt_utilities@200 ed2142bd-67ad-457f-ba7c-d818d4011675
-rw-r--r-- | vmodels/nfw_int.hpp | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/vmodels/nfw_int.hpp b/vmodels/nfw_int.hpp new file mode 100644 index 0000000..b3e8b54 --- /dev/null +++ b/vmodels/nfw_int.hpp @@ -0,0 +1,57 @@ +/** + \file nfw_int.hpp + \brief NFW_INT model + \author Junhua Gu + */ + + +#ifndef NFW_INT_MODEL_H_ +#define NFW_INT_MODEL_H_ +#define OPT_HEADER +#include <core/fitter.hpp> +#include <cmath> +#include <misc/optvec.hpp> + +namespace opt_utilities +{ + template <typename T> + class nfw_int + :public model<optvec<T>,optvec<T>,optvec<T>,std::string> + { + private: + nfw_int* do_clone()const + { + return new nfw_int<T>(*this); + } + + const char* do_get_type_name()const + { + return "nfw_int mass profile"; + } + public: + nfw_int() + { + this->push_param_info(param_info<optvec<T> >("rho0",1)); + this->push_param_info(param_info<optvec<T> >("rs",1)); + } + + optvec<T> do_eval(const optvec<T>& x,const optvec<T>& param) + { + T rho0=get_element(param,0); + T rs=get_element(param,1); + return 4*3.1415926*rho0*rs*rs*rs*(std::log((x+rs)/rs)-x/(x+rs)); + } + + private: + std::string do_get_information()const + { + return "integrated NFW mass profile\n" + "y=rho0/(x/rs*(1+x/rs)^2)\n"; + } + }; +} + + + +#endif +//EOF |