22 : m_has_lower_limit(false), m_has_upper_limit(false), m_lower_limit(0.), m_upper_limit(0.)
28 : m_has_lower_limit(has_lower_limit), m_has_upper_limit(has_upper_limit),
29 m_lower_limit(lower_limit), m_upper_limit(upper_limit)
105 return RealLimits(
true,
false, bound_value, 0.);
110 return lowerLimited(std::numeric_limits<double>::min());
120 return RealLimits(
false,
true, 0., bound_value);
125 return RealLimits(
true,
true, left_bound_value, right_bound_value);
135 std::ostringstream result;
138 result <<
"unlimited";
141 result <<
"positive";
144 result <<
"nonnegative";
147 result <<
"lowerLimited(" << std::fixed << std::setprecision(2) <<
lowerLimit() <<
")";
150 result <<
"upperLimited(" << std::fixed << std::setprecision(2) <<
upperLimit() <<
")";
153 result <<
"limited(" << std::fixed << std::setprecision(2) <<
lowerLimit() <<
","
154 << std::fixed << std::setprecision(2) <<
upperLimit() <<
")";
168 return !(*
this == other);
179 &&
lowerLimit() == std::numeric_limits<double>::min();
Defines class RealLimits.
Limits for a real fit parameter.
static RealLimits limitless()
Creates an object withoud bounds (default)
std::string toString() const
void removeLowerLimit()
remove lower limit
static RealLimits upperLimited(double bound_value)
Creates an object bounded from the right.
bool isLowerLimited() const
bool operator==(const RealLimits &other) const
bool hasUpperLimit() const
if has upper limit
static RealLimits lowerLimited(double bound_value)
Creates an object bounded from the left.
bool hasLowerAndUpperLimits() const
if has lower and upper limit
static RealLimits positive()
Creates an object which can have only positive values (>0., zero is not included)
bool isInRange(double value) const
returns true if proposed value is in limits range
double m_lower_limit
parameter has upper bound
bool m_has_upper_limit
parameter has lower bound
double upperLimit() const
Returns upper limit.
void setLowerLimit(double value)
Sets lower limit.
double lowerLimit() const
Returns lower limit.
void removeUpperLimit()
remove upper limit
bool isNonnegative() const
bool operator!=(const RealLimits &other) const
void setLimits(double xmin, double xmax)
Sets lower and upper limits.
static RealLimits nonnegative()
Creates an object which can have only positive values with 0. included.
double m_upper_limit
minimum allowed value
void removeLimits()
remove limits
bool isUpperLimited() const
static RealLimits limited(double left_bound_value, double right_bound_value)
Creates an object bounded from the left and right.
bool hasLowerLimit() const
if has lower limit
void setUpperLimit(double value)
Sets upper limit.