22 : m_limits(limits), m_att_fixed(fixedAttr)
31 AttLimits AttLimits::lowerLimited(
double bound_value)
46 AttLimits AttLimits::upperLimited(
double bound_value)
51 AttLimits AttLimits::limited(
double left_bound_value,
double right_bound_value)
61 bool AttLimits::isFixed()
const
63 return m_att_fixed.isFixed();
66 bool AttLimits::isLimited()
const
71 bool AttLimits::isUpperLimited()
const
76 bool AttLimits::isLowerLimited()
const
81 bool AttLimits::isLimitless()
const
86 double AttLimits::lowerLimit()
const
91 double AttLimits::upperLimit()
const
96 void AttLimits::setFixed(
bool isFixed)
99 m_att_fixed.setFixed(isFixed);
102 bool AttLimits::operator==(
const AttLimits& other)
const
104 return m_limits == other.m_limits && m_att_fixed == other.m_att_fixed;
107 bool AttLimits::operator!=(
const AttLimits& other)
const
109 return !(*
this == other);
112 std::string AttLimits::toString()
const
114 std::ostringstream result;
118 else if (isLimitless())
120 else if (isLowerLimited())
121 result <<
"lowerLimited(" <<
std::scientific << std::setprecision(2) << lowerLimit() <<
")";
122 else if (isUpperLimited())
123 result <<
"upperLimited(" <<
std::scientific << std::setprecision(2) << upperLimit() <<
")";
124 else if (isLimited())
125 result <<
"limited(" <<
std::scientific << std::setprecision(2) << lowerLimit() <<
","
Defines and implements class AttLimits.
Attributes and limits of a fit parameter, and coupling between these properties.
Attributes for a fit parameter.
static Attributes fixed()
Creates a fixed value object.
Limits for a real fit parameter.
static RealLimits limitless()
Creates an object withoud bounds (default)
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)
double upperLimit() const
Returns upper limit.
double lowerLimit() const
Returns lower limit.
static RealLimits nonnegative()
Creates an object which can have only positive values with 0. included.
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
std::string scientific(const T value, int n=10)
Returns scientific string representing given value of any numeric type.