BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Limits for a real fit parameter. More...
Public Member Functions | |
RealLimits () | |
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... | |
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 withoud 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... | |
Limits for a real fit parameter.
Definition at line 24 of file RealLimits.h.
RealLimits::RealLimits | ( | ) |
Definition at line 21 of file RealLimits.cpp.
Referenced by limited(), limitless(), lowerLimited(), and upperLimited().
|
protected |
Definition at line 26 of file RealLimits.cpp.
bool RealLimits::hasLowerAndUpperLimits | ( | ) | const |
if has lower and upper limit
Definition at line 79 of file RealLimits.cpp.
References m_has_lower_limit, and m_has_upper_limit.
Referenced by IRangedDistribution::checkInitialization(), and AttLimits::isLimited().
bool RealLimits::hasLowerLimit | ( | ) | const |
if has lower limit
Definition at line 35 of file RealLimits.cpp.
References m_has_lower_limit.
Referenced by IDistribution1D::adjustMinMaxForLimits(), ParameterTuningDelegate::createEditor(), FitParameterItem::initMinMaxValues(), isInRange(), isLimited(), AttLimits::isLimitless(), isLimitless(), AttLimits::isLowerLimited(), isLowerLimited(), isNonnegative(), isPositive(), AttLimits::isUpperLimited(), isUpperLimited(), DistributionWidget::plotLimits(), ScientificDoublePropertyEditor::setLimits(), DoubleEditor::setLimits(), ScientificSpinBoxEditor::setLimits(), and IntEditor::setLimits().
bool RealLimits::hasUpperLimit | ( | ) | const |
if has upper limit
Definition at line 57 of file RealLimits.cpp.
References m_has_upper_limit.
Referenced by IDistribution1D::adjustMinMaxForLimits(), ParameterTuningDelegate::createEditor(), FitParameterItem::initMinMaxValues(), isInRange(), isLimited(), AttLimits::isLimitless(), isLimitless(), AttLimits::isLowerLimited(), isLowerLimited(), isNonnegative(), isPositive(), AttLimits::isUpperLimited(), isUpperLimited(), DistributionWidget::plotLimits(), ScientificDoublePropertyEditor::setLimits(), DoubleEditor::setLimits(), ScientificSpinBoxEditor::setLimits(), and IntEditor::setLimits().
bool RealLimits::isInRange | ( | double | value | ) | const |
returns true if proposed value is in limits range
Definition at line 96 of file RealLimits.cpp.
References hasLowerLimit(), hasUpperLimit(), m_lower_limit, and m_upper_limit.
Referenced by RealParameter::RealParameter(), SpecularBeamWavelengthItem::setToRange(), and RealParameter::setValue().
bool RealLimits::isLimited | ( | ) | const |
Definition at line 199 of file RealLimits.cpp.
References hasLowerLimit(), and hasUpperLimit().
Referenced by DistributionItem::init_limits_group(), pyfmt::printRealLimits(), SpecularBeamWavelengthItem::setToRange(), and toString().
bool RealLimits::isLimitless | ( | ) | const |
Definition at line 173 of file RealLimits.cpp.
References hasLowerLimit(), and hasUpperLimit().
Referenced by DistributionItem::init_limits_group(), pyfmt2::printRangedDistribution(), pyfmt::printRealLimits(), pyfmt::printRealLimitsArg(), and toString().
bool RealLimits::isLowerLimited | ( | ) | const |
Definition at line 189 of file RealLimits.cpp.
References hasLowerLimit(), and hasUpperLimit().
Referenced by DistributionItem::init_limits_group(), pyfmt::printRealLimits(), and toString().
bool RealLimits::isNonnegative | ( | ) | const |
Definition at line 184 of file RealLimits.cpp.
References hasLowerLimit(), hasUpperLimit(), and lowerLimit().
Referenced by DistributionItem::init_limits_group(), pyfmt::printRealLimits(), and toString().
bool RealLimits::isPositive | ( | ) | const |
Definition at line 178 of file RealLimits.cpp.
References hasLowerLimit(), hasUpperLimit(), and lowerLimit().
Referenced by DistributionItem::init_limits_group(), pyfmt::printRealLimits(), and toString().
bool RealLimits::isUpperLimited | ( | ) | const |
Definition at line 194 of file RealLimits.cpp.
References hasLowerLimit(), and hasUpperLimit().
Referenced by DistributionItem::init_limits_group(), pyfmt::printRealLimits(), and toString().
|
static |
Creates an object bounded from the left and right.
Definition at line 125 of file RealLimits.cpp.
References RealLimits().
Referenced by BeamAzimuthalAngleItem::BeamAzimuthalAngleItem(), BeamInclinationAngleItem::BeamInclinationAngleItem(), BeamItem::BeamItem(), FTDecayFunction1DVoigtItem::FTDecayFunction1DVoigtItem(), FTDecayFunction2DVoigtItem::FTDecayFunction2DVoigtItem(), FTDistribution1DVoigtItem::FTDistribution1DVoigtItem(), FTDistribution2DVoigtItem::FTDistribution2DVoigtItem(), LayerBasicRoughnessItem::LayerBasicRoughnessItem(), MesoCrystalItem::MesoCrystalItem(), ParticleCompositionItem::ParticleCompositionItem(), ParticleCoreShellItem::ParticleCoreShellItem(), ParticleDistributionItem::ParticleDistributionItem(), ParticleItem::ParticleItem(), SpheresWithLimitsDistributionBuilder::buildSample(), ConesWithLimitsDistributionBuilder::buildSample(), LinkedBoxDistributionBuilder::buildSample(), LimitedItem::createRealLimits(), DepthProbeSimulation::initialize(), SpecularSimulation::initialize(), AttLimits::limited(), BasicAxisItem::register_basic_properties(), and RealParameter::setLimited().
|
static |
Creates an object withoud bounds (default)
Definition at line 130 of file RealLimits.cpp.
References RealLimits().
Referenced by DetectorItem::DetectorItem(), DistributionCosineItem::DistributionCosineItem(), DistributionGateItem::DistributionGateItem(), DistributionGaussianItem::DistributionGaussianItem(), DistributionLorentzItem::DistributionLorentzItem(), DistributionNoneItem::DistributionNoneItem(), DistributionTrapezoidItem::DistributionTrapezoidItem(), EllipseItem::EllipseItem(), FitParameterItem::FitParameterItem(), HorizontalLineItem::HorizontalLineItem(), LimitedItem::LimitedItem(), LowerLimitedItem::LowerLimitedItem(), MaterialRefractiveDataItem::MaterialRefractiveDataItem(), MaterialSLDDataItem::MaterialSLDDataItem(), PolygonPointItem::PolygonPointItem(), RectangleItem::RectangleItem(), RectangularDetectorItem::RectangularDetectorItem(), UpperLimitedItem::UpperLimitedItem(), VectorItem::VectorItem(), VerticalLineItem::VerticalLineItem(), ParticleDistributionItem::createParticleDistribution(), AttLimits::fixed(), and BasicAxisItem::register_basic_properties().
double RealLimits::lowerLimit | ( | ) | const |
Returns lower limit.
Definition at line 40 of file RealLimits.cpp.
References m_lower_limit.
Referenced by IDistribution1D::adjustMinMaxForLimits(), IRangedDistribution::checkInitialization(), ParameterTuningDelegate::createEditor(), DistributionItem::init_limits_group(), FitParameterItem::initMinMaxValues(), isNonnegative(), isPositive(), AttLimits::lowerLimit(), DistributionWidget::plotLimits(), pyfmt::printRealLimits(), ScientificDoublePropertyEditor::setLimits(), DoubleEditor::setLimits(), ScientificSpinBoxEditor::setLimits(), IntEditor::setLimits(), SpecularBeamWavelengthItem::setToRange(), and toString().
|
static |
Creates an object bounded from the left.
Definition at line 105 of file RealLimits.cpp.
References RealLimits().
Referenced by CuboctahedronItem::CuboctahedronItem(), LayerItem::LayerItem(), ResolutionFunction2DGaussianItem::ResolutionFunction2DGaussianItem(), LowerLimitedItem::createRealLimits(), DistributionLorentzItem::init_distribution(), DistributionGaussianItem::init_distribution(), DistributionLogNormalItem::init_distribution(), DistributionCosineItem::init_distribution(), AttLimits::lowerLimited(), nonnegative(), positive(), and DistributionItem::register_number_of_samples().
|
static |
Creates an object which can have only positive values with 0. included.
Definition at line 115 of file RealLimits.cpp.
References lowerLimited().
Referenced by ConstantBackgroundItem::ConstantBackgroundItem(), FootprintGaussianItem::FootprintGaussianItem(), FootprintSquareItem::FootprintSquareItem(), SessionItem::SessionItem(), NonnegativeItem::createRealLimits(), AttLimits::nonnegative(), and RealParameter::setNonnegative().
bool RealLimits::operator!= | ( | const RealLimits & | other | ) | const |
Definition at line 168 of file RealLimits.cpp.
bool RealLimits::operator== | ( | const RealLimits & | other | ) | const |
Definition at line 161 of file RealLimits.cpp.
References m_has_lower_limit, m_has_upper_limit, m_lower_limit, and m_upper_limit.
|
static |
Creates an object which can have only positive values (>0., zero is not included)
Definition at line 110 of file RealLimits.cpp.
References lowerLimited().
Referenced by BeamWavelengthItem::BeamWavelengthItem(), PositiveItem::createRealLimits(), AttLimits::positive(), RealParameter::setPositive(), and SpecularBeamItem::updateWavelength().
void RealLimits::removeLimits | ( | ) |
remove limits
Definition at line 90 of file RealLimits.cpp.
References removeLowerLimit(), and removeUpperLimit().
Referenced by AttLimits::setFixed().
void RealLimits::removeLowerLimit | ( | ) |
remove lower limit
Definition at line 51 of file RealLimits.cpp.
References m_has_lower_limit, and m_lower_limit.
Referenced by removeLimits().
void RealLimits::removeUpperLimit | ( | ) |
remove upper limit
Definition at line 73 of file RealLimits.cpp.
References m_has_upper_limit, and m_upper_limit.
Referenced by removeLimits().
void RealLimits::setLimits | ( | double | xmin, |
double | xmax | ||
) |
Sets lower and upper limits.
Definition at line 84 of file RealLimits.cpp.
References setLowerLimit(), and setUpperLimit().
Referenced by PropertyEditorFactory::CreateEditor().
void RealLimits::setLowerLimit | ( | double | value | ) |
Sets lower limit.
Definition at line 45 of file RealLimits.cpp.
References m_has_lower_limit, and m_lower_limit.
Referenced by setLimits().
void RealLimits::setUpperLimit | ( | double | value | ) |
Sets upper limit.
Definition at line 67 of file RealLimits.cpp.
References m_has_upper_limit, and m_upper_limit.
Referenced by setLimits().
std::string RealLimits::toString | ( | ) | const |
Definition at line 135 of file RealLimits.cpp.
References isLimited(), isLimitless(), isLowerLimited(), isNonnegative(), isPositive(), isUpperLimited(), lowerLimit(), and upperLimit().
double RealLimits::upperLimit | ( | ) | const |
Returns upper limit.
Definition at line 62 of file RealLimits.cpp.
References m_upper_limit.
Referenced by IDistribution1D::adjustMinMaxForLimits(), IRangedDistribution::checkInitialization(), ParameterTuningDelegate::createEditor(), DistributionItem::init_limits_group(), FitParameterItem::initMinMaxValues(), DistributionWidget::plotLimits(), pyfmt::printRealLimits(), ScientificDoublePropertyEditor::setLimits(), DoubleEditor::setLimits(), ScientificSpinBoxEditor::setLimits(), IntEditor::setLimits(), SpecularBeamWavelengthItem::setToRange(), toString(), and AttLimits::upperLimit().
|
static |
Creates an object bounded from the right.
Definition at line 120 of file RealLimits.cpp.
References RealLimits().
Referenced by UpperLimitedItem::createRealLimits(), and AttLimits::upperLimited().
|
friend |
|
protected |
Definition at line 104 of file RealLimits.h.
Referenced by hasLowerAndUpperLimits(), hasLowerLimit(), operator==(), removeLowerLimit(), and setLowerLimit().
|
protected |
parameter has lower bound
Definition at line 105 of file RealLimits.h.
Referenced by hasLowerAndUpperLimits(), hasUpperLimit(), operator==(), removeUpperLimit(), and setUpperLimit().
|
protected |
parameter has upper bound
Definition at line 106 of file RealLimits.h.
Referenced by isInRange(), lowerLimit(), operator==(), removeLowerLimit(), and setLowerLimit().
|
protected |
minimum allowed value
Definition at line 107 of file RealLimits.h.
Referenced by isInRange(), operator==(), removeUpperLimit(), setUpperLimit(), and upperLimit().