From ecd625f55e583a1960f2fc82507132a05fc6fbc4 Mon Sep 17 00:00:00 2001 From: astrojhgu Date: Thu, 6 Jan 2011 10:20:17 +0000 Subject: git-svn-id: file:///home/svn/opt_utilities@158 ed2142bd-67ad-457f-ba7c-d818d4011675 --- error_estimator/error_estimator.hpp | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'error_estimator') diff --git a/error_estimator/error_estimator.hpp b/error_estimator/error_estimator.hpp index 3b6f889..e76fb12 100644 --- a/error_estimator/error_estimator.hpp +++ b/error_estimator/error_estimator.hpp @@ -29,14 +29,15 @@ namespace opt_utilities typedef typename element_type_trait::element_type Tpe; std::vector pnames; std::vector pvalues; - + //Make sure we start from an optimal parameter set + fit.fit(); + //stores origin parameter values for(int i=0;i(pname)); } - + //get current statistic value Tpe current_value= fit.get_param_value(pname); - + //initial lower boundary should be a worse parameter, + //so do the upper boundary if(lower>=current_value||upper<=current_value) { std::cerr<<"Error, initial lower and upper limits should be smaller and larger than the best fit value, respectively"<std::abs(precision)) { - std::cerr<=0) { upper=(upper+upper1)/2; @@ -149,7 +150,6 @@ namespace opt_utilities fit.set_param_value(pname,(lower+lower1)/2); fit.fit(); Ts s01=fit.get_statistic_value(); - //std::cerr<<"l:"<=0) { @@ -165,8 +165,9 @@ namespace opt_utilities break; } } - + //restore the param_modifier dynamic_cast& >(fit.get_param_modifier())-=freeze_param(pname); + //restore the origin param values for(int i=0;i