aboutsummaryrefslogtreecommitdiffstats
path: root/core/fitter.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fitter.hpp')
-rw-r--r--core/fitter.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/fitter.hpp b/core/fitter.hpp
index cc4da3b..7b5af4b 100644
--- a/core/fitter.hpp
+++ b/core/fitter.hpp
@@ -559,6 +559,19 @@ namespace opt_utilities
return Tstr();
}
+ virtual bool do_meet_constraint(const Tp& p)const
+ {
+ Tp p1=this->reform_param(p);
+ for(size_t i=0;i!=p1.size();++i)
+ {
+ if(get_element(p,i)>get_param_info(i).get_upper_limit()||
+ get_element(p,i)<get_param_info(i).get_lower_limit())
+ {
+ return false;
+ }
+ }
+ return true;
+ }
/**
\return the type name of self
@@ -825,6 +838,15 @@ namespace opt_utilities
return do_get_information();
}
+ /**
+ \param p input deformed parameter
+ \return if the given param meets the constraint of the model
+ */
+ bool meet_constraint(const Tp& p)const
+ {
+ return do_meet_constraint(p);
+ }
+
public:
/**
set the param modifier