bpp-core  2.1.0
 All Classes Namespaces Files Functions Variables Typedefs Friends
bpp::ParameterAliasableAdapter Class Referenceabstract

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

#include <Bpp/Numeric/ParameterAliasable.h>

+ Inheritance diagram for bpp::ParameterAliasableAdapter:
+ Collaboration diagram for bpp::ParameterAliasableAdapter:

Public Member Functions

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

Protected Attributes

ParameterList parameters_
 
Parameter parameter_
 

Detailed Description

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

See Also
Parameter, ParameterList, ParameterAliasable

Definition at line 146 of file ParameterAliasable.h.

Constructor & Destructor Documentation

bpp::ParameterAliasableAdapter::ParameterAliasableAdapter ( )
inline

Definition at line 150 of file ParameterAliasable.h.

virtual bpp::ParameterAliasableAdapter::~ParameterAliasableAdapter ( )
inlinevirtual

Definition at line 151 of file ParameterAliasable.h.

Member Function Documentation

void bpp::ParameterAliasableAdapter::aliasParameters ( const std::string &  p1,
const std::string &  p2 
) throw (ParameterNotFoundException, Exception)
inline

Definition at line 161 of file ParameterAliasable.h.

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::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::PowellMultiDimensions, bpp::Range< T >, bpp::OutputStream, bpp::AliasParameterListener, 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::DiscreteDistribution, bpp::MultipleDiscreteDistribution, bpp::ConstantDistribution, 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.

std::vector<std::string> bpp::ParameterAliasableAdapter::getAlias ( const std::string &  name) const
inline

Definition at line 164 of file ParameterAliasable.h.

const ParameterList& bpp::ParameterAliasableAdapter::getIndependentParameters ( ) const
inline

Definition at line 160 of file ParameterAliasable.h.

References bpp::ParametrizableAdapter::getParameters().

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

Implements bpp::Parametrizable.

Definition at line 221 of file Parametrizable.h.

unsigned int bpp::ParameterAliasableAdapter::getNumberOfIndependentParameters ( ) const
inline

Definition at line 163 of file ParameterAliasable.h.

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

Get the number of parameters.

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

Implements bpp::Parametrizable.

Definition at line 219 of file Parametrizable.h.

const Parameter& bpp::ParametrizableAdapter::getParameter ( const std::string &  name) const throw (ParameterNotFoundException)
inlinevirtualinherited

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 208 of file Parametrizable.h.

References bpp::ParametrizableAdapter::parameter_.

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

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 222 of file Parametrizable.h.

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

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 207 of file Parametrizable.h.

References bpp::ParametrizableAdapter::parameters_.

Referenced by getIndependentParameters().

double bpp::ParametrizableAdapter::getParameterValue ( const std::string &  name) const throw (ParameterNotFoundException)
inlinevirtualinherited

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 209 of file Parametrizable.h.

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

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 206 of file Parametrizable.h.

References bpp::ParametrizableAdapter::parameters_.

bool bpp::ParametrizableAdapter::matchParametersValues ( const ParameterList parameters) throw (ConstraintException)
inlinevirtualinherited

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 217 of file Parametrizable.h.

void bpp::ParametrizableAdapter::setAllParametersValues ( const ParameterList parameters) throw (ParameterNotFoundException, ConstraintException)
inlinevirtualinherited

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 211 of file Parametrizable.h.

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

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 220 of file Parametrizable.h.

void bpp::ParametrizableAdapter::setParametersValues ( const ParameterList parameters) throw (ParameterNotFoundException, ConstraintException)
inlinevirtualinherited

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 215 of file Parametrizable.h.

void bpp::ParametrizableAdapter::setParameterValue ( const std::string &  name,
double  value 
) throw (ParameterNotFoundException, ConstraintException)
inlinevirtualinherited

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 213 of file Parametrizable.h.

void bpp::ParameterAliasableAdapter::unaliasParameters ( const std::string &  p1,
const std::string &  p2 
) throw (ParameterNotFoundException, Exception)
inline

Definition at line 162 of file ParameterAliasable.h.

Member Data Documentation

Parameter bpp::ParametrizableAdapter::parameter_
protectedinherited

Definition at line 193 of file Parametrizable.h.

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

ParameterList bpp::ParametrizableAdapter::parameters_
protectedinherited

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