From 81860e1b50373d070ab8ff2a0d6e8bff44b0216a Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Sun, 6 Sep 2009 17:06:20 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@64 ed2142bd-67ad-457f-ba7c-d818d4011675 --- core/fitter.hpp | 33 +++++++++++++++++++++++++++++++++ data_sets/sorted_data_set.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 71 insertions(+) diff --git a/core/fitter.hpp b/core/fitter.hpp index 5a2cba4..d38b437 100644 --- a/core/fitter.hpp +++ b/core/fitter.hpp @@ -709,6 +709,25 @@ namespace opt_utilities return get_num_params(); } + /** + \param pinfo param information being set + */ + void set_param_info(const param_info& pinfo) + { + for(typename std::vector >::iterator i=param_info_list.begin(); + i!=param_info_list.end();++i) + { + if(i->get_name()==pinfo.get_name()) + { + i->set_value(pinfo.get_value()); + i->set_lower_limit(pinfo.get_lower_limit()); + i->set_upper_limit(pinfo.get_upper_limit()); + return; + } + } + throw param_not_found(); + } + /** \param pname the name of the parameter @@ -1387,6 +1406,20 @@ namespace opt_utilities return p_model->get_param_info(pname).get_upper_limit(); } + + /** + \param pinfo the param information being set + */ + + void set_param_info(const param_info& pinfo) + { + if(p_model==0) + { + throw model_undefined(); + } + p_model->set_param_info(pinfo); + } + /** get the param_info of a parameter diff --git a/data_sets/sorted_data_set.hpp b/data_sets/sorted_data_set.hpp index 2e0c3cc..034a442 100644 --- a/data_sets/sorted_data_set.hpp +++ b/data_sets/sorted_data_set.hpp @@ -61,6 +61,44 @@ namespace opt_utilities data_vec.clear(); } + public: + sorted_data_set() + {} + + sorted_data_set(const sorted_data_set& rhs) + :data_vec(rhs.data_vec) + {} + + sorted_data_set& operator=(const sorted_data_set& rhs) + { + data_vec=rhs.data_vec; + return *this; + } + + sorted_data_set(const data_set& rhs) + { + for(int i=0;i >::iterator p + =std::lower_bound(data_vec.begin(),data_vec.end(),rhs.get_data(i),comp_data); + //data_vec.push_back(d); + data_vec.insert(p,rhs.get_data(i)); + } + } + + sorted_data_set& operator=(const data_set& rhs) + { + data_vec.clear(); + for(int i=0;i >::iterator p + =std::lower_bound(data_vec.begin(),data_vec.end(),rhs.get_data(i),comp_data); + //data_vec.push_back(d); + data_vec.insert(p,rhs.get_data(i)); + } + return *this; + } + }; } -- cgit v1.2.2