diff options
-rw-r--r-- | core/fitter.hpp | 33 | ||||
-rw-r--r-- | data_sets/sorted_data_set.hpp | 38 |
2 files changed, 71 insertions, 0 deletions
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<Tp,Tstr>& pinfo)
+ {
+ for(typename std::vector<param_info<Tp,Tstr> >::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<Tp,Tstr>& 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<Ty,Tx>& rhs) + :data_vec(rhs.data_vec) + {} + + sorted_data_set& operator=(const sorted_data_set<Ty,Tx>& rhs) + { + data_vec=rhs.data_vec; + return *this; + } + + sorted_data_set(const data_set<Ty,Tx>& rhs) + { + for(int i=0;i<rhs.size();++i) + { + typename std::vector<data<Ty,Tx> >::iterator p + =std::lower_bound(data_vec.begin(),data_vec.end(),rhs.get_data(i),comp_data<Ty,Tx>); + //data_vec.push_back(d); + data_vec.insert(p,rhs.get_data(i)); + } + } + + sorted_data_set& operator=(const data_set<Ty,Tx>& rhs) + { + data_vec.clear(); + for(int i=0;i<rhs.size();++i) + { + typename std::vector<data<Ty,Tx> >::iterator p + =std::lower_bound(data_vec.begin(),data_vec.end(),rhs.get_data(i),comp_data<Ty,Tx>); + //data_vec.push_back(d); + data_vec.insert(p,rhs.get_data(i)); + } + return *this; + } + }; } |