bpp-core3  3.0.0
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)
 
void unaliasParameters (const std::string &p1, const std::string &p2)
 
unsigned int getNumberOfIndependentParameters () const
 
std::vector< std::string > getAlias (const std::string &name) const
 
std::map< std::string, std::string > getAliases () 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
 Get the parameter with specified name. More...
 
double getParameterValue (const std::string &name) const
 Get the value for parameter of name 'name'. More...
 
void setAllParametersValues (const ParameterList &parameters)
 Set the parameters values to be equals to those of parameters. More...
 
void setParameterValue (const std::string &name, double value)
 Set the value of parameter with name name to be equal to value. More...
 
void setParametersValues (const ParameterList &parameters)
 Update the parameters from parameters. More...
 
bool matchParametersValues (const ParameterList &parameters)
 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 Member Functions

virtual ParameterListgetParameters_ ()=0
 Get all parameters available. 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 164 of file ParameterAliasable.h.

Constructor & Destructor Documentation

◆ ParameterAliasableAdapter()

bpp::ParameterAliasableAdapter::ParameterAliasableAdapter ( )
inline

Definition at line 168 of file ParameterAliasable.h.

◆ ~ParameterAliasableAdapter()

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

Definition at line 169 of file ParameterAliasable.h.

Member Function Documentation

◆ aliasParameters()

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

Definition at line 178 of file ParameterAliasable.h.

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

Referenced by bpp::AbstractParameterAliasable::aliasParameters(), bpp::LogsumHmmLikelihood::LogsumHmmLikelihood(), and bpp::LogsumHmmLikelihood::operator=().

◆ getAlias()

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

Definition at line 181 of file ParameterAliasable.h.

◆ getAliases()

std::map<std::string, std::string> bpp::ParameterAliasableAdapter::getAliases ( ) const
inline

Definition at line 182 of file ParameterAliasable.h.

◆ getIndependentParameters()

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

Definition at line 177 of file ParameterAliasable.h.

References bpp::ParametrizableAdapter::getParameters().

◆ getNamespace()

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

◆ getNumberOfIndependentParameters()

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

Definition at line 180 of file ParameterAliasable.h.

◆ getNumberOfParameters()

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

◆ getParameter()

const Parameter& bpp::ParametrizableAdapter::getParameter ( const std::string &  name) const
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 214 of file Parametrizable.h.

References bpp::ParametrizableAdapter::parameter_.

◆ getParameterNameWithoutNamespace()

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

◆ getParameters()

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

References bpp::ParametrizableAdapter::parameters_.

Referenced by getIndependentParameters().

◆ 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::DirectionFunction, and bpp::AbstractParametrizable.

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

◆ getParameterValue()

double bpp::ParametrizableAdapter::getParameterValue ( const std::string &  name) const
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 215 of file Parametrizable.h.

◆ hasParameter()

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

References bpp::ParameterList::hasParameter(), and bpp::ParametrizableAdapter::parameters_.

◆ matchParametersValues()

bool bpp::ParametrizableAdapter::matchParametersValues ( const ParameterList parameters)
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 219 of file Parametrizable.h.

◆ setAllParametersValues()

void bpp::ParametrizableAdapter::setAllParametersValues ( const ParameterList parameters)
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 216 of file Parametrizable.h.

◆ setNamespace()

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

◆ setParametersValues()

void bpp::ParametrizableAdapter::setParametersValues ( const ParameterList parameters)
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 218 of file Parametrizable.h.

◆ setParameterValue()

void bpp::ParametrizableAdapter::setParameterValue ( const std::string &  name,
double  value 
)
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 217 of file Parametrizable.h.

◆ unaliasParameters()

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

Definition at line 179 of file ParameterAliasable.h.

Member Data Documentation

◆ parameter_

Parameter bpp::ParametrizableAdapter::parameter_
protectedinherited

Definition at line 200 of file Parametrizable.h.

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

◆ parameters_

ParameterList bpp::ParametrizableAdapter::parameters_
protectedinherited

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