diff options
author | Aaron LI <aaronly.me@outlook.com> | 2017-02-20 12:26:17 +0800 |
---|---|---|
committer | Aaron LI <aaronly.me@outlook.com> | 2017-02-20 12:26:17 +0800 |
commit | 4ea7a05ea9a7352602f1f48a860fd81c36e8bc04 (patch) | |
tree | beab7ec18d48c3e2093cd35fd8c79bd66f604a03 /mass_profile/beta.hpp | |
parent | 9cec16d87f6dc2e0b34b605d88d0837a4a48d18c (diff) | |
download | chandra-acis-analysis-4ea7a05ea9a7352602f1f48a860fd81c36e8bc04.tar.bz2 |
Rename mass_profile to src; Add install & uninstall to Makefile
Diffstat (limited to 'mass_profile/beta.hpp')
-rw-r--r-- | mass_profile/beta.hpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/mass_profile/beta.hpp b/mass_profile/beta.hpp deleted file mode 100644 index 6ae70ac..0000000 --- a/mass_profile/beta.hpp +++ /dev/null @@ -1,45 +0,0 @@ -#ifndef BETA -#define BETA -#include "projector.hpp" - -namespace opt_utilities -{ - template <typename T> - class beta - :public model<std::vector<T>,std::vector<T>,std::vector<T> > - { - public: - beta() - { - this->push_param_info(param_info<std::vector<T>,std::string>("n0",1,0,1E99)); - this->push_param_info(param_info<std::vector<T>,std::string>("beta",.66,0,1E99)); - this->push_param_info(param_info<std::vector<T>,std::string>("rc",100,0,1E99)); - } - - public: - beta<T>* do_clone()const - { - return new beta<T>(*this); - } - - std::vector<T> do_eval(const std::vector<T> & x, - const std::vector<T>& p) - { - T n0=std::abs(p[0]); - T beta=p[1]; - T rc=p[2]; - - std::vector<T> result(x.size()-1); - for(size_t i=1;i<x.size();++i) - { - T xi=(x[i]+x[i-1])/2; - T yi=0; - yi=n0*pow(1+xi*xi/rc/rc,-3./2.*beta); - result[i-1]=yi; - } - return result; - } - }; -} - -#endif |