From 07139e38b8d6baadc30443c7f20551908b3db491 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Sat, 5 Sep 2009 16:17:32 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@60 ed2142bd-67ad-457f-ba7c-d818d4011675 --- core/optimizer.hpp | 156 ++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 155 insertions(+), 1 deletion(-) (limited to 'core') diff --git a/core/optimizer.hpp b/core/optimizer.hpp index 871da7b..6ea5e68 100644 --- a/core/optimizer.hpp +++ b/core/optimizer.hpp @@ -122,6 +122,12 @@ namespace opt_utilities \param th threshold */ virtual void do_set_precision(rT th)=0; + + /** + get the precision + \return threshold + */ + virtual rT do_get_precision()const=0; /** perform the optimization \return final optimized parameter. @@ -139,6 +145,25 @@ namespace opt_utilities \param p the upper limit */ virtual void do_set_upper_limit(const pT& p){}; + + /** + \return start point + */ + virtual pT do_get_start_point()const=0; + /** + \return the lower limit + */ + virtual pT do_get_lower_limit()const + { + return pT(); + }; + /** + \return the upper limit + */ + virtual pT do_get_upper_limit()const + { + return pT(); + }; /** \return the clone of current object */ @@ -168,6 +193,15 @@ namespace opt_utilities { do_set_precision(x); } + + /** + \return precision + */ + + rT get_precision()const + { + return do_get_precision(); + } /** Interface function to set start point @@ -177,6 +211,14 @@ namespace opt_utilities { do_set_start_point(p); } + + /** + \return start point + */ + pT get_start_point()const + { + return do_get_start_point(); + } /** Interface function to set lower limit @@ -188,6 +230,15 @@ namespace opt_utilities do_set_lower_limit(p); } + /** + \return lower limit + */ + + pT get_lower_limit()const + { + return do_get_lower_limit(); + } + /** Interface function to set upper limit \param p upper limit @@ -198,6 +249,15 @@ namespace opt_utilities do_set_upper_limit(p); } + /** + \return upper limit + */ + + pT get_upper_limit()const + { + return do_get_upper_limit(); + } + /** Interface function for performing the optimization \return the optimized parameter. @@ -366,7 +426,7 @@ namespace opt_utilities /** \return a reference of internally kept optimization method */ - opt_method& method() + opt_method& get_opt_method() { if(p_opt_method==0) { @@ -375,6 +435,19 @@ namespace opt_utilities return *(this->p_opt_method); } + + /** + \return a const reference of internally kept optimization method + */ + const opt_method& get_opt_method()const + { + if(p_opt_method=0) + { + throw opt_method_undefined(); + } + return *(this->p_opt_method); + } + /** set precision @@ -389,6 +462,19 @@ namespace opt_utilities p_opt_method->set_precision(x); } + /** + \return precision + */ + + rT get_precision()const + { + if(p_opt_method==0) + { + throw opt_method_undefined(); + } + return p_opt_method->get_precision(); + } + /** set start point @@ -402,6 +488,19 @@ namespace opt_utilities } p_opt_method->set_start_point(x); } + + /** + \return start point + */ + + pT get_start_point()const + { + if(p_opt_method==0) + { + throw opt_method_undefined(); + } + return p_opt_method->get_start_point(); + } /** @@ -418,6 +517,19 @@ namespace opt_utilities } + /** + \return lower limit + */ + pT get_lower_limit()const + { + if(p_opt_method==0) + { + throw opt_method_undefined(); + } + return p_opt_method->get_lower_limit(); + } + + /** set upper limit \param x upper limit @@ -430,6 +542,19 @@ namespace opt_utilities } p_opt_method->set_upper_limit(x); } + + /** + \return upper limit + */ + + pT get_upper_limit()const + { + if(p_opt_method==0) + { + throw opt_method_undefined(); + } + return p_opt_method->get_upper_limit(); + } /** @@ -468,11 +593,40 @@ namespace opt_utilities /** \return the pointer to the inner object function */ + func_obj* ptr_func_obj() { + if(p_func_obj==0) + { + throw object_function_undefined(); + } return p_func_obj; } + + + /** + \return the reference of the internal kept func_obj object + */ + func_obj& get_func_obj() + { + if(p_func_obj==0) + { + throw object_function_undefined(); + } + return *p_func_obj; + } + /** + \return the const reference of the internal kept func_obj object + */ + const func_obj& get_func_obj()const + { + if(p_func_obj==0) + { + throw object_function_undefined(); + } + return *p_func_obj; + } }; } -- cgit v1.2.2