15 #ifndef BORNAGAIN_FIT_TOOLS_REALLIMITS_H
16 #define BORNAGAIN_FIT_TOOLS_REALLIMITS_H
83 std::string toString()
const;
92 bool operator==(
const RealLimits& other)
const;
93 bool operator!=(
const RealLimits& other)
const;
95 bool isLimitless()
const;
96 bool isPositive()
const;
97 bool isNonnegative()
const;
98 bool isLowerLimited()
const;
99 bool isUpperLimited()
const;
100 bool isLimited()
const;
103 RealLimits(
bool has_lower_limit,
bool has_upper_limit,
double lower_limit,
double upper_limit);
105 bool m_has_lower_limit;
Limits for a real fit parameter.
static RealLimits limitless()
Creates an object withoud bounds (default)
void removeLowerLimit()
remove lower limit
static RealLimits upperLimited(double bound_value)
Creates an object bounded from the right.
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)
friend std::ostream & operator<<(std::ostream &ostr, const RealLimits &m)
Prints class.
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
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
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.