bpp-core  2.1.0
bpp::Parametrizable Class Reference

This is the interface for all objects that imply parameters. More...

#include <Bpp/Numeric/Parametrizable.h>

+ Inheritance diagram for bpp::Parametrizable:
+ Collaboration diagram for bpp::Parametrizable:

List of all members.

Public Member Functions

 Parametrizable ()
virtual ~Parametrizable ()
virtual bool hasParameter (const std::string &name) const =0
 Tell if there is a parameter with specified name.
virtual const ParameterListgetParameters () const =0
 Get all parameters available.
virtual const ParametergetParameter (const std::string &name) const =0 throw (ParameterNotFoundException)
 Get the parameter with specified name.
virtual double getParameterValue (const std::string &name) const =0 throw (ParameterNotFoundException)
 Get the value for parameter of name 'name'.
virtual void setAllParametersValues (const ParameterList &parameters)=0 throw (ParameterNotFoundException, ConstraintException)
 Set the parameters values to be equals to those of parameters.
virtual void setParameterValue (const std::string &name, double value)=0 throw (ParameterNotFoundException, ConstraintException)
 Set the value of parameter with name name to be equal to value.
virtual void setParametersValues (const ParameterList &parameters)=0 throw (ParameterNotFoundException, ConstraintException)
 Update the parameters from parameters.
virtual bool matchParametersValues (const ParameterList &parameters)=0 throw (ConstraintException)
 Update the parameters from parameters.
virtual size_t getNumberOfParameters () const =0
 Get the number of parameters.
virtual void setNamespace (const std::string &prefix)=0
 Set the namespace for the parameter names.
virtual std::string getNamespace () const =0
virtual std::string getParameterNameWithoutNamespace (const std::string &name) const =0
 Resolves a parameter name according to the current namespace.
virtual Clonableclone () const =0
 Create a copy of this object and send a pointer to it.

Detailed Description

This is the interface for all objects that imply parameters.

See also:
Parameter, ParameterList

Definition at line 59 of file Parametrizable.h.


Constructor & Destructor Documentation

Definition at line 63 of file Parametrizable.h.

virtual bpp::Parametrizable::~Parametrizable ( ) [inline, virtual]

Definition at line 64 of file Parametrizable.h.


Member Function Documentation

virtual Clonable* bpp::Clonable::clone ( ) const [pure virtual, inherited]

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::StdErr, bpp::FunctionStopCondition, bpp::StdOut, bpp::LinearMatrix< Scalar >, bpp::PlaceboTransformedParameter, bpp::StlOutputStreamWrapper, bpp::ParametersStopCondition, bpp::ReparametrizationDerivableSecondOrderWrapper, bpp::IntervalTransformedParameter, bpp::MetaOptimizer, bpp::StlOutputStream, bpp::DerivableSecondOrder, bpp::Parameter, bpp::ReparametrizationDerivableFirstOrderWrapper, bpp::IntervalConstraint, bpp::RowMatrix< Scalar >, bpp::RowMatrix< double >, bpp::RowMatrix< Real >, bpp::LowMemoryRescaledHmmLikelihood, bpp::NullOutputStream, bpp::LogsumHmmLikelihood, bpp::Simplex, bpp::RTransformedParameter, bpp::RescaledHmmLikelihood, bpp::DerivableFirstOrder, bpp::Optimizer, bpp::DownhillSimplexMethod, bpp::AbstractNumericalDerivative, bpp::SimpleDiscreteDistribution, bpp::DirichletDiscreteDistribution, bpp::DualityDiagram, bpp::ReparametrizationFunctionWrapper, bpp::PrincipalComponentAnalysis, bpp::TruncatedExponentialDiscreteDistribution, bpp::DataTable, bpp::MetaOptimizerInfos, bpp::MixtureOfDiscreteDistributions, bpp::NewtonBacktrackOneDimension, bpp::AutoParameter, bpp::FivePointsNumericalDerivative, bpp::ParameterListener, bpp::ThreePointsNumericalDerivative, bpp::UNode, bpp::InvariantMixedDiscreteDistribution, bpp::AliasParameterListener, bpp::PowellMultiDimensions, bpp::Range< T >, bpp::OutputStream, bpp::BrentOneDimension, bpp::GammaDiscreteDistribution, bpp::GoldenSectionSearch, bpp::DirectionFunction, bpp::TwoPointsNumericalDerivative, bpp::BetaDiscreteDistribution, bpp::ExponentialDiscreteDistribution, bpp::BppVector< TYPE >, bpp::CorrespondenceAnalysis, bpp::Point2D< T >, bpp::Number< T >, bpp::BppString, bpp::BasicTNode, bpp::ParameterList, bpp::ContingencyTableTest, bpp::Font, bpp::BfgsMultiDimensions, bpp::BppBoolean, bpp::TNode, bpp::HmmLikelihood, bpp::GaussianDiscreteDistribution, bpp::NewtonBacktrackOneDimension::NBODStopCondition, bpp::OptimizationStopCondition, bpp::ParameterEvent, bpp::UniformDiscreteDistribution, bpp::ConstantDistribution, bpp::DiscreteDistribution, bpp::MultipleDiscreteDistribution, bpp::ConjugateGradientMultiDimensions, bpp::DownhillSimplexMethod::DSMStopCondition, bpp::RGBColor, bpp::BrentOneDimension::BODStopCondition, bpp::ONode, bpp::GoldenSectionSearch::GSSStopCondition, bpp::PowellMultiDimensions::PMDStopCondition, bpp::SimpleMultiDimensions, bpp::SimpleNewtonMultiDimensions, bpp::HmmEmissionProbabilities, bpp::Constraint, bpp::TransformedParameter, and bpp::NewtonOneDimension.

virtual std::string bpp::Parametrizable::getNamespace ( ) const [pure virtual]
Returns:
The current namespace used. This is an empty string if no namespace is currently defined.

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

Referenced by bpp::FunctionWrapper::getNamespace().

virtual size_t bpp::Parametrizable::getNumberOfParameters ( ) const [pure virtual]

Get the number of parameters.

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

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

Referenced by bpp::FunctionWrapper::getNumberOfParameters(), and bpp::BppODiscreteDistributionFormat::write().

virtual const Parameter& bpp::Parametrizable::getParameter ( const std::string &  name) const throw (ParameterNotFoundException) [pure virtual]

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.

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

Referenced by bpp::FunctionWrapper::getParameter().

virtual std::string bpp::Parametrizable::getParameterNameWithoutNamespace ( const std::string &  name) const [pure virtual]

Resolves a parameter name according to the current namespace.

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

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

Referenced by bpp::FunctionWrapper::getParameterNameWithoutNamespace(), bpp::BppODiscreteDistributionFormat::read(), and bpp::BppOParametrizableFormat::write().

virtual double bpp::Parametrizable::getParameterValue ( const std::string &  name) const throw (ParameterNotFoundException) [pure virtual]

Get the value for parameter of name 'name'.

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

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

Referenced by bpp::FunctionWrapper::getParameterValue(), and bpp::BppODiscreteDistributionFormat::read().

virtual bool bpp::Parametrizable::hasParameter ( const std::string &  name) const [pure virtual]

Tell if there is a parameter with specified name.

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

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

Referenced by bpp::FunctionWrapper::hasParameter().

virtual bool bpp::Parametrizable::matchParametersValues ( const ParameterList parameters) throw (ConstraintException) [pure virtual]

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.

Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::InvariantMixedDiscreteDistribution::fireParameterChanged(), bpp::AbstractNumericalDerivative::matchParametersValues(), bpp::FunctionWrapper::matchParametersValues(), and bpp::InfinityFunctionWrapper::matchParametersValues().

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.

Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::AbstractNumericalDerivative::setAllParametersValues(), bpp::FunctionWrapper::setAllParametersValues(), and bpp::InfinityFunctionWrapper::setAllParametersValues().

virtual void bpp::Parametrizable::setNamespace ( const std::string &  prefix) [pure virtual]

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.

Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, bpp::AbstractParameterAliasable, bpp::MixtureOfDiscreteDistributions, bpp::AbstractParametrizable, and bpp::InvariantMixedDiscreteDistribution.

Referenced by bpp::InvariantMixedDiscreteDistribution::InvariantMixedDiscreteDistribution(), bpp::InvariantMixedDiscreteDistribution::setNamespace(), and bpp::FunctionWrapper::setNamespace().

virtual void bpp::Parametrizable::setParametersValues ( const ParameterList parameters) throw (ParameterNotFoundException, ConstraintException) [pure virtual]

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.

Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::AbstractNumericalDerivative::setParametersValues(), bpp::FunctionWrapper::setParametersValues(), and bpp::InfinityFunctionWrapper::setParametersValues().

virtual void bpp::Parametrizable::setParameterValue ( const std::string &  name,
double  value 
) throw (ParameterNotFoundException, ConstraintException) [pure virtual]

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.

Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.

Referenced by bpp::AbstractNumericalDerivative::setParameterValue(), bpp::FunctionWrapper::setParameterValue(), and bpp::InfinityFunctionWrapper::setParameterValue().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Friends