diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/fitter.hpp | 9 | ||||
-rw-r--r-- | core/opt_exception.hpp | 9 |
2 files changed, 18 insertions, 0 deletions
diff --git a/core/fitter.hpp b/core/fitter.hpp index 609a2ab..cd76a20 100644 --- a/core/fitter.hpp +++ b/core/fitter.hpp @@ -228,6 +228,10 @@ namespace opt_utilities private:
virtual const data<Ty,Tx>& do_get_data(size_t i)const=0;
+ virtual void do_set_data(size_t i,const data<Ty,Tx>& d)
+ {
+ throw data_unsetable();
+ }
virtual size_t do_size()const=0;
virtual void do_add_data(const data<Ty,Tx>&)=0;
virtual void do_clear()=0;
@@ -256,6 +260,11 @@ namespace opt_utilities return this->do_get_data(i);
}
+ void set_data(size_t i,const data<Ty,Tx>& d)
+ {
+ do_set_data(i,d);
+ }
+
/**
\return the size of the data set
*/
diff --git a/core/opt_exception.hpp b/core/opt_exception.hpp index 027f783..df9030a 100644 --- a/core/opt_exception.hpp +++ b/core/opt_exception.hpp @@ -143,6 +143,15 @@ namespace opt_utilities {} }; + class data_unsetable + :public opt_exception + { + public: + data_unsetable() + :opt_exception("data unsetable") + {} + }; + } |