From ceb836399f56b60ad82a73e67f4cbd361d834582 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Mon, 6 Apr 2009 16:36:52 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@18 ed2142bd-67ad-457f-ba7c-d818d4011675 --- core/default_data_set.hpp | 47 ---------------------------------- core/sorted_data_set.hpp | 57 ------------------------------------------ data_sets/default_data_set.hpp | 47 ++++++++++++++++++++++++++++++++++ data_sets/sorted_data_set.hpp | 57 ++++++++++++++++++++++++++++++++++++++++++ interface/opt.cc | 2 +- utilities/opt_types.hpp | 2 +- 6 files changed, 106 insertions(+), 106 deletions(-) delete mode 100644 core/default_data_set.hpp delete mode 100644 core/sorted_data_set.hpp create mode 100644 data_sets/default_data_set.hpp create mode 100644 data_sets/sorted_data_set.hpp diff --git a/core/default_data_set.hpp b/core/default_data_set.hpp deleted file mode 100644 index 20992c4..0000000 --- a/core/default_data_set.hpp +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef DEFAULT_DATA_SET -#define DEFAULT_DATA_SET -#include "fitter.hpp" -#include - - -namespace opt_utilities -{ - -template -class default_data_set - :public data_set -{ -private: - std::vector > data_vec; - - data_set* do_clone()const - { - return new default_data_set(*this); - } - - - const data& do_get_data(size_t i)const - { - return data_vec.at(i); - } - - size_t do_size()const - { - return data_vec.size(); - } - - void do_add_data(const data& d) - { - data_vec.push_back(d); - } - - void do_clear() - { - data_vec.clear(); - } - -}; -} - -#endif -//EOF diff --git a/core/sorted_data_set.hpp b/core/sorted_data_set.hpp deleted file mode 100644 index f825b6c..0000000 --- a/core/sorted_data_set.hpp +++ /dev/null @@ -1,57 +0,0 @@ -#ifndef SORTED_DATA_SET -#define SORTED_DATA_SET -#include "fitter.hpp" -#include -#include - -namespace opt_utilities -{ - - template - bool comp_data(const data& d1,const data& d2) - { - return d1.get_x() -class sorted_data_set - :public data_set -{ -private: - std::vector > data_vec; - - data_set* do_clone()const - { - return new sorted_data_set(*this); - } - - - const data& do_get_data(size_t i)const - { - return data_vec.at(i); - } - - size_t do_size()const - { - return data_vec.size(); - } - - void do_add_data(const data& d) - { - typename std::vector >::iterator p - =std::lower_bound(data_vec.begin(),data_vec.end(),d,comp_data); - //data_vec.push_back(d); - data_vec.insert(p,d); - } - - void do_clear() - { - data_vec.clear(); - } - -}; -} - -#endif -//EOF diff --git a/data_sets/default_data_set.hpp b/data_sets/default_data_set.hpp new file mode 100644 index 0000000..887e3d2 --- /dev/null +++ b/data_sets/default_data_set.hpp @@ -0,0 +1,47 @@ +#ifndef DEFAULT_DATA_SET +#define DEFAULT_DATA_SET +#include "core/fitter.hpp" +#include + + +namespace opt_utilities +{ + +template +class default_data_set + :public data_set +{ +private: + std::vector > data_vec; + + data_set* do_clone()const + { + return new default_data_set(*this); + } + + + const data& do_get_data(size_t i)const + { + return data_vec.at(i); + } + + size_t do_size()const + { + return data_vec.size(); + } + + void do_add_data(const data& d) + { + data_vec.push_back(d); + } + + void do_clear() + { + data_vec.clear(); + } + +}; +} + +#endif +//EOF diff --git a/data_sets/sorted_data_set.hpp b/data_sets/sorted_data_set.hpp new file mode 100644 index 0000000..f12edac --- /dev/null +++ b/data_sets/sorted_data_set.hpp @@ -0,0 +1,57 @@ +#ifndef SORTED_DATA_SET +#define SORTED_DATA_SET +#include "core/fitter.hpp" +#include +#include + +namespace opt_utilities +{ + + template + bool comp_data(const data& d1,const data& d2) + { + return d1.get_x() +class sorted_data_set + :public data_set +{ +private: + std::vector > data_vec; + + data_set* do_clone()const + { + return new sorted_data_set(*this); + } + + + const data& do_get_data(size_t i)const + { + return data_vec.at(i); + } + + size_t do_size()const + { + return data_vec.size(); + } + + void do_add_data(const data& d) + { + typename std::vector >::iterator p + =std::lower_bound(data_vec.begin(),data_vec.end(),d,comp_data); + //data_vec.push_back(d); + data_vec.insert(p,d); + } + + void do_clear() + { + data_vec.clear(); + } + +}; +} + +#endif +//EOF diff --git a/interface/opt.cc b/interface/opt.cc index ce492d1..42dfcb3 100644 --- a/interface/opt.cc +++ b/interface/opt.cc @@ -3,7 +3,7 @@ #include #include #include -#include +#include //#include using namespace std; diff --git a/utilities/opt_types.hpp b/utilities/opt_types.hpp index 46846cd..fd76169 100644 --- a/utilities/opt_types.hpp +++ b/utilities/opt_types.hpp @@ -2,7 +2,7 @@ #define OPT_TYPES_HPP #include #include -#include +#include #include #include #include -- cgit v1.2.2