From f9cb256e35ae66ac63adfa9445a94e86ed18f2e0 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Mon, 30 May 2011 17:22:15 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@204 ed2142bd-67ad-457f-ba7c-d818d4011675 --- vmodels/beta1d.hpp | 1 + vmodels/bl.hpp | 5 ++-- vmodels/bpl.hpp | 1 + vmodels/bremss.hpp | 1 + vmodels/constant.hpp | 4 +-- vmodels/dbeta1d.hpp | 1 + vmodels/dualgauss1d.hpp | 1 + vmodels/gauss1d.hpp | 1 + vmodels/lin1d.hpp | 1 + vmodels/nbeta1d.hpp | 1 + vmodels/nfw.hpp | 4 +-- vmodels/nfw_int.hpp | 4 +-- vmodels/poly1d.hpp | 10 ++----- vmodels/powerlaw.hpp | 4 +-- vmodels/quad_pl.hpp | 4 +-- vmodels/rquarter.hpp | 66 ++++++++++++++++++++++++++++++++++++++++++++++ vmodels/vt_temperature.hpp | 7 ++++- 17 files changed, 94 insertions(+), 22 deletions(-) create mode 100644 vmodels/rquarter.hpp (limited to 'vmodels') diff --git a/vmodels/beta1d.hpp b/vmodels/beta1d.hpp index 8d4d714..fe49a0b 100644 --- a/vmodels/beta1d.hpp +++ b/vmodels/beta1d.hpp @@ -60,6 +60,7 @@ namespace opt_utilities private: std::string do_get_information()const { +#include return ""; } }; diff --git a/vmodels/bl.hpp b/vmodels/bl.hpp index dc2a0da..6561e28 100644 --- a/vmodels/bl.hpp +++ b/vmodels/bl.hpp @@ -61,9 +61,8 @@ namespace opt_utilities private: std::string do_get_information()const { - return "broken linear model\n" - "y=k1*(x-x_b)+y_b for x + return ""; } }; } diff --git a/vmodels/bpl.hpp b/vmodels/bpl.hpp index a1f43aa..78c1fa1 100644 --- a/vmodels/bpl.hpp +++ b/vmodels/bpl.hpp @@ -64,6 +64,7 @@ namespace opt_utilities std::string do_get_information()const { #include + return ""; } }; } diff --git a/vmodels/bremss.hpp b/vmodels/bremss.hpp index 6d9f317..c7f6652 100644 --- a/vmodels/bremss.hpp +++ b/vmodels/bremss.hpp @@ -46,6 +46,7 @@ namespace opt_utilities private: std::string do_get_information()const { +#include return ""; } }; diff --git a/vmodels/constant.hpp b/vmodels/constant.hpp index 888ef8e..fc61f4e 100644 --- a/vmodels/constant.hpp +++ b/vmodels/constant.hpp @@ -49,8 +49,8 @@ namespace opt_utilities private: std::string do_get_information()const { - return "Constant\n" - "y=C\n"; +#include + return ""; } }; } diff --git a/vmodels/dbeta1d.hpp b/vmodels/dbeta1d.hpp index 40f881d..6f5d1ad 100644 --- a/vmodels/dbeta1d.hpp +++ b/vmodels/dbeta1d.hpp @@ -73,6 +73,7 @@ namespace opt_utilities private: std::string do_get_information()const { +#include return ""; } }; diff --git a/vmodels/dualgauss1d.hpp b/vmodels/dualgauss1d.hpp index 221fe54..aba5df0 100644 --- a/vmodels/dualgauss1d.hpp +++ b/vmodels/dualgauss1d.hpp @@ -58,6 +58,7 @@ namespace opt_utilities private: std::string do_get_information()const { +#include return ""; } }; diff --git a/vmodels/gauss1d.hpp b/vmodels/gauss1d.hpp index da9c5df..641b3f7 100644 --- a/vmodels/gauss1d.hpp +++ b/vmodels/gauss1d.hpp @@ -51,6 +51,7 @@ namespace opt_utilities private: std::string do_get_information()const { +#include return ""; } }; diff --git a/vmodels/lin1d.hpp b/vmodels/lin1d.hpp index 701e8e3..53424c3 100644 --- a/vmodels/lin1d.hpp +++ b/vmodels/lin1d.hpp @@ -55,6 +55,7 @@ namespace opt_utilities std::string do_get_information()const { #include + return ""; } }; } diff --git a/vmodels/nbeta1d.hpp b/vmodels/nbeta1d.hpp index cbf0bc2..28097ab 100644 --- a/vmodels/nbeta1d.hpp +++ b/vmodels/nbeta1d.hpp @@ -58,6 +58,7 @@ namespace opt_utilities private: std::string do_get_information()const { +#include return ""; } }; diff --git a/vmodels/nfw.hpp b/vmodels/nfw.hpp index a46ed87..5b78f4e 100644 --- a/vmodels/nfw.hpp +++ b/vmodels/nfw.hpp @@ -45,8 +45,8 @@ namespace opt_utilities private: std::string do_get_information()const { - return "NFW mass profile\n" - "y=rho0/(x/rs*(1+x/rs)^2)\n"; +#include + return ""; } }; } diff --git a/vmodels/nfw_int.hpp b/vmodels/nfw_int.hpp index b3e8b54..de7024f 100644 --- a/vmodels/nfw_int.hpp +++ b/vmodels/nfw_int.hpp @@ -45,8 +45,8 @@ namespace opt_utilities private: std::string do_get_information()const { - return "integrated NFW mass profile\n" - "y=rho0/(x/rs*(1+x/rs)^2)\n"; +#include + return ""; } }; } diff --git a/vmodels/poly1d.hpp b/vmodels/poly1d.hpp index 113ef83..1fc81d3 100644 --- a/vmodels/poly1d.hpp +++ b/vmodels/poly1d.hpp @@ -67,14 +67,8 @@ namespace opt_utilities private: std::string do_get_information()const { - std::ostringstream ostr; - ostr< + return ""; } }; } diff --git a/vmodels/powerlaw.hpp b/vmodels/powerlaw.hpp index c30dbb6..ac6ec80 100644 --- a/vmodels/powerlaw.hpp +++ b/vmodels/powerlaw.hpp @@ -45,8 +45,8 @@ namespace opt_utilities private: std::string do_get_information()const { - return "Simple power law model\n" - "y=A*x^gamma\n"; +#include + return ""; } }; } diff --git a/vmodels/quad_pl.hpp b/vmodels/quad_pl.hpp index a0a25a4..14ad752 100644 --- a/vmodels/quad_pl.hpp +++ b/vmodels/quad_pl.hpp @@ -47,8 +47,8 @@ namespace opt_utilities private: std::string do_get_information()const { - return "Simple power law model\n" - "y=A*x^gamma\n"; +#include + return ""; } }; } diff --git a/vmodels/rquarter.hpp b/vmodels/rquarter.hpp new file mode 100644 index 0000000..7f37924 --- /dev/null +++ b/vmodels/rquarter.hpp @@ -0,0 +1,66 @@ +/** + \file lin1d.hpp + \brief linear + \author Junhua Gu + */ + + +#ifndef VRQUARTER_MODEL_H_ +#define VRQUARTER_MODEL_H_ +#define OPT_HEADER +#include +#include +#include + +namespace opt_utilities +{ + template + class rquarter + :public model,optvec,optvec,std::string> + { + typedef optvec Tv; + private: + rquarter* do_clone()const + { + return new rquarter(*this); + } + + const char* do_get_type_name()const + { + return "de Vaucoulurs 1/4 law"; + } + public: + rquarter() + { + this->push_param_info(param_info("I0",1)); + this->push_param_info(param_info("Re",10)); + this->push_param_info(param_info("bkg",0)); + } + + public: + Tv do_eval(const Tv& x,const Tv& param) + { + Tv result(x.size()); + + + //return x*get_element(param,0)+get_element(param,1); + for(size_t i=0;i!=x.size();++i) + { + result[i]=param[0]*exp(-7.67*(pow(x[i]/param[1],.25)-T(1.)))+param[2]; + } + return result; + } + + private: + std::string do_get_information()const + { +#include + return ""; + } + }; +} + + + +#endif +//EOF diff --git a/vmodels/vt_temperature.hpp b/vmodels/vt_temperature.hpp index f6fb55e..0778794 100644 --- a/vmodels/vt_temperature.hpp +++ b/vmodels/vt_temperature.hpp @@ -50,7 +50,12 @@ public: } return result; } - + + std::string do_get_information()const + { +#include + return ""; + } }; #endif -- cgit v1.2.2