BornAgain
1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Log-normal distribution. More...
Public Member Functions | |
DistributionLogNormal ()=delete | |
DistributionLogNormal (const std::vector< double > P) | |
DistributionLogNormal (double median, double scale_param) | |
void | accept (INodeVisitor *visitor) const final |
Calls the INodeVisitor's visit method. More... | |
DistributionLogNormal * | clone () const final |
int | copyNumber (const INode *node) const |
Returns copyNumber of child, which takes into account existence of children with same name. More... | |
ParameterPool * | createParameterTree () const |
Creates new parameter pool, with all local parameters and those of its children. More... | |
std::string | displayName () const |
Returns display name, composed from the name of node and it's copy number. More... | |
virtual std::vector< double > | equidistantPoints (size_t nbr_samples, double sigma_factor, const RealLimits &limits=RealLimits()) const |
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... | |
virtual std::vector< const INode * > | getChildren () const |
Returns a vector of children. More... | |
double | getMean () const final |
Returns the distribution-specific mean. More... | |
double | getMedian () const |
const std::string & | getName () const |
double | getScalePar () const |
bool | isDelta () const final |
Returns true if the distribution is in the limit case of a Dirac delta distribution. More... | |
virtual void | onChange () |
Action to be taken in inherited class when a parameter has changed. More... | |
RealParameter * | parameter (const std::string &name) const |
Returns parameter with given 'name'. More... | |
ParameterPool * | parameterPool () const |
Returns pointer to the parameter pool. More... | |
std::string | parametersToString () const |
Returns multiline string representing available parameters. More... | |
INode * | parent () |
const INode * | parent () const |
double | probabilityDensity (double x) const final |
Returns the distribution-specific probability density for value x. More... | |
std::vector< const INode * > | progeny () const |
Returns a vector of all descendants. More... | |
void | registerChild (INode *node) |
RealParameter & | registerParameter (const std::string &name, double *parpointer) |
void | registerVector (const std::string &base_name, kvector_t *p_vec, const std::string &units="nm") |
void | removeParameter (const std::string &name) |
void | removeVector (const std::string &base_name) |
void | setName (const std::string &name) |
void | setParameterValue (const std::string &name, double value) |
virtual void | setParent (const INode *newParent) |
virtual void | setUnits (const std::string &units) |
Sets distribution units. More... | |
void | setVectorValue (const std::string &base_name, kvector_t value) |
virtual void | transferToCPP () |
Used for Python overriding of clone (see swig/tweaks.py) More... | |
virtual std::string | treeToString () const |
Returns multiline string representing tree structure below the node. More... | |
Static Public Member Functions | |
static std::string | XComponentName (const std::string &base_name) |
static std::string | YComponentName (const std::string &base_name) |
static std::string | ZComponentName (const std::string &base_name) |
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 | |
const size_t | m_NP |
std::vector< double > | m_P |
Private Attributes | |
const double & | m_median |
std::string | m_name |
const INode * | m_parent {nullptr} |
std::unique_ptr< ParameterPool > | m_pool |
parameter pool (kind of pointer-to-implementation) More... | |
const double & | m_scale_param |
Log-normal distribution.
Definition at line 188 of file Distributions.h.
DistributionLogNormal::DistributionLogNormal | ( | const std::vector< double > | P | ) |
Definition at line 265 of file Distributions.cpp.
References INF.
DistributionLogNormal::DistributionLogNormal | ( | double | median, |
double | scale_param | ||
) |
Definition at line 280 of file Distributions.cpp.
|
delete |
Referenced by clone().
|
inlinefinalvirtual |
Calls the INodeVisitor's visit method.
Implements INode.
Definition at line 210 of file Distributions.h.
|
protectedinherited |
modifies xmin and xmax if they are outside of limits
Definition at line 84 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().
|
inlinefinalvirtual |
Implements IDistribution1D.
Definition at line 194 of file Distributions.h.
References DistributionLogNormal(), m_median, and m_scale_param.
|
inherited |
Returns copyNumber of child, which takes into account existence of children with same name.
Definition at line 94 of file INode.cpp.
References INode::getChildren(), IParametricComponent::getName(), and INode::parent().
Referenced by INode::displayName().
|
virtualinherited |
Creates new parameter pool, with all local parameters and those of its children.
Reimplemented from IParametricComponent.
Definition at line 126 of file INode.cpp.
References NodeUtils::nodePath(), INode::parent(), and INode::progeny().
Referenced by ISimulation::runSimulation(), DepthProbeSimulation::validateParametrization(), OffSpecularSimulation::validateParametrization(), and SpecularSimulation::validateParametrization().
|
inherited |
Returns display name, composed from the name of node and it's copy number.
Definition at line 115 of file INode.cpp.
References INode::copyNumber(), IParametricComponent::getName(), and INode::m_parent.
Referenced by NodeUtils::nodePath().
|
virtual |
generate list of sample values
Implements IDistribution1D.
Definition at line 301 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 67 of file Distributions.cpp.
References IDistribution1D::getMean().
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 40 of file Distributions.cpp.
References IDistribution1D::equidistantPoints(), IDistribution1D::generateSamplesFromValues(), IDistribution1D::getMean(), and IDistribution1D::isDelta().
|
inherited |
Returns equidistant samples from xmin to xmax, weighted with probabilityDensity().
Definition at line 55 of file Distributions.cpp.
References IDistribution1D::equidistantPointsInRange(), IDistribution1D::generateSamplesFromValues(), IDistribution1D::getMean(), and IDistribution1D::isDelta().
|
protectedinherited |
Returns weighted samples from given interpolation points and probabilityDensity().
Definition at line 102 of file Distributions.cpp.
References IDistribution1D::probabilityDensity().
Referenced by IDistribution1D::equidistantSamples(), and IDistribution1D::equidistantSamplesInRange().
|
virtualinherited |
Returns a vector of children.
Reimplemented in SampleProvider, IParticle, ParticleLayout, InterferenceFunctionFinite3DLattice, InterferenceFunctionFinite2DLattice, InterferenceFunction3DLattice, InterferenceFunction2DSuperLattice, InterferenceFunction2DParaCrystal, InterferenceFunction2DLattice, InterferenceFunction1DLattice, IDetector, Beam, ParticleDistribution, ParticleCoreShell, ParticleComposition, Particle, MesoCrystal, Crystal, MultiLayer, Layer, InterferenceFunctionRadialParaCrystal, LayerInterface, ConvolutionDetectorResolution, Instrument, and ISimulation.
Definition at line 63 of file INode.cpp.
Referenced by node_progeny::AllDescendantsOfType(), node_progeny::ChildNodesOfType(), ISampleNode::containedMaterials(), INode::copyNumber(), INode::progeny(), and NodeUtils::progenyPlus().
|
finalvirtual |
Returns the distribution-specific mean.
Implements IDistribution1D.
Definition at line 295 of file Distributions.cpp.
References m_median, and m_scale_param.
|
inline |
|
inlineinherited |
Definition at line 70 of file IParametricComponent.h.
References IParametricComponent::m_name.
Referenced by Beam::Beam(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), IDetector::IDetector(), Instrument::Instrument(), IParametricComponent::IParametricComponent(), SampleBuilderNode::SampleBuilderNode(), Layer::clone(), INode::copyNumber(), IParametricComponent::createParameterTree(), IFormFactor::createSlicedFormFactor(), SampleToPython::defineInterferenceFunctions(), INode::displayName(), Beam::operator=(), SampleBuilderNode::operator=(), GUIObjectBuilder::populateInstrumentModel(), PyImportAssistant::populateModels(), GUIDomainSampleVisitor::populateSampleModel(), IParametricComponent::registerParameter(), IFormFactor::sliceFormFactor(), and GUIDomainSampleVisitor::visit().
|
inline |
|
finalvirtual |
Returns true if the distribution is in the limit case of a Dirac delta distribution.
Implements IDistribution1D.
Definition at line 318 of file Distributions.cpp.
References m_scale_param.
|
inlinevirtualinherited |
Action to be taken in inherited class when a parameter has changed.
Reimplemented in IProfileRipple, Lattice3D, InterferenceFunction3DLattice, InterferenceFunction2DLattice, FormFactorSphereLogNormalRadius, FormFactorSphereGaussianRadius, FormFactorGaussSphere, ISawtoothRipple, ICosineRipple, IProfileRectangularRipple, FormFactorTruncatedSpheroid, FormFactorTruncatedSphere, FormFactorTruncatedCube, FormFactorTetrahedron, FormFactorPyramid, FormFactorPrism6, FormFactorPrism3, FormFactorLongBoxLorentz, FormFactorLongBoxGauss, FormFactorIcosahedron, FormFactorHollowSphere, FormFactorHemiEllipsoid, FormFactorFullSpheroid, FormFactorFullSphere, FormFactorEllipsoidalCylinder, FormFactorDodecahedron, FormFactorCylinder, FormFactorCuboctahedron, FormFactorCone6, FormFactorCone, FormFactorCantellatedCube, FormFactorBox, FormFactorAnisoPyramid, and Lattice2D.
Definition at line 59 of file IParametricComponent.h.
Referenced by Lattice2D::onChange(), and IParametricComponent::registerParameter().
|
inherited |
Returns parameter with given 'name'.
Definition at line 86 of file IParametricComponent.cpp.
References IParametricComponent::m_pool, and RealSpace::Particles::name().
Referenced by DepthProbeSimulation::initialize(), SpecularSimulation::initialize(), Lattice3D::initialize(), IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), IParticle::registerPosition(), Layer::registerThickness(), Lattice2D::setRotationEnabled(), and setUnits().
|
inlineinherited |
Returns pointer to the parameter pool.
Definition at line 39 of file IParametricComponent.h.
References IParametricComponent::m_pool.
Referenced by INode::INode(), IParametricComponent::IParametricComponent(), pyfmt2::argumentList(), SampleBuilderNode::borrow_builder_parameters(), SampleBuilderNode::reset(), and IDistribution1D::setUnits().
|
inherited |
Returns multiline string representing available parameters.
Definition at line 43 of file IParametricComponent.cpp.
References IParametricComponent::createParameterTree().
|
inherited |
Definition at line 89 of file INode.cpp.
References INode::m_parent.
|
inherited |
Definition at line 84 of file INode.cpp.
References INode::m_parent.
Referenced by INode::copyNumber(), INode::createParameterTree(), ParticleDistribution::generateParticles(), NodeUtils::nodePath(), Lattice2D::onChange(), SampleProvider::setBuilder(), SampleProvider::setParent(), and SampleProvider::setSample().
|
finalvirtual |
Returns the distribution-specific probability density for value x.
Implements IDistribution1D.
Definition at line 287 of file Distributions.cpp.
References m_median, m_scale_param, and M_TWOPI.
|
inherited |
Returns a vector of all descendants.
Definition at line 68 of file INode.cpp.
References INode::getChildren().
Referenced by INode::createParameterTree(), and ParticleDistribution::generateParticles().
|
inherited |
Definition at line 57 of file INode.cpp.
References ASSERT, and INode::setParent().
Referenced by Beam::Beam(), Crystal::Crystal(), IDetector::IDetector(), Instrument::Instrument(), InterferenceFunction2DLattice::InterferenceFunction2DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunction2DSuperLattice::InterferenceFunction2DSuperLattice(), InterferenceFunctionFinite2DLattice::InterferenceFunctionFinite2DLattice(), Particle::Particle(), ParticleDistribution::ParticleDistribution(), ParticleLayout::addAndRegisterAbstractParticle(), ParticleCoreShell::addAndRegisterCore(), MultiLayer::addAndRegisterInterface(), MultiLayer::addAndRegisterLayer(), ParticleCoreShell::addAndRegisterShell(), Layer::addLayout(), ParticleComposition::addParticlePointer(), ISimulation::initialize(), MesoCrystal::initialize(), Beam::operator=(), Instrument::operator=(), IParticle::rotate(), ParticleLayout::setAndRegisterInterferenceFunction(), ISimulation::setBackground(), InterferenceFunction1DLattice::setDecayFunction(), InterferenceFunction2DLattice::setDecayFunction(), Instrument::setDetector(), IDetector::setDetectorResolution(), Beam::setFootprintFactor(), Particle::setFormFactor(), InterferenceFunctionFinite3DLattice::setLattice(), InterferenceFunctionRadialParaCrystal::setProbabilityDistribution(), InterferenceFunction2DParaCrystal::setProbabilityDistributions(), ConvolutionDetectorResolution::setResolutionFunction(), IParticle::setRotation(), LayerInterface::setRoughness(), and InterferenceFunction2DSuperLattice::setSubstructureIFF().
|
inherited |
Definition at line 51 of file IParametricComponent.cpp.
References IParametricComponent::getName(), IParametricComponent::m_pool, RealSpace::Particles::name(), and IParametricComponent::onChange().
Referenced by BasicLattice2D::BasicLattice2D(), Beam::Beam(), CylindersInBABuilder::CylindersInBABuilder(), DetectionProperties::DetectionProperties(), HexagonalLattice2D::HexagonalLattice2D(), IInterferenceFunction::IInterferenceFunction(), INode::INode(), InterferenceFunction1DLattice::InterferenceFunction1DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunctionHardDisk::InterferenceFunctionHardDisk(), InterferenceFunctionRadialParaCrystal::InterferenceFunctionRadialParaCrystal(), InterferenceFunctionTwin::InterferenceFunctionTwin(), Lattice2D::Lattice2D(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), ParticleDistribution::ParticleDistribution(), PlainMultiLayerBySLDBuilder::PlainMultiLayerBySLDBuilder(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), ResonatorBuilder::ResonatorBuilder(), SquareLattice2D::SquareLattice2D(), TriangularRippleBuilder::TriangularRippleBuilder(), IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), IParametricComponent::registerVector(), ParticleLayout::registerWeight(), and Lattice2D::setRotationEnabled().
|
inherited |
Definition at line 57 of file IParametricComponent.cpp.
References ModelView::Utils::base_name(), IParametricComponent::registerParameter(), RealParameter::setUnit(), IParametricComponent::XComponentName(), IParametricComponent::YComponentName(), and IParametricComponent::ZComponentName().
Referenced by Beam::Beam(), DetectionProperties::DetectionProperties(), InterferenceFunctionTwin::InterferenceFunctionTwin(), MultiLayer::MultiLayer(), Lattice3D::initialize(), and IParticle::registerPosition().
|
inherited |
Definition at line 91 of file IParametricComponent.cpp.
References IParametricComponent::m_pool, and RealSpace::Particles::name().
Referenced by IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), IParametricComponent::removeVector(), and Lattice2D::setRotationEnabled().
|
inherited |
Definition at line 96 of file IParametricComponent.cpp.
References ModelView::Utils::base_name(), IParametricComponent::removeParameter(), IParametricComponent::XComponentName(), IParametricComponent::YComponentName(), and IParametricComponent::ZComponentName().
Referenced by IParticle::registerPosition().
|
inlineinherited |
Definition at line 69 of file IParametricComponent.h.
References IParametricComponent::m_name, and RealSpace::Particles::name().
Referenced by BasicLattice2D::BasicLattice2D(), Beam::Beam(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), Crystal::Crystal(), DetectionProperties::DetectionProperties(), DistributionHandler::DistributionHandler(), FormFactorCoreShell::FormFactorCoreShell(), FormFactorCrystal::FormFactorCrystal(), FormFactorDecoratorMaterial::FormFactorDecoratorMaterial(), FormFactorDecoratorPositionFactor::FormFactorDecoratorPositionFactor(), FormFactorDecoratorRotation::FormFactorDecoratorRotation(), FormFactorWeighted::FormFactorWeighted(), HexagonalLattice2D::HexagonalLattice2D(), IDetector::IDetector(), INode::INode(), Instrument::Instrument(), InterferenceFunction1DLattice::InterferenceFunction1DLattice(), InterferenceFunction2DLattice::InterferenceFunction2DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunction2DSuperLattice::InterferenceFunction2DSuperLattice(), InterferenceFunction3DLattice::InterferenceFunction3DLattice(), InterferenceFunctionFinite2DLattice::InterferenceFunctionFinite2DLattice(), InterferenceFunctionFinite3DLattice::InterferenceFunctionFinite3DLattice(), InterferenceFunctionHardDisk::InterferenceFunctionHardDisk(), InterferenceFunctionNone::InterferenceFunctionNone(), InterferenceFunctionRadialParaCrystal::InterferenceFunctionRadialParaCrystal(), InterferenceFunctionTwin::InterferenceFunctionTwin(), ISampleBuilder::ISampleBuilder(), IsGISAXSDetector::IsGISAXSDetector(), Lattice3D::Lattice3D(), Layer::Layer(), LayerInterface::LayerInterface(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), ParticleCoreShell::ParticleCoreShell(), ParticleDistribution::ParticleDistribution(), ParticleLayout::ParticleLayout(), RectangularDetector::RectangularDetector(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), SampleBuilderNode::SampleBuilderNode(), SphericalDetector::SphericalDetector(), SquareLattice2D::SquareLattice2D(), Layer::clone(), LayersWithAbsorptionBuilder::createSampleByIndex(), Basic2DParaCrystalBuilder::createSampleByIndex(), ParticleInVacuumBuilder::createSampleByIndex(), SimpleMagneticRotationBuilder::createSampleByIndex(), DepthProbeSimulation::initialize(), GISASSimulation::initialize(), OffSpecularSimulation::initialize(), SpecularSimulation::initialize(), SpecularDetector1D::initialize(), MesoCrystal::initialize(), Particle::initialize(), ParticleComposition::initialize(), Beam::operator=(), SampleBuilderNode::operator=(), SampleBuilderNode::reset(), and SampleBuilderNode::setSBN().
|
inherited |
Definition at line 65 of file IParametricComponent.cpp.
References IParametricComponent::createParameterTree(), IParametricComponent::m_pool, RealSpace::Particles::name(), and ParameterPool::setMatchedParametersValue().
Referenced by AsymRippleBuilder::buildSample(), and IParametricComponent::setVectorValue().
|
virtualinherited |
Reimplemented in SampleProvider.
Definition at line 79 of file INode.cpp.
References INode::m_parent.
Referenced by INode::registerChild(), SampleProvider::setBuilder(), and SampleProvider::setParent().
|
virtual |
Sets distribution units.
Reimplemented from IDistribution1D.
Definition at line 323 of file Distributions.cpp.
References IParametricComponent::parameter(), and RealParameter::setUnit().
|
inherited |
Definition at line 78 of file IParametricComponent.cpp.
References ModelView::Utils::base_name(), IParametricComponent::setParameterValue(), BasicVector3D< T >::x(), IParametricComponent::XComponentName(), BasicVector3D< T >::y(), IParametricComponent::YComponentName(), BasicVector3D< T >::z(), and IParametricComponent::ZComponentName().
|
inlinevirtualinherited |
Used for Python overriding of clone (see swig/tweaks.py)
Definition at line 34 of file ICloneable.h.
|
virtualinherited |
Returns multiline string representing tree structure below the node.
Definition at line 52 of file INode.cpp.
References NodeUtils::nodeToString().
|
staticinherited |
Definition at line 103 of file IParametricComponent.cpp.
References ModelView::Utils::base_name().
Referenced by Lattice3D::initialize(), IParticle::registerPosition(), IParametricComponent::registerVector(), IParametricComponent::removeVector(), IParametricComponent::setVectorValue(), and VectorParameterTranslator::translate().
|
staticinherited |
Definition at line 108 of file IParametricComponent.cpp.
References ModelView::Utils::base_name().
Referenced by IParametricComponent::registerVector(), IParametricComponent::removeVector(), IParametricComponent::setVectorValue(), and VectorParameterTranslator::translate().
|
staticinherited |
Definition at line 113 of file IParametricComponent.cpp.
References ModelView::Utils::base_name().
Referenced by IParametricComponent::registerVector(), IParametricComponent::removeVector(), IParametricComponent::setVectorValue(), and VectorParameterTranslator::translate().
|
private |
Definition at line 215 of file Distributions.h.
Referenced by clone(), equidistantPoints(), getMean(), getMedian(), and probabilityDensity().
|
privateinherited |
Definition at line 73 of file IParametricComponent.h.
Referenced by IParametricComponent::getName(), and IParametricComponent::setName().
|
protectedinherited |
Definition at line 88 of file INode.h.
Referenced by INode::INode().
|
protectedinherited |
Definition at line 89 of file INode.h.
Referenced by INode::INode(), and IFootprintFactor::setWidthRatio().
|
privateinherited |
Definition at line 83 of file INode.h.
Referenced by INode::displayName(), INode::parent(), and INode::setParent().
|
privateinherited |
parameter pool (kind of pointer-to-implementation)
Definition at line 74 of file IParametricComponent.h.
Referenced by IParametricComponent::createParameterTree(), IParametricComponent::parameter(), IParametricComponent::parameterPool(), IParametricComponent::registerParameter(), IParametricComponent::removeParameter(), and IParametricComponent::setParameterValue().
|
private |
Definition at line 216 of file Distributions.h.
Referenced by clone(), equidistantPoints(), getMean(), getScalePar(), isDelta(), and probabilityDensity().