BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Limits for a real fit parameter.
Public Member Functions | |
RealLimits () | |
Default constructor creates a "limitless" instance. More... | |
void | check (const std::string &name, double value) const |
Throws if value is outside limits. Parameter 'name' is for exception message. More... | |
bool | hasLowerAndUpperLimits () const |
if has lower and upper limit More... | |
bool | hasLowerLimit () const |
if has lower limit More... | |
bool | hasUpperLimit () const |
if has upper limit More... | |
bool | isInRange (double value) const |
Returns true if proposed value is in limits range. More... | |
bool | isLimited () const |
bool | isLimitless () const |
bool | isLowerLimited () const |
bool | isNonnegative () const |
bool | isPositive () const |
bool | isUpperLimited () const |
double | lowerLimit () const |
Returns lower limit. More... | |
bool | operator!= (const RealLimits &other) const |
bool | operator== (const RealLimits &other) const |
void | removeLimits () |
remove limits More... | |
void | removeLowerLimit () |
remove lower limit More... | |
void | removeUpperLimit () |
remove upper limit More... | |
RealLimits | scaledLimits (double factor) const |
Creates a copy with scaled boundaries, if applicable. More... | |
void | setLimits (double xmin, double xmax) |
Sets lower and upper limits. More... | |
void | setLowerLimit (double value) |
Sets lower limit. More... | |
void | setUpperLimit (double value) |
Sets upper limit. More... | |
std::string | toString () const |
double | upperLimit () const |
Returns upper limit. More... | |
Static Public Member Functions | |
static RealLimits | limited (double left_bound_value, double right_bound_value) |
Creates an object bounded from the left and right. More... | |
static RealLimits | limitless () |
Creates an object without bounds (default) More... | |
static RealLimits | lowerLimited (double bound_value) |
Creates an object bounded from the left. More... | |
static RealLimits | nonnegative () |
Creates an object which can have only positive values with 0. included. More... | |
static RealLimits | positive () |
Creates an object which can have only positive values (>0., zero is not included) More... | |
static RealLimits | upperLimited (double bound_value) |
Creates an object bounded from the right. More... | |
Protected Member Functions | |
RealLimits (bool has_lower_limit, bool has_upper_limit, double lower_limit, double upper_limit) | |
Protected Attributes | |
bool | m_has_lower_limit |
bool | m_has_upper_limit |
parameter has lower bound More... | |
double | m_lower_limit |
parameter has upper bound More... | |
double | m_upper_limit |
minimum allowed value More... | |
Friends | |
std::ostream & | operator<< (std::ostream &ostr, const RealLimits &m) |
Prints class. More... | |
RealLimits::RealLimits | ( | ) |
Default constructor creates a "limitless" instance.
|
protected |
void RealLimits::check | ( | const std::string & | name, |
double | value | ||
) | const |
Throws if value is outside limits. Parameter 'name' is for exception message.
bool RealLimits::hasLowerAndUpperLimits | ( | ) | const |
if has lower and upper limit
bool RealLimits::hasLowerLimit | ( | ) | const |
if has lower limit
bool RealLimits::hasUpperLimit | ( | ) | const |
if has upper limit
bool RealLimits::isInRange | ( | double | value | ) | const |
Returns true if proposed value is in limits range.
bool RealLimits::isLimited | ( | ) | const |
bool RealLimits::isLimitless | ( | ) | const |
bool RealLimits::isLowerLimited | ( | ) | const |
bool RealLimits::isNonnegative | ( | ) | const |
bool RealLimits::isPositive | ( | ) | const |
bool RealLimits::isUpperLimited | ( | ) | const |
|
static |
Creates an object bounded from the left and right.
|
static |
Creates an object without bounds (default)
double RealLimits::lowerLimit | ( | ) | const |
Returns lower limit.
|
static |
Creates an object bounded from the left.
|
static |
Creates an object which can have only positive values with 0. included.
bool RealLimits::operator!= | ( | const RealLimits & | other | ) | const |
bool RealLimits::operator== | ( | const RealLimits & | other | ) | const |
|
static |
Creates an object which can have only positive values (>0., zero is not included)
void RealLimits::removeLimits | ( | ) |
remove limits
void RealLimits::removeLowerLimit | ( | ) |
remove lower limit
void RealLimits::removeUpperLimit | ( | ) |
remove upper limit
RealLimits RealLimits::scaledLimits | ( | double | factor | ) | const |
Creates a copy with scaled boundaries, if applicable.
void RealLimits::setLimits | ( | double | xmin, |
double | xmax | ||
) |
Sets lower and upper limits.
void RealLimits::setLowerLimit | ( | double | value | ) |
Sets lower limit.
void RealLimits::setUpperLimit | ( | double | value | ) |
Sets upper limit.
std::string RealLimits::toString | ( | ) | const |
double RealLimits::upperLimit | ( | ) | const |
Returns upper limit.
|
static |
Creates an object bounded from the right.
|
friend |
Prints class.
|
protected |
|
protected |
parameter has lower bound
|
protected |
parameter has upper bound
|
protected |
minimum allowed value