aboutsummaryrefslogtreecommitdiffstats
path: root/vmodels/rquarter.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'vmodels/rquarter.hpp')
-rw-r--r--vmodels/rquarter.hpp66
1 files changed, 66 insertions, 0 deletions
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