BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Log-normal distribution.
Definition at line 217 of file Distributions.h.
Public Member Functions | |
DistributionLogNormal (double median, double scale_param) | |
DistributionLogNormal (std::vector< double > P) | |
void | checkNodeArgs () const |
Raises exception if a parameter value is invalid. More... | |
std::string | className () const final |
Returns the class name, to be hard-coded in each leaf class that inherits from INode. More... | |
DistributionLogNormal * | clone () const override |
std::vector< double > | equidistantPoints (size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const override |
generate list of sample values More... | |
virtual std::vector< double > | equidistantPointsInRange (size_t nbr_samples, double xmin, double xmax) const |
Returns equidistant interpolation points from xmin to xmax. More... | |
std::vector< ParameterSample > | equidistantSamples (size_t nbr_samples, double sigma_factor=0., const RealLimits &limits=RealLimits()) const |
Returns equidistant samples, using intrinsic parameters, weighted with probabilityDensity(). More... | |
std::vector< ParameterSample > | equidistantSamplesInRange (size_t nbr_samples, double xmin, double xmax) const |
Returns equidistant samples from xmin to xmax, weighted with probabilityDensity(). More... | |
double | getMedian () const |
double | getScalePar () const |
bool | isDelta () const override |
Returns true if the distribution is in the limit case of a Dirac delta distribution. More... | |
double | mean () const override |
Returns the distribution-specific mean. More... | |
virtual std::vector< const INode * > | nodeChildren () const |
Returns all children. More... | |
std::vector< const INode * > | nodeOffspring () const |
Returns all descendants. More... | |
std::vector< ParaMeta > | parDefs () const final |
Returns the parameter definitions, to be hard-coded in each leaf class. More... | |
double | probabilityDensity (double x) const override |
Returns the distribution-specific probability density for value x. More... | |
std::string | pythonConstructor (const std::string &units) const override |
Prints distribution with constructor parameters in given units. ba.DistributionGaussian(2.0*deg, 0.02*deg) More... | |
virtual void | transferToCPP () |
Used for Python overriding of clone (see swig/tweaks.py) More... | |
Protected Member Functions | |
void | adjustMinMaxForLimits (double &xmin, double &xmax, const RealLimits &limits) const |
modifies xmin and xmax if they are outside of limits More... | |
std::vector< ParameterSample > | generateSamplesFromValues (const std::vector< double > &sample_values) const |
Returns weighted samples from given interpolation points and probabilityDensity(). More... | |
Protected Attributes | |
std::vector< double > | m_P |
Private Attributes | |
const double & | m_median |
const double & | m_scale_param |
Friends | |
class | DistributionsTest_DistributionLogNormalParameters_Test |
DistributionLogNormal::DistributionLogNormal | ( | std::vector< double > | P | ) |
Definition at line 277 of file Distributions.cpp.
References INode::checkNodeArgs(), m_median, and m_scale_param.
Referenced by clone().
DistributionLogNormal::DistributionLogNormal | ( | double | median, |
double | scale_param | ||
) |
Definition at line 289 of file Distributions.cpp.
|
protectedinherited |
modifies xmin and xmax if they are outside of limits
Definition at line 81 of file Distributions.cpp.
References RealLimits::hasLowerLimit(), RealLimits::hasUpperLimit(), RealLimits::lowerLimit(), and RealLimits::upperLimit().
Referenced by DistributionGate::equidistantPoints(), DistributionLorentz::equidistantPoints(), DistributionGaussian::equidistantPoints(), equidistantPoints(), DistributionCosine::equidistantPoints(), and DistributionTrapezoid::equidistantPoints().
|
inherited |
Raises exception if a parameter value is invalid.
Definition at line 27 of file INode.cpp.
References ASSERT, RealLimits::check(), INode::className(), INF, RealLimits::limited(), RealLimits::limitless(), INode::m_P, ParaMeta::name, RealLimits::nonnegative(), INode::parDefs(), ParaMeta::vMax, and ParaMeta::vMin.
Referenced by BarGauss::BarGauss(), BarLorentz::BarLorentz(), Bipyramid4::Bipyramid4(), Box::Box(), CantellatedCube::CantellatedCube(), Cone::Cone(), ConstantBackground::ConstantBackground(), CosineRippleBox::CosineRippleBox(), CosineRippleGauss::CosineRippleGauss(), CosineRippleLorentz::CosineRippleLorentz(), Cylinder::Cylinder(), DistributionCosine::DistributionCosine(), DistributionGate::DistributionGate(), DistributionGaussian::DistributionGaussian(), DistributionLogNormal(), DistributionLorentz::DistributionLorentz(), DistributionTrapezoid::DistributionTrapezoid(), Dodecahedron::Dodecahedron(), EllipsoidalCylinder::EllipsoidalCylinder(), FootprintGauss::FootprintGauss(), FootprintSquare::FootprintSquare(), FuzzySphere::FuzzySphere(), GaussSphere::GaussSphere(), HemiEllipsoid::HemiEllipsoid(), HollowSphere::HollowSphere(), HorizontalCylinder::HorizontalCylinder(), Icosahedron::Icosahedron(), LongBoxGauss::LongBoxGauss(), LongBoxLorentz::LongBoxLorentz(), PlatonicOctahedron::PlatonicOctahedron(), PlatonicTetrahedron::PlatonicTetrahedron(), Prism3::Prism3(), Prism6::Prism6(), Profile1DCauchy::Profile1DCauchy(), Profile1DCosine::Profile1DCosine(), Profile1DGate::Profile1DGate(), Profile1DGauss::Profile1DGauss(), Profile1DTriangle::Profile1DTriangle(), Profile1DVoigt::Profile1DVoigt(), Profile2DCauchy::Profile2DCauchy(), Profile2DCone::Profile2DCone(), Profile2DGate::Profile2DGate(), Profile2DGauss::Profile2DGauss(), Profile2DVoigt::Profile2DVoigt(), Pyramid2::Pyramid2(), Pyramid3::Pyramid3(), Pyramid4::Pyramid4(), Pyramid6::Pyramid6(), RotationEuler::RotationEuler(), RotationX::RotationX(), RotationY::RotationY(), RotationZ::RotationZ(), SawtoothRippleBox::SawtoothRippleBox(), SawtoothRippleGauss::SawtoothRippleGauss(), SawtoothRippleLorentz::SawtoothRippleLorentz(), Sphere::Sphere(), Spheroid::Spheroid(), TruncatedCube::TruncatedCube(), TruncatedSphere::TruncatedSphere(), and TruncatedSpheroid::TruncatedSpheroid().
|
inlinefinalvirtual |
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Implements INode.
Definition at line 226 of file Distributions.h.
Referenced by pythonConstructor().
|
inlineoverridevirtual |
Implements IDistribution1D.
Definition at line 222 of file Distributions.h.
References DistributionLogNormal(), m_median, and m_scale_param.
|
overridevirtual |
generate list of sample values
Implements IDistribution1D.
Definition at line 308 of file Distributions.cpp.
References IDistribution1D::adjustMinMaxForLimits(), IDistribution1D::equidistantPointsInRange(), m_median, and m_scale_param.
|
virtualinherited |
Returns equidistant interpolation points from xmin to xmax.
Definition at line 70 of file Distributions.cpp.
References IDistribution1D::mean().
Referenced by DistributionGate::equidistantPoints(), DistributionLorentz::equidistantPoints(), DistributionGaussian::equidistantPoints(), equidistantPoints(), DistributionCosine::equidistantPoints(), DistributionTrapezoid::equidistantPoints(), and IDistribution1D::equidistantSamplesInRange().
|
inherited |
Returns equidistant samples, using intrinsic parameters, weighted with probabilityDensity().
Definition at line 43 of file Distributions.cpp.
References IDistribution1D::equidistantPoints(), IDistribution1D::generateSamplesFromValues(), IDistribution1D::isDelta(), and IDistribution1D::mean().
|
inherited |
Returns equidistant samples from xmin to xmax, weighted with probabilityDensity().
Definition at line 58 of file Distributions.cpp.
References IDistribution1D::equidistantPointsInRange(), IDistribution1D::generateSamplesFromValues(), IDistribution1D::isDelta(), and IDistribution1D::mean().
|
protectedinherited |
Returns weighted samples from given interpolation points and probabilityDensity().
Definition at line 99 of file Distributions.cpp.
References IDistribution1D::probabilityDensity().
Referenced by IDistribution1D::equidistantSamples(), and IDistribution1D::equidistantSamplesInRange().
|
inline |
|
inline |
|
overridevirtual |
Returns true if the distribution is in the limit case of a Dirac delta distribution.
Implements IDistribution1D.
Definition at line 325 of file Distributions.cpp.
References m_scale_param.
|
overridevirtual |
Returns the distribution-specific mean.
Implements IDistribution1D.
Definition at line 302 of file Distributions.cpp.
References m_median, and m_scale_param.
|
virtualinherited |
Returns all children.
Reimplemented in ISimulation2D, ISimulation, ParticleCoreShell, ParticleComposition, Particle, MesoCrystal, IParticle, Crystal, MultiLayer, Layer, LayerInterface, ParticleLayout, InterferenceRadialParaCrystal, InterferenceFinite3DLattice, InterferenceFinite2DLattice, Interference3DLattice, Interference2DSuperLattice, Interference2DParaCrystal, Interference2DLattice, Interference1DLattice, ConvolutionDetectorResolution, IDetector, and Beam.
Definition at line 56 of file INode.cpp.
Referenced by NodeUtils::AllDescendantsOfType(), NodeUtils::ChildNodesOfType(), ISampleNode::containedMaterials(), and INode::nodeOffspring().
|
inherited |
Returns all descendants.
Definition at line 61 of file INode.cpp.
References INode::nodeChildren().
|
inlinefinalvirtual |
|
overridevirtual |
Returns the distribution-specific probability density for value x.
Implements IDistribution1D.
Definition at line 294 of file Distributions.cpp.
References m_median, m_scale_param, and M_TWOPI.
|
overridevirtual |
Prints distribution with constructor parameters in given units. ba.DistributionGaussian(2.0*deg, 0.02*deg)
Implements IDistribution1D.
Definition at line 330 of file Distributions.cpp.
References className(), m_median, m_scale_param, and Py::Fmt::printFunction().
|
inlinevirtualinherited |
Used for Python overriding of clone (see swig/tweaks.py)
Definition at line 32 of file ICloneable.h.
|
friend |
Definition at line 253 of file Distributions.h.
|
private |
Definition at line 250 of file Distributions.h.
Referenced by DistributionLogNormal(), clone(), equidistantPoints(), getMedian(), mean(), probabilityDensity(), and pythonConstructor().
|
protectedinherited |
Definition at line 63 of file INode.h.
Referenced by IFootprintFactor::IFootprintFactor(), INode::checkNodeArgs(), IProfile1D::pythonConstructor(), IProfile2D::pythonConstructor(), IFormFactor::pythonConstructor(), Profile1DVoigt::pythonConstructor(), and Profile2DVoigt::pythonConstructor().
|
private |
Definition at line 251 of file Distributions.h.
Referenced by DistributionLogNormal(), clone(), equidistantPoints(), getScalePar(), isDelta(), mean(), probabilityDensity(), and pythonConstructor().