BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Public Member Functions | |
IParameterized (const std::string &name="") | |
IParameterized (const IParameterized &other) | |
virtual | ~IParameterized () |
IParameterized & | operator= (const IParameterized &other)=delete |
ParameterPool * | parameterPool () const |
virtual ParameterPool * | createParameterTree () const |
std::string | parametersToString () const |
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 | setParameterValue (const std::string &name, double value) |
void | setVectorValue (const std::string &base_name, kvector_t value) |
RealParameter * | parameter (const std::string &name) const |
virtual void | onChange () |
void | removeParameter (const std::string &name) |
void | removeVector (const std::string &base_name) |
void | setName (const std::string &name) |
const std::string & | getName () const |
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) |
Private Attributes | |
std::string | m_name |
std::unique_ptr< ParameterPool > | m_pool |
Manages a local parameter pool, and a tree of child pools.
Definition at line 28 of file IParameterized.h.
IParameterized::IParameterized | ( | const std::string & | name = "" | ) |
Definition at line 23 of file IParameterized.cpp.
IParameterized::IParameterized | ( | const IParameterized & | other | ) |
Definition at line 25 of file IParameterized.cpp.
References ParameterPool::empty(), getName(), and parameterPool().
|
virtualdefault |
|
delete |
|
inline |
Returns pointer to the parameter pool.
Definition at line 38 of file IParameterized.h.
References m_pool.
Referenced by pyfmt2::argumentList(), SampleBuilderNode::borrow_builder_parameters(), INode::createParameterTree(), INode::INode(), IParameterized(), anonymous_namespace{NodeUtils.cpp}::poolToString(), SampleBuilderNode::reset(), and IDistribution1D::setUnits().
|
virtual |
Creates new parameter pool, with all local parameters and those of its children.
Reimplemented in INode.
Definition at line 33 of file IParameterized.cpp.
References getName(), and m_pool.
Referenced by parametersToString(), ParameterUtils::poolParameterUnits(), and setParameterValue().
std::string IParameterized::parametersToString | ( | ) | const |
Returns multiline string representing available parameters.
Definition at line 40 of file IParameterized.cpp.
References createParameterTree().
RealParameter & IParameterized::registerParameter | ( | const std::string & | name, |
double * | parpointer | ||
) |
Definition at line 48 of file IParameterized.cpp.
References getName(), m_pool, and onChange().
Referenced by BasicLattice::BasicLattice(), Beam::Beam(), CylindersInBABuilder::CylindersInBABuilder(), DetectionProperties::DetectionProperties(), HexagonalLattice::HexagonalLattice(), IInterferenceFunction::IInterferenceFunction(), INode::INode(), InterferenceFunction1DLattice::InterferenceFunction1DLattice(), InterferenceFunction2DParaCrystal::InterferenceFunction2DParaCrystal(), InterferenceFunctionHardDisk::InterferenceFunctionHardDisk(), InterferenceFunctionRadialParaCrystal::InterferenceFunctionRadialParaCrystal(), InterferenceFunctionTwin::InterferenceFunctionTwin(), Lattice2D::Lattice2D(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), ParticleDistribution::ParticleDistribution(), PlainMultiLayerBySLDBuilder::PlainMultiLayerBySLDBuilder(), IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), registerVector(), ParticleLayout::registerWeight(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), ResonatorBuilder::ResonatorBuilder(), Lattice2D::setRotationEnabled(), SquareLattice::SquareLattice(), and TriangularRippleBuilder::TriangularRippleBuilder().
void IParameterized::registerVector | ( | const std::string & | base_name, |
kvector_t * | p_vec, | ||
const std::string & | units = "nm" |
||
) |
Definition at line 54 of file IParameterized.cpp.
References registerParameter(), RealParameter::setUnit(), XComponentName(), YComponentName(), and ZComponentName().
Referenced by Beam::Beam(), DetectionProperties::DetectionProperties(), InterferenceFunctionTwin::InterferenceFunctionTwin(), MultiLayer::MultiLayer(), Lattice::registerBasisVectors(), and IParticle::registerPosition().
void IParameterized::setParameterValue | ( | const std::string & | name, |
double | value | ||
) |
Definition at line 62 of file IParameterized.cpp.
References createParameterTree(), m_pool, and ParameterPool::setMatchedParametersValue().
Referenced by AsymRippleBuilder::buildSample(), and setVectorValue().
void IParameterized::setVectorValue | ( | const std::string & | base_name, |
kvector_t | value | ||
) |
Definition at line 75 of file IParameterized.cpp.
References setParameterValue(), BasicVector3D< T >::x(), XComponentName(), BasicVector3D< T >::y(), YComponentName(), BasicVector3D< T >::z(), and ZComponentName().
RealParameter * IParameterized::parameter | ( | const std::string & | name | ) | const |
Returns parameter with given 'name'.
Definition at line 83 of file IParameterized.cpp.
References m_pool.
Referenced by DepthProbeSimulation::initialize(), SpecularSimulation::initialize(), IParticle::registerAbundance(), Lattice::registerBasisVectors(), ParticleLayout::registerParticleDensity(), IParticle::registerPosition(), Layer::registerThickness(), Lattice2D::setRotationEnabled(), and DistributionLogNormal::setUnits().
|
inlinevirtual |
Action to be taken in inherited class when a parameter has changed.
Reimplemented in IProfileRipple, 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, InterferenceFunction3DLattice, InterferenceFunction2DLattice, Lattice, and Lattice2D.
Definition at line 58 of file IParameterized.h.
Referenced by Lattice2D::onChange(), and registerParameter().
void IParameterized::removeParameter | ( | const std::string & | name | ) |
Definition at line 88 of file IParameterized.cpp.
References m_pool.
Referenced by IParticle::registerAbundance(), ParticleLayout::registerParticleDensity(), Layer::registerThickness(), removeVector(), and Lattice2D::setRotationEnabled().
void IParameterized::removeVector | ( | const std::string & | base_name | ) |
Definition at line 93 of file IParameterized.cpp.
References removeParameter(), XComponentName(), YComponentName(), and ZComponentName().
Referenced by IParticle::registerPosition().
|
static |
Definition at line 100 of file IParameterized.cpp.
Referenced by Lattice::registerBasisVectors(), IParticle::registerPosition(), registerVector(), removeVector(), and setVectorValue().
|
static |
Definition at line 105 of file IParameterized.cpp.
Referenced by registerVector(), removeVector(), and setVectorValue().
|
static |
Definition at line 110 of file IParameterized.cpp.
Referenced by registerVector(), removeVector(), and setVectorValue().
|
inline |
Definition at line 68 of file IParameterized.h.
References m_name.
Referenced by BasicLattice::BasicLattice(), Beam::Beam(), Layer::clone(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), LayersWithAbsorptionBuilder::createSampleByIndex(), Basic2DParaCrystalBuilder::createSampleByIndex(), ParticleInVacuumBuilder::createSampleByIndex(), SimpleMagneticRotationBuilder::createSampleByIndex(), Crystal::Crystal(), DetectionProperties::DetectionProperties(), DistributionHandler::DistributionHandler(), FormFactorBAPol::FormFactorBAPol(), FormFactorCoreShell::FormFactorCoreShell(), FormFactorCrystal::FormFactorCrystal(), FormFactorDecoratorMaterial::FormFactorDecoratorMaterial(), FormFactorDecoratorPositionFactor::FormFactorDecoratorPositionFactor(), FormFactorDecoratorRotation::FormFactorDecoratorRotation(), FormFactorDWBA::FormFactorDWBA(), FormFactorDWBAPol::FormFactorDWBAPol(), FormFactorWeighted::FormFactorWeighted(), HexagonalLattice::HexagonalLattice(), IDetector::IDetector(), DepthProbeSimulation::initialize(), GISASSimulation::initialize(), OffSpecSimulation::initialize(), SpecularSimulation::initialize(), SpecularDetector1D::initialize(), MesoCrystal::initialize(), Particle::initialize(), ParticleComposition::initialize(), 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(), Lattice::Lattice(), Layer::Layer(), LayerInterface::LayerInterface(), LayerRoughness::LayerRoughness(), MultiLayer::MultiLayer(), Beam::operator=(), SampleBuilderNode::operator=(), ParticleCoreShell::ParticleCoreShell(), ParticleDistribution::ParticleDistribution(), ParticleLayout::ParticleLayout(), RectangularDetector::RectangularDetector(), SampleBuilderNode::reset(), ResolutionFunction2DGaussian::ResolutionFunction2DGaussian(), SampleBuilderNode::SampleBuilderNode(), SampleBuilderNode::setSBN(), SphericalDetector::SphericalDetector(), and SquareLattice::SquareLattice().
|
inline |
Definition at line 69 of file IParameterized.h.
References m_name.
Referenced by Beam::Beam(), Layer::clone(), IFormFactorBorn::computeSlicingEffects(), ConvolutionDetectorResolution::ConvolutionDetectorResolution(), INode::copyNumber(), createParameterTree(), IFormFactor::createSlicedFormFactor(), SampleToPython::defineFormFactors(), SampleToPython::defineInterferenceFunctions(), INode::displayName(), IDetector::IDetector(), Instrument::Instrument(), IParameterized(), Beam::operator=(), SampleBuilderNode::operator=(), anonymous_namespace{ParticleLayout.cpp}::particleDensityIsProvidedByInterference(), registerParameter(), SampleBuilderNode::SampleBuilderNode(), and IFormFactor::sliceFormFactor().
|
private |
Definition at line 72 of file IParameterized.h.
|
private |
parameter pool (kind of pointer-to-implementation)
Definition at line 73 of file IParameterized.h.
Referenced by createParameterTree(), parameter(), parameterPool(), registerParameter(), removeParameter(), and setParameterValue().