bpp-core3  3.0.0
bpp::ParametrizableAdapter Class Referenceabstract

A low-level implementation of the Parametrizable interface with void functions. More...

#include <Bpp/Numeric/Parametrizable.h>

+ Inheritance diagram for bpp::ParametrizableAdapter:
+ Collaboration diagram for bpp::ParametrizableAdapter:

Public Member Functions

 ParametrizableAdapter ()
 
virtual ~ParametrizableAdapter ()
 
virtual Clonableclone () const =0
 Create a copy of this object and send a pointer to it. More...
 
The Parametrizable interface.
bool hasParameter (const std::string &name) const override
 Tell if there is a parameter with specified name. More...
 
const ParameterListgetParameters () const override
 Get all parameters available. More...
 
const Parameterparameter (const std::string &name) const override
 Get the parameter with specified name. More...
 
double getParameterValue (const std::string &name) const override
 Get the value for parameter of name 'name'. More...
 
void setAllParametersValues (const ParameterList &parameters) override
 Set the parameters values to be equals to those of parameters. More...
 
void setParameterValue (const std::string &name, double value) override
 Set the value of parameter with name name to be equal to value. More...
 
void setParametersValues (const ParameterList &parameters) override
 Update the parameters from parameters. More...
 
bool matchParametersValues (const ParameterList &parameters) override
 Update the parameters from parameters. More...
 
void removeConstraint (const std::string &name) override
 Remove the constraint associated with one parameter, if any. More...
 
void setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override
 Set/Change the constraint associated with one parameter. More...
 
size_t getNumberOfParameters () const override
 Get the number of parameters. More...
 
void setNamespace (const std::string &prefix) override
 Set the namespace for the parameter names. More...
 
std::string getNamespace () const override
 
std::string getParameterNameWithoutNamespace (const std::string &name) const override
 Resolves a parameter name according to the current namespace. More...
 

Protected Member Functions

virtual ParameterListgetParameters_ ()=0
 Get all parameters available. More...
 

Protected Attributes

ParameterList parameters_
 
Parameter parameter_
 

Detailed Description

A low-level implementation of the Parametrizable interface with void functions.

See also
Parameter, ParameterList, Parametrizable

Definition at line 175 of file Parametrizable.h.

Constructor & Destructor Documentation

◆ ParametrizableAdapter()

bpp::ParametrizableAdapter::ParametrizableAdapter ( )
inline

Definition at line 183 of file Parametrizable.h.

◆ ~ParametrizableAdapter()

virtual bpp::ParametrizableAdapter::~ParametrizableAdapter ( )
inlinevirtual

Definition at line 184 of file Parametrizable.h.

Member Function Documentation

◆ clone()

virtual Clonable* bpp::Clonable::clone ( ) const
pure virtualinherited

Create a copy of this object and send a pointer to it.

Returns
A pointer toward the copy object.

Implemented in bpp::TestFunction, bpp::InfinityDerivableSecondOrderWrapper, bpp::InfinityDerivableFirstOrderWrapper, bpp::InfinityFunctionWrapper, bpp::LinearMatrix< Scalar >, bpp::AssociationGraphImplObserver< N, E, GraphImpl >, bpp::AssociationGraphImplObserver< N, E, DAGraphImpl >, bpp::AssociationGraphImplObserver< N, E, TreeGraphImpl >, bpp::StdErr, bpp::FunctionStopCondition, bpp::ColMatrix< Scalar >, bpp::PlaceboTransformedParameter, bpp::StdOut, bpp::GlobalGraph, bpp::ParametersStopCondition, bpp::StlOutputStreamWrapper, bpp::ReparametrizationDerivableSecondOrderWrapper, bpp::IntervalTransformedParameter, bpp::MetaOptimizer, bpp::IntervalConstraint, bpp::BppUnsignedInteger, bpp::StlOutputStream, bpp::SecondOrderDerivable, bpp::LogsumHmmLikelihood, bpp::RescaledHmmLikelihood, bpp::ReparametrizationDerivableFirstOrderWrapper, bpp::BppInteger, bpp::RowMatrix< Scalar >, bpp::RowMatrix< double >, bpp::RowMatrix< Real >, bpp::Parameter, bpp::Simplex, bpp::LowMemoryRescaledHmmLikelihood, bpp::Table< T >, bpp::AbstractNumericalDerivative, bpp::BppDouble, bpp::RTransformedParameter, bpp::NullOutputStream, bpp::ParametrizableCollection< N >, bpp::FirstOrderDerivable, bpp::OptimizerInterface, bpp::AssociationTreeGraphImplObserver< N, E, TreeGraphImpl >, bpp::AssociationDAGraphImplObserver< N, E, DAGraphImpl >, bpp::ThreePointsNumericalDerivative, bpp::DirichletDiscreteDistribution, bpp::SimpleDiscreteDistribution, bpp::DownhillSimplexMethod, bpp::Number< T >, bpp::Number< double >, bpp::Number< int >, bpp::Number< unsigned int >, bpp::FivePointsNumericalDerivative, bpp::ReparametrizationFunctionWrapper, bpp::DataTable, bpp::PrincipalComponentAnalysis, bpp::DualityDiagram, bpp::TruncatedExponentialDiscreteDistribution, bpp::MetaOptimizerInfos, bpp::BrentOneDimension, bpp::NewtonBacktrackOneDimension, bpp::FunctionOperator< F >, bpp::AutoParameter, bpp::GammaDiscreteDistribution, bpp::MixtureOfDiscreteDistributions, bpp::AliasParameterListener, bpp::Range< T >, bpp::PowellMultiDimensions, bpp::InvariantMixedDiscreteDistribution, bpp::TwoPointsNumericalDerivative, bpp::ParameterListener, bpp::OutputStream, bpp::GoldenSectionSearch, bpp::DirectionFunction, bpp::Point2D< T >, bpp::BetaDiscreteDistribution, bpp::ExponentialDiscreteDistribution, bpp::ParameterList, bpp::CorrespondenceAnalysis, bpp::HmmLikelihood, bpp::GaussianDiscreteDistribution, bpp::BfgsMultiDimensions, bpp::NewtonBacktrackOneDimension::NBODStopCondition, bpp::FullHmmTransitionMatrix, bpp::BppNotANumber, bpp::UniformDiscreteDistribution, bpp::ContingencyTableTest, bpp::Font, bpp::ConstantDistribution, bpp::DiscreteDistributionInterface, bpp::MultipleDiscreteDistribution, bpp::DownhillSimplexMethod::DSMStopCondition, bpp::MathOperator, bpp::BrentOneDimension::BODStopCondition, bpp::ConjugateGradientMultiDimensions, bpp::OptimizationStopCondition, bpp::AutoCorrelationTransitionMatrix, bpp::ParameterEvent, bpp::ComputationTree, bpp::GoldenSectionSearch::GSSStopCondition, bpp::PowellMultiDimensions::PMDStopCondition, bpp::ConstraintInterface, bpp::HmmStateAlphabet, bpp::RGBColor, bpp::SimpleMultiDimensions, bpp::SimpleNewtonMultiDimensions, bpp::HmmEmissionProbabilities, bpp::BinaryOperator, bpp::BppVector< T >, bpp::TransformedParameter, bpp::BppString, bpp::ConstantOperator, bpp::NegativeOperator, bpp::HmmTransitionMatrix, bpp::BppNumberI, bpp::BppBoolean, and bpp::NewtonOneDimension.

Referenced by bpp::FirstOrderDerivable::~FirstOrderDerivable(), and bpp::SecondOrderDerivable::~SecondOrderDerivable().

◆ getNamespace()

std::string bpp::ParametrizableAdapter::getNamespace ( ) const
inlineoverridevirtual
Returns
The current namespace used. This is an empty string if no namespace is currently defined.

Implements bpp::Parametrizable.

Definition at line 204 of file Parametrizable.h.

◆ getNumberOfParameters()

size_t bpp::ParametrizableAdapter::getNumberOfParameters ( ) const
inlineoverridevirtual

Get the number of parameters.

See also
getNumberOfIndependentParameters If some parameters are aliased.
Returns
The number of parameters.

Implements bpp::Parametrizable.

Definition at line 202 of file Parametrizable.h.

◆ getParameterNameWithoutNamespace()

std::string bpp::ParametrizableAdapter::getParameterNameWithoutNamespace ( const std::string &  name) const
inlineoverridevirtual

Resolves a parameter name according to the current namespace.

Returns
The parameter name without the namespace prefix, if any.

Implements bpp::Parametrizable.

Definition at line 205 of file Parametrizable.h.

◆ getParameters()

const ParameterList& bpp::ParametrizableAdapter::getParameters ( ) const
inlineoverridevirtual

Get all parameters available.

See also
getIndependentParameters if some parameters are aliased.
Returns
A list with all parameters available.

Implements bpp::Parametrizable.

Definition at line 193 of file Parametrizable.h.

◆ getParameters_()

virtual ParameterList& bpp::Parametrizable::getParameters_ ( )
protectedpure virtualinherited

Get all parameters available.

See also
getIndependentParameters if some parameters are aliased.
Returns
A list with all parameters available.

Implemented in bpp::FunctionWrapper, bpp::AbstractParametrizable, and bpp::DirectionFunction.

Referenced by bpp::Parametrizable::~Parametrizable().

◆ getParameterValue()

double bpp::ParametrizableAdapter::getParameterValue ( const std::string &  name) const
inlineoverridevirtual

Get the value for parameter of name 'name'.

Parameters
nameThe name of the parameter.
Returns
the value of parameter name.

Implements bpp::Parametrizable.

Definition at line 195 of file Parametrizable.h.

◆ hasParameter()

bool bpp::ParametrizableAdapter::hasParameter ( const std::string &  name) const
inlineoverridevirtual

Tell if there is a parameter with specified name.

Parameters
nameThe name of the parameter to look for.
Returns
y/n.

Implements bpp::Parametrizable.

Definition at line 192 of file Parametrizable.h.

References bpp::ParameterList::hasParameter().

◆ matchParametersValues()

bool bpp::ParametrizableAdapter::matchParametersValues ( const ParameterList parameters)
inlineoverridevirtual

Update the parameters from parameters.

Only common parameters with parameters will be updated.

Parameters
parametersA list of parameters.
Returns
True if at least one parameter value has been changed.
Exceptions
ConstraintExceptionIf a value in parameters does not match the constraint in the corresponding parameter in the list.

Implements bpp::Parametrizable.

Definition at line 199 of file Parametrizable.h.

◆ parameter()

const Parameter& bpp::ParametrizableAdapter::parameter ( const std::string &  name) const
inlineoverridevirtual

Get the parameter with specified name.

Parameters
nameThe name of the parameter to look for.
Returns
The parameter with given name.
Exceptions
ParameterNotFoundExceptionif no parameter with this name is found.

Implements bpp::Parametrizable.

Definition at line 194 of file Parametrizable.h.

◆ removeConstraint()

void bpp::ParametrizableAdapter::removeConstraint ( const std::string &  name)
inlineoverridevirtual

Remove the constraint associated with one parameter, if any.

Parameters
nameThe name of the parameter to look for.
Exceptions
ParameterNotFoundExceptionif no parameter with this name is found.

Implements bpp::Parametrizable.

Definition at line 200 of file Parametrizable.h.

◆ setAllParametersValues()

void bpp::ParametrizableAdapter::setAllParametersValues ( const ParameterList parameters)
inlineoverridevirtual

Set the parameters values to be equals to those of parameters.

The list must contain exactly the same parameters (ie same names) than the parameters available.

Parameters
parametersA list with all parameters.
Exceptions
ParameterNotFoundExceptionIf a some parameter in the list is not in params.
ConstraintExceptionIf a value in parameters does not match the constraint in the corresponding parameter in the list.

Implements bpp::Parametrizable.

Definition at line 196 of file Parametrizable.h.

◆ setConstraint()

void bpp::ParametrizableAdapter::setConstraint ( const std::string &  name,
std::shared_ptr< ConstraintInterface constraint 
)
inlineoverridevirtual

Set/Change the constraint associated with one parameter.

Parameters
nameThe name of the parameter to look for.
constraintA pointer to the constraint (may be null)
Exceptions
ParameterNotFoundExceptionif no parameter with this name is found.

Implements bpp::Parametrizable.

Definition at line 201 of file Parametrizable.h.

◆ setNamespace()

void bpp::ParametrizableAdapter::setNamespace ( const std::string &  prefix)
inlineoverridevirtual

Set the namespace for the parameter names.

Parameters
prefixThe 'namespace', that is a prefix to add to all parameter names. If parameter names are already prefixed, the new prefix will be used instead.

Implements bpp::Parametrizable.

Definition at line 203 of file Parametrizable.h.

◆ setParametersValues()

void bpp::ParametrizableAdapter::setParametersValues ( const ParameterList parameters)
inlineoverridevirtual

Update the parameters from parameters.

parameters must be a subset of all parameters available.

Parameters
parametersA list containing all parameters to update.
Exceptions
ParameterNotFoundExceptionIf a some parameter in params is not in the list.
ConstraintExceptionIf a value in parameters does not match the constraint in the corresponding parameter in the list.

Implements bpp::Parametrizable.

Definition at line 198 of file Parametrizable.h.

◆ setParameterValue()

void bpp::ParametrizableAdapter::setParameterValue ( const std::string &  name,
double  value 
)
inlineoverridevirtual

Set the value of parameter with name name to be equal to value.

Parameters
namethe name of the parameter to set.
valueThe value of the parameter.
Exceptions
ParameterNotFoundExceptionIf no parameter in the list has the name name.
ConstraintExceptionIf value does not match the constraint associated to parameter name.

Implements bpp::Parametrizable.

Definition at line 197 of file Parametrizable.h.

Member Data Documentation

◆ parameter_

Parameter bpp::ParametrizableAdapter::parameter_
protected

Definition at line 180 of file Parametrizable.h.

◆ parameters_

ParameterList bpp::ParametrizableAdapter::parameters_
protected

Definition at line 179 of file Parametrizable.h.


The documentation for this class was generated from the following file: