diff options
author | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2011-01-25 16:52:29 +0000 |
---|---|---|
committer | astrojhgu <astrojhgu@ed2142bd-67ad-457f-ba7c-d818d4011675> | 2011-01-25 16:52:29 +0000 |
commit | 7c0296b99989ac0e177a3e07e2aa40e8eb96f50c (patch) | |
tree | 9c2d4393ba6543cc1c816924ce5577aa6eb5c49c /interface/perform_fit.hpp | |
parent | 50e769e8f1a5234c3ca3969088e407d3212e6ce3 (diff) | |
download | opt-utilities-7c0296b99989ac0e177a3e07e2aa40e8eb96f50c.tar.bz2 |
git-svn-id: file:///home/svn/opt_utilities@166 ed2142bd-67ad-457f-ba7c-d818d4011675
Diffstat (limited to 'interface/perform_fit.hpp')
-rw-r--r-- | interface/perform_fit.hpp | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/interface/perform_fit.hpp b/interface/perform_fit.hpp new file mode 100644 index 0000000..5ae4e6d --- /dev/null +++ b/interface/perform_fit.hpp @@ -0,0 +1,42 @@ +#include <statistics/chisq.hpp> +#include <statistics/cstat.hpp> +#include <data_sets/default_data_set.hpp> +#include <core/fitter.hpp> +#include <core/opt_traits.hpp> +#include <core/freeze_param.hpp> +#include <methods/powell/powell_method.hpp> +#include <models/gauss1d.hpp> +#include <models/bl1d.hpp> +#include <models/bpl1d.hpp> +#include <models/beta1d.hpp> +#include <models/dbeta1d.hpp> +#include <models/lin1d.hpp> +#include <models/poly1d.hpp> +#include <models/pl1d.hpp> +#include <models/models.hpp> + +namespace opt_utilities +{ + + template <typename Ty,typename Tx,typename Tp,typename Ts, + typename Tstr> + void perform_fit(const char* model_name, + const char* method_name, + const char* statistic_name, + const datat_set<Ty,Tx>& ds, + const char* froze_parameters + ) + { + fitter<Ty,Tx,Tp,Ts,Tstr> fit; + fit.load_data(ds); + const statistic<Ty,Tx,Tp,Ts,Tstr>* pstat=get_statistic(statistic_name); + fit.set_statistic(*pstat); + const opt_method<Ts,Tp>* popm=get_opt_method(method_name); + fit.set_opt_method(*popm); + const model<Ty,Tx,Tp,Tstr>* pmo=get_model(model_name); + fit.set_model(*pmo); + fit.fit(); + } + + +} |