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 --- data_sets/sorted_data_set.hpp | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) (limited to 'data_sets') 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