diff options
author | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2011-05-30 17:22:15 +0000 |
---|---|---|
committer | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2011-05-30 17:22:15 +0000 |
commit | f9cb256e35ae66ac63adfa9445a94e86ed18f2e0 (patch) | |
tree | b4dde6c2f5149470a179a7f3e225b3def08433c6 | |
parent | d564a1ea7e79c892462ef2b5b8e0f9576872f922 (diff) | |
download | opt-utilities-f9cb256e35ae66ac63adfa9445a94e86ed18f2e0.tar.bz2 |
git-svn-id: file:///home/svn/opt_utilities@204 ed2142bd-67ad-457f-ba7c-d818d4011675
41 files changed, 331 insertions, 22 deletions
diff --git a/distributions/normed_dgauss1d.hpp b/distributions/normed_dgauss1d.hpp index 5405de8..7aa29f6 100644 --- a/distributions/normed_dgauss1d.hpp +++ b/distributions/normed_dgauss1d.hpp @@ -71,6 +71,7 @@ namespace opt_utilities private: std::string do_get_information()const { +#include <model_doc/normed_dgauss1d.info> return ""; } }; diff --git a/distributions/normed_gauss1d.hpp b/distributions/normed_gauss1d.hpp index 03a69cb..68114a3 100644 --- a/distributions/normed_gauss1d.hpp +++ b/distributions/normed_gauss1d.hpp @@ -55,6 +55,7 @@ namespace opt_utilities private: std::string do_get_information()const { +#include <model_doc/normed_gauss1d.info> return ""; } }; diff --git a/distributions/uniformed.hpp b/distributions/uniformed.hpp index b40d079..8cde0b7 100644 --- a/distributions/uniformed.hpp +++ b/distributions/uniformed.hpp @@ -54,6 +54,7 @@ namespace opt_utilities private: std::string do_get_information()const { +#include <model_doc/uniformed.info> return ""; } }; diff --git a/model_doc/beta1d.tex b/model_doc/beta1d.tex new file mode 100644 index 0000000..25b1ff8 --- /dev/null +++ b/model_doc/beta1d.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + S(r)=S_0(1+\frac{r^2}{r_c^2})^{-3\beta+1/2}+bkg\notag +\end{equation} +\end{document} diff --git a/model_doc/bl.tex b/model_doc/bl.tex new file mode 100644 index 0000000..a972ee4 --- /dev/null +++ b/model_doc/bl.tex @@ -0,0 +1,16 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + y=\left\{ + \begin{array}{cc} + k_1(x-x_b)+y_b& x<x_b\\ + k_2(x-x_b)+y_b& x\geq x_b + \end{array} + \right .\notag +\end{equation} +\end{document} diff --git a/model_doc/bremss.tex b/model_doc/bremss.tex new file mode 100644 index 0000000..f992b9e --- /dev/null +++ b/model_doc/bremss.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + I(E)=N\sqrt{kT}e^{-\frac{E}{kT}}\notag +\end{equation} +\end{document} diff --git a/model_doc/component.tex b/model_doc/component.tex new file mode 100644 index 0000000..871d8a2 --- /dev/null +++ b/model_doc/component.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + y=\sum_{i=1}^{N} N_i P_i(x) +\end{equation} +\end{document} diff --git a/model_doc/constant.tex b/model_doc/constant.tex new file mode 100644 index 0000000..b95a41f --- /dev/null +++ b/model_doc/constant.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + y=Const\notag +\end{equation} +\end{document} diff --git a/model_doc/dbeta1d.tex b/model_doc/dbeta1d.tex new file mode 100644 index 0000000..93a93e5 --- /dev/null +++ b/model_doc/dbeta1d.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + S(r)=S_{0,1}(1+\frac{r^2}{r_{c,1}^2})^{-3\beta_1+1/2}+S_{0,2}(1+\frac{r^2}{r_{c,2}^2})^{-3\beta_2+1/2}\notag +\end{equation} +\end{document} diff --git a/model_doc/dualgauss1d.tex b/model_doc/dualgauss1d.tex new file mode 100644 index 0000000..0a0e009 --- /dev/null +++ b/model_doc/dualgauss1d.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + y=N_{0,1}e^{-\frac{x^2}{2\sigma_1^2}}+N_{0,2}e^{-\frac{x^2}{2\sigma_2^2}}\notag +\end{equation} +\end{document} diff --git a/model_doc/gauss1d.tex b/model_doc/gauss1d.tex new file mode 100644 index 0000000..fefffa9 --- /dev/null +++ b/model_doc/gauss1d.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + y=Ne^{-\frac{x^2}{2\sigma^2}}\notag +\end{equation} +\end{document} diff --git a/model_doc/kmm_component.tex b/model_doc/kmm_component.tex new file mode 100644 index 0000000..e474924 --- /dev/null +++ b/model_doc/kmm_component.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + y=kx+b\notag +\end{equation} +\end{document} diff --git a/model_doc/make_doc.sh b/model_doc/make_doc.sh index d0aee70..0bd5a53 100755 --- a/model_doc/make_doc.sh +++ b/model_doc/make_doc.sh @@ -10,3 +10,4 @@ rm -f *.sk rm -f *.ps rm -f *.dvi rm -f *.log +rm -f *.svg diff --git a/model_doc/nbeta1d.tex b/model_doc/nbeta1d.tex new file mode 100644 index 0000000..6b9ddaf --- /dev/null +++ b/model_doc/nbeta1d.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + S(R)=n_0(1+\frac{R^2}{R_c^2})^{-3\beta/2}\notag +\end{equation} +\end{document} diff --git a/model_doc/nfw.tex b/model_doc/nfw.tex new file mode 100644 index 0000000..bfbf9ef --- /dev/null +++ b/model_doc/nfw.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + \rho(R)=\frac{\rho_0}{\frac{R}{R_s}(1+\frac{R}{R_s})^2}\notag +\end{equation} +\end{document} diff --git a/model_doc/nfw_int.tex b/model_doc/nfw_int.tex new file mode 100644 index 0000000..720b7d8 --- /dev/null +++ b/model_doc/nfw_int.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + M(<R)=4\pi\rho_0R_s^3(\ln(\frac{R+R_s}{R_s})-\frac{R}{R+R_s})\notag +\end{equation} +\end{document} diff --git a/model_doc/normed_dgauss1d.tex b/model_doc/normed_dgauss1d.tex new file mode 100644 index 0000000..705995b --- /dev/null +++ b/model_doc/normed_dgauss1d.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + P(x)=\cos^2\theta \frac{1}{\sqrt{2\pi\sigma_1^2}}e^{-\frac{x^2}{2\sigma_1^2}}+\sin^2\theta \frac{1}{\sqrt{2\pi\sigma_2^2}}e^{-\frac{x^2}{2\sigma_2^2}} +\end{equation} +\end{document} diff --git a/model_doc/normed_gauss1d.tex b/model_doc/normed_gauss1d.tex new file mode 100644 index 0000000..4629c4f --- /dev/null +++ b/model_doc/normed_gauss1d.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + P(x)=\frac{1}{\sqrt{2\pi\sigma^2}}e^{-\frac{x^2}{2\sigma^2}}\notag +\end{equation} +\end{document} diff --git a/model_doc/poly1d.tex b/model_doc/poly1d.tex new file mode 100644 index 0000000..12b26a1 --- /dev/null +++ b/model_doc/poly1d.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + y=\sum_{k=0}^Na_k x^k\notag +\end{equation} +\end{document} diff --git a/model_doc/powerlaw.tex b/model_doc/powerlaw.tex new file mode 100644 index 0000000..5772a3d --- /dev/null +++ b/model_doc/powerlaw.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + y=A x^\gamma\notag +\end{equation} +\end{document} diff --git a/model_doc/quad_pl.tex b/model_doc/quad_pl.tex new file mode 100644 index 0000000..ba474cb --- /dev/null +++ b/model_doc/quad_pl.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + y=c\exp(a\ln^2 x+b\ln x)\notag +\end{equation} +\end{document} diff --git a/model_doc/rquarter.tex b/model_doc/rquarter.tex new file mode 100644 index 0000000..c32c057 --- /dev/null +++ b/model_doc/rquarter.tex @@ -0,0 +1,11 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + I(r)=I_0e^{-7.67(\frac{r}{r_e})^{1/4}-1}+bkg\notag +\end{equation} +\end{document} diff --git a/model_doc/uniformed.tex b/model_doc/uniformed.tex new file mode 100644 index 0000000..e7934c6 --- /dev/null +++ b/model_doc/uniformed.tex @@ -0,0 +1,16 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{equation} + P(x)=\left\{ + \begin{array}{cc} + \frac{1}{b-a}&a<x<b\\ + 0&{\rm otherwise} + \end{array} + \right .\notag +\end{equation} +\end{document} diff --git a/model_doc/vt_temperature.tex b/model_doc/vt_temperature.tex new file mode 100644 index 0000000..5fb699b --- /dev/null +++ b/model_doc/vt_temperature.tex @@ -0,0 +1,14 @@ +\documentclass{article} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{amsfonts} + +\thispagestyle{empty} +\begin{document} +\begin{gather} + T(R)=T_0T_{\rm cool}(R)t(R)\\ + T_{\rm cool}(R)=\frac{(x+T_{\rm min}/T_0)}{x+1}\\ + t(R)=\frac{(\frac{R}{R_t})^{-1}}{[(\frac{R}{R_t})^b+1]^{c/b}}\\ + x=(\frac{R}{R_{\rm cool}})^{a_{\rm cool}} +\end{gather} +\end{document} 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 <model_doc/beta1d.info> 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<x_b\n" - "y=k2*(x-x_b)+y_b otherwise\n"; +#include <model_doc/bl.info> + 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 <model_doc/bpl.info> + 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 <model_doc/bremss.info> 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 <model_doc/constant.info> + 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 <model_doc/dbeta1d.info> 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 <model_doc/dualgauss1d.info> 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 <model_doc/gauss1d.info> 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 <model_doc/lin1d.info> + 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 <model_doc/nbeta1d.info> 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 <model_doc/nfw.info> + 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 <model_doc/nfw_int.info> + 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<<n<<"-order polynorminal model\n"; - for(int i=0;i<n;++i) - { - ostr<<"a"<<i<<"*x^"<<i<<"+"; - } - ostr<<"a"<<n<<"*x^"<<n; - return ostr.str(); +#include <model_doc/poly1d.info> + 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 <model_doc/powerlaw.info> + 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 <model_doc/quad_pl.info> + 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 <core/fitter.hpp> +#include <misc/optvec.hpp> +#include <cmath> + +namespace opt_utilities +{ + template <typename T> + class rquarter + :public model<optvec<T>,optvec<T>,optvec<T>,std::string> + { + typedef optvec<T> Tv; + private: + rquarter<T>* do_clone()const + { + return new rquarter<T>(*this); + } + + const char* do_get_type_name()const + { + return "de Vaucoulurs 1/4 law"; + } + public: + rquarter() + { + this->push_param_info(param_info<Tv>("I0",1)); + this->push_param_info(param_info<Tv>("Re",10)); + this->push_param_info(param_info<Tv>("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 <model_doc/rquarter.info> + 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 <model_doc/vt_temperature.info> + return ""; + } }; #endif |