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 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 ParameterAliasable interface with void functions.

See also
Parameter, ParameterList, ParameterAliasable

Definition at line 128 of file ParameterAliasable.h.

Constructor & Destructor Documentation

◆ ParameterAliasableAdapter()

bpp::ParameterAliasableAdapter::ParameterAliasableAdapter ( )
inline

Definition at line 132 of file ParameterAliasable.h.

◆ ~ParameterAliasableAdapter()

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

Definition at line 133 of file ParameterAliasable.h.

Member Function Documentation

◆ aliasParameters()

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

Definition at line 142 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::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().

◆ getAlias()

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

Definition at line 145 of file ParameterAliasable.h.

◆ getAliases()

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

Definition at line 146 of file ParameterAliasable.h.

◆ getIndependentParameters()

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

Definition at line 141 of file ParameterAliasable.h.

References bpp::Parametrizable::getParameters().

◆ getNamespace()

std::string bpp::ParametrizableAdapter::getNamespace ( ) const
inlineoverridevirtualinherited
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.

◆ getNumberOfIndependentParameters()

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

Definition at line 144 of file ParameterAliasable.h.

◆ getNumberOfParameters()

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

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
inlineoverridevirtualinherited

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
inlineoverridevirtualinherited

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
inlineoverridevirtualinherited

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
inlineoverridevirtualinherited

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)
inlineoverridevirtualinherited

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
inlineoverridevirtualinherited

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)
inlineoverridevirtualinherited

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)
inlineoverridevirtualinherited

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 
)
inlineoverridevirtualinherited

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)
inlineoverridevirtualinherited

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)
inlineoverridevirtualinherited

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 
)
inlineoverridevirtualinherited

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.

◆ unaliasParameters()

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

Definition at line 143 of file ParameterAliasable.h.

Member Data Documentation

◆ parameter_

Parameter bpp::ParametrizableAdapter::parameter_
protectedinherited

Definition at line 180 of file Parametrizable.h.

◆ parameters_

ParameterList bpp::ParametrizableAdapter::parameters_
protectedinherited

Definition at line 179 of file Parametrizable.h.


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