bpp-core3
3.0.0
|
A partial implementation of the Parametrizable interface. More...
#include <Bpp/Numeric/AbstractParameterAliasable.h>
Public Member Functions | |
AbstractParameterAliasable (const std::string &prefix) | |
AbstractParameterAliasable (const AbstractParameterAliasable &ap) | |
AbstractParameterAliasable & | operator= (const AbstractParameterAliasable &ap) |
virtual | ~AbstractParameterAliasable () |
void | setNamespace (const std::string &prefix) |
Set the namespace for the parameter names. More... | |
bool | hasIndependentParameter (const std::string &name) const |
const ParameterList & | getIndependentParameters () const |
Get the minimal list of parameters to set the model. More... | |
size_t | getNumberOfIndependentParameters () const |
Get the number of independent parameters. More... | |
void | aliasParameters (const std::string &p1, const std::string &p2) |
alias the parameters. More... | |
void | unaliasParameters (const std::string &p1, const std::string &p2) |
Detach two parameters previously set as 'aliased'. More... | |
void | aliasParameters (std::map< std::string, std::string > &unparsedParams, bool verbose) |
alias the parameters following the links described in a map, and update the object accordingly. Cycles in aliasing are detected and forbidden. More... | |
ParameterList | getAliasedParameters (const ParameterList &pl) const |
Return the list of the names of the parameters that are aliased (directly or not) to one of the parameters of the list. More... | |
ParameterList | getFromParameters (const ParameterList &pl) const |
Return the list of the names of the parameters from which the parameters of the list are aliased (directly or not). More... | |
virtual std::vector< std::string > | getAlias (const std::string &name) const |
virtual std::map< std::string, std::string > | getAliases () const |
std::string | getFrom (const std::string &name) const |
bool | hasParameter (const std::string &name) const override |
Tell if there is a parameter with specified name. More... | |
const ParameterList & | getParameters () const override |
Get all parameters available. More... | |
const Parameter & | parameter (const std::string &name) const override |
Get the parameter with specified name. More... | |
const std::shared_ptr< Parameter > & | getParameter (const std::string &name) const |
double | getParameterValue (const std::string &name) const override |
Get the value for parameter of name 'name'. More... | |
void | setAllParametersValues (const ParameterList ¶meters) 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 ¶meters) override |
Update the parameters from parameters. More... | |
bool | matchParametersValues (const ParameterList ¶meters) 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... | |
std::string | getNamespace () const override |
std::string | getParameterNameWithoutNamespace (const std::string &name) const override |
Resolves a parameter name according to the current namespace. More... | |
virtual void | fireParameterChanged (const ParameterList ¶meters) |
Notify the class when one or several parameters have changed. More... | |
virtual Clonable * | clone () const =0 |
Create a copy of this object and send a pointer to it. More... | |
Protected Member Functions | |
void | addParameter_ (Parameter *parameter) |
void | addParameters_ (const ParameterList ¶meters) |
void | shareParameter_ (const std::shared_ptr< Parameter > ¶meter) |
void | shareParameters_ (const ParameterList ¶meters) |
void | includeParameters_ (const ParameterList ¶meters) |
void | deleteParameter_ (size_t index) |
void | deleteParameter_ (std::string &name) |
void | deleteParameters_ (const std::vector< std::string > &names) |
void | resetParameters_ () |
const std::shared_ptr< Parameter > & | getParameter (size_t i) const |
std::shared_ptr< Parameter > & | getParameter (size_t i) |
Parameter & | getParameter_ (const std::string &name) |
Parameter & | getParameter_ (size_t index) |
const Parameter & | getParameter_ (size_t index) const |
Parameter & | getParameterWithNamespace_ (const std::string &name) |
const Parameter & | getParameterWithNamespace_ (const std::string &name) const |
ParameterList & | getParameters_ () override |
Get all parameters available. More... | |
Private Attributes | |
ParameterList | independentParameters_ |
std::map< std::string, std::shared_ptr< AliasParameterListener > > | aliasListenersRegister_ |
A partial implementation of the Parametrizable interface.
Parameters are stored in a protected ParameterList object.
The abstract fireParameterChanged() method is provided so that the derived class know when a parameter has changed, and can be updated. All methods call the corresponding method in ParameterList and then call the fireParameterChanged() method.
Definition at line 104 of file AbstractParameterAliasable.h.
|
inline |
Definition at line 118 of file AbstractParameterAliasable.h.
References bpp::AliasParameterListener::operator=().
AbstractParameterAliasable::AbstractParameterAliasable | ( | const AbstractParameterAliasable & | ap | ) |
Definition at line 11 of file AbstractParameterAliasable.cpp.
References aliasListenersRegister_, bpp::AbstractParametrizable::getNumberOfParameters(), bpp::AbstractParametrizable::getParameter(), bpp::AbstractParametrizable::getParameterNameWithoutNamespace(), bpp::AbstractParametrizable::getParameters_(), independentParameters_, bpp::ParameterList::shareParameter(), and bpp::ParameterList::size().
|
inlinevirtual |
Definition at line 128 of file AbstractParameterAliasable.h.
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 196 of file AbstractParameterAliasable.h.
References bpp::AbstractParametrizable::addParameter_(), bpp::Parameter::getName(), and bpp::ParameterList::shareParameter().
Referenced by bpp::ParametrizableCollection< N >::addObject(), bpp::BetaDiscreteDistribution::BetaDiscreteDistribution(), bpp::ConstantDistribution::ConstantDistribution(), bpp::DirichletDiscreteDistribution::DirichletDiscreteDistribution(), bpp::ExponentialDiscreteDistribution::ExponentialDiscreteDistribution(), bpp::GammaDiscreteDistribution::GammaDiscreteDistribution(), bpp::GaussianDiscreteDistribution::GaussianDiscreteDistribution(), bpp::InvariantMixedDiscreteDistribution::InvariantMixedDiscreteDistribution(), bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(), bpp::SimpleDiscreteDistribution::SimpleDiscreteDistribution(), bpp::Simplex::Simplex(), and bpp::TruncatedExponentialDiscreteDistribution::TruncatedExponentialDiscreteDistribution().
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 202 of file AbstractParameterAliasable.h.
References bpp::AbstractParametrizable::addParameters_(), bpp::AliasParameterListener::getName(), bpp::ParameterList::shareParameter(), and bpp::ParameterList::size().
Referenced by bpp::InvariantMixedDiscreteDistribution::InvariantMixedDiscreteDistribution(), and bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions().
|
virtual |
alias the parameters.
p1 | name of the parameter to which the other parameter is aliased |
p2 | name of the aliased parameter, which will be deleted from independent parameters list |
Implements bpp::ParameterAliasable.
Definition at line 67 of file AbstractParameterAliasable.cpp.
References bpp::Parameter::addParameterListener(), aliasListenersRegister_, bpp::ParameterList::deleteParameter(), bpp::ApplicationTools::displayWarning(), bpp::Parameter::getConstraint(), bpp::AbstractParametrizable::getNamespace(), bpp::AbstractParametrizable::getNumberOfParameters(), bpp::AbstractParametrizable::getParameter_(), bpp::AbstractParametrizable::getParameters(), bpp::AbstractParametrizable::getParameters_(), bpp::Parameter::hasConstraint(), bpp::AbstractParametrizable::hasParameter(), bpp::ParameterList::hasParameter(), independentParameters_, bpp::Parameter::setConstraint(), bpp::ParameterList::shareParameters(), bpp::ParameterList::size(), and bpp::ParameterList::whichParameterHasName().
Referenced by bpp::ParametrizableCollection< N >::addObject(), and aliasParameters().
|
virtual |
alias the parameters following the links described in a map, and update the object accordingly. Cycles in aliasing are detected and forbidden.
unparsedParams | the map of the links : <A,B> matches for A->B aliasing. |
verbose | verbosity |
Implements bpp::ParameterAliasable.
Definition at line 120 of file AbstractParameterAliasable.cpp.
References bpp::ParameterList::addParameter(), aliasParameters(), bpp::ParameterList::clone(), bpp::Parameter::clone(), bpp::ApplicationTools::displayResult(), bpp::AbstractParametrizable::getParameters(), bpp::Parameter::getValue(), bpp::ParameterList::hasParameter(), bpp::AbstractParametrizable::matchParametersValues(), bpp::ParameterList::parameter(), bpp::ParameterList::size(), and bpp::TextTools::toString().
|
pure virtualinherited |
Create a copy of this object and send a pointer to it.
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().
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 237 of file AbstractParameterAliasable.h.
References bpp::ParameterList::deleteParameter(), bpp::AbstractParametrizable::deleteParameter_(), and bpp::ParameterList::hasParameter().
Referenced by bpp::ParametrizableCollection< N >::removeObject().
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 245 of file AbstractParameterAliasable.h.
References bpp::ParameterList::deleteParameter(), bpp::AbstractParametrizable::deleteParameter_(), and bpp::ParameterList::hasParameter().
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 252 of file AbstractParameterAliasable.h.
|
inlinevirtualinherited |
Notify the class when one or several parameters have changed.
parameters | A ParameterList object with parameters that changed. |
Reimplemented in bpp::TestFunction, bpp::OrderedSimplex, bpp::LogsumHmmLikelihood, bpp::RescaledHmmLikelihood, bpp::LowMemoryRescaledHmmLikelihood, bpp::Simplex, bpp::ParametrizableCollection< N >, bpp::ReparametrizationFunctionWrapper, bpp::MixtureOfDiscreteDistributions, bpp::SimpleDiscreteDistribution, bpp::DirichletDiscreteDistribution, bpp::FullHmmTransitionMatrix, bpp::TruncatedExponentialDiscreteDistribution, bpp::AutoCorrelationTransitionMatrix, bpp::GammaDiscreteDistribution, bpp::InvariantMixedDiscreteDistribution, bpp::BetaDiscreteDistribution, bpp::ExponentialDiscreteDistribution, bpp::GaussianDiscreteDistribution, bpp::UniformDiscreteDistribution, and bpp::ConstantDistribution.
Definition at line 108 of file AbstractParametrizable.h.
Referenced by bpp::ConstantDistribution::fireParameterChanged(), bpp::GaussianDiscreteDistribution::fireParameterChanged(), bpp::BetaDiscreteDistribution::fireParameterChanged(), bpp::ExponentialDiscreteDistribution::fireParameterChanged(), bpp::InvariantMixedDiscreteDistribution::fireParameterChanged(), bpp::GammaDiscreteDistribution::fireParameterChanged(), bpp::TruncatedExponentialDiscreteDistribution::fireParameterChanged(), bpp::DirichletDiscreteDistribution::fireParameterChanged(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::MixtureOfDiscreteDistributions::fireParameterChanged(), bpp::AbstractParametrizable::matchParametersValues(), bpp::AbstractParametrizable::setAllParametersValues(), bpp::AbstractParametrizable::setParametersValues(), and bpp::AbstractParametrizable::setParameterValue().
|
virtual |
name | The name of the parameter to look for. |
Implements bpp::ParameterAliasable.
Definition at line 204 of file AbstractParameterAliasable.cpp.
References aliasListenersRegister_, and bpp::VectorTools::append().
Referenced by getAliases(), and bpp::ParametrizableCollection< N >::removeObject().
ParameterList AbstractParameterAliasable::getAliasedParameters | ( | const ParameterList & | pl | ) | const |
Return the list of the names of the parameters that are aliased (directly or not) to one of the parameters of the list.
Definition at line 244 of file AbstractParameterAliasable.cpp.
References bpp::ParameterList::addParameter(), aliasListenersRegister_, bpp::ParameterList::hasParameter(), and bpp::AbstractParametrizable::parameter().
|
virtual |
Implements bpp::ParameterAliasable.
Definition at line 225 of file AbstractParameterAliasable.cpp.
References aliasListenersRegister_, and getAlias().
string AbstractParameterAliasable::getFrom | ( | const std::string & | name | ) | const |
name | The name of the parameter to look for. |
Definition at line 280 of file AbstractParameterAliasable.cpp.
References aliasListenersRegister_.
ParameterList AbstractParameterAliasable::getFromParameters | ( | const ParameterList & | pl | ) | const |
Return the list of the names of the parameters from which the parameters of the list are aliased (directly or not).
Definition at line 297 of file AbstractParameterAliasable.cpp.
References bpp::ParameterList::addParameter(), aliasListenersRegister_, bpp::ParameterList::hasParameter(), and bpp::AbstractParametrizable::parameter().
|
inlinevirtual |
Get the minimal list of parameters to set the model.
If no parameters are aliased, this is the same a getParameters().
Implements bpp::ParameterAliasable.
Definition at line 135 of file AbstractParameterAliasable.h.
|
inlineoverridevirtualinherited |
Implements bpp::Parametrizable.
Definition at line 99 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::getParameterNameWithoutNamespace(), and bpp::AbstractParametrizable::prefix_.
Referenced by aliasParameters(), bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(), bpp::Simplex::setFrequencies(), and setNamespace().
|
inlinevirtual |
Get the number of independent parameters.
Implements bpp::ParameterAliasable.
Definition at line 137 of file AbstractParameterAliasable.h.
References bpp::AliasParameterListener::getAlias(), bpp::AliasParameterListener::getFrom(), and bpp::ParameterList::size().
|
inlineoverridevirtualinherited |
Get the number of parameters.
Implements bpp::Parametrizable.
Definition at line 95 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::setNamespace(), and bpp::ParameterList::size().
Referenced by AbstractParameterAliasable(), aliasParameters(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), operator=(), bpp::ConstantDistribution::restrictToConstraint(), and bpp::SimpleDiscreteDistribution::restrictToConstraint().
|
inlineinherited |
Definition at line 48 of file AbstractParametrizable.h.
References bpp::ParameterList::getParameter().
Referenced by AbstractParameterAliasable(), operator=(), and unaliasParameters().
|
inlineprotectedinherited |
Definition at line 211 of file AbstractParametrizable.h.
References bpp::ParameterList::getParameter().
|
inlineprotectedinherited |
Definition at line 216 of file AbstractParametrizable.h.
References bpp::ParameterList::getParameter().
|
inlineprotectedinherited |
name | The name of the parameter. |
ParameterNotFoundException | If no parameter with that name is found in the list. |
Definition at line 164 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::hasParameter(), and bpp::ParameterList::parameter().
Referenced by aliasParameters(), bpp::AbstractParametrizable::getParameterWithNamespace_(), bpp::AbstractParametrizable::removeConstraint(), bpp::ConstantDistribution::restrictToConstraint(), bpp::TruncatedExponentialDiscreteDistribution::restrictToConstraint(), bpp::InvariantMixedDiscreteDistribution::restrictToConstraint(), bpp::SimpleDiscreteDistribution::restrictToConstraint(), bpp::AbstractParametrizable::setConstraint(), and unaliasParameters().
|
inlineprotectedinherited |
Definition at line 190 of file AbstractParametrizable.h.
References bpp::ParameterList::size().
|
inlineprotectedinherited |
Definition at line 197 of file AbstractParametrizable.h.
References bpp::ParameterList::size().
|
overridevirtualinherited |
Resolves a parameter name according to the current namespace.
Implements bpp::Parametrizable.
Definition at line 28 of file AbstractParametrizable.cpp.
References bpp::TextTools::startsWith().
Referenced by AbstractParameterAliasable(), bpp::AbstractParametrizable::getNamespace(), and operator=().
|
inlineoverridevirtualinherited |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 41 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_.
Referenced by aliasParameters(), bpp::FullHmmTransitionMatrix::FullHmmTransitionMatrix(), bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(), and bpp::ParametrizableCollection< N >::removeObject().
|
inlineoverrideprotectedvirtualinherited |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 205 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_.
Referenced by AbstractParameterAliasable(), aliasParameters(), and operator=().
|
inlineoverridevirtualinherited |
Get the value for parameter of name 'name'.
name | The name of the parameter. |
Implements bpp::Parametrizable.
Definition at line 53 of file AbstractParametrizable.h.
References bpp::Parameter::getValue(), and bpp::AbstractParametrizable::parameter().
Referenced by bpp::DirichletDiscreteDistribution::applyParameters(), bpp::ConstantDistribution::fireParameterChanged(), bpp::GaussianDiscreteDistribution::fireParameterChanged(), bpp::BetaDiscreteDistribution::fireParameterChanged(), bpp::ExponentialDiscreteDistribution::fireParameterChanged(), bpp::InvariantMixedDiscreteDistribution::fireParameterChanged(), bpp::GammaDiscreteDistribution::fireParameterChanged(), bpp::AutoCorrelationTransitionMatrix::fireParameterChanged(), bpp::TruncatedExponentialDiscreteDistribution::fireParameterChanged(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::MixtureOfDiscreteDistributions::fireParameterChanged(), bpp::Simplex::fireParameterChanged(), bpp::ExponentialDiscreteDistribution::randC(), bpp::BetaDiscreteDistribution::randC(), bpp::GammaDiscreteDistribution::randC(), bpp::TruncatedExponentialDiscreteDistribution::randC(), and bpp::ConstantDistribution::restrictToConstraint().
|
inlineprotectedinherited |
name | The name of the parameter, including its namespace. |
ParameterNotFoundException | If no parameter with that name is found in the list. |
Definition at line 176 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::getParameter_().
|
inlineprotectedinherited |
name | The name of the parameter, including its namespace. |
ParameterNotFoundException | If no parameter with that name is found in the list. |
Definition at line 185 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameter().
|
inline |
Definition at line 133 of file AbstractParameterAliasable.h.
References bpp::ParameterList::hasParameter().
|
inlineoverridevirtualinherited |
Tell if there is a parameter with specified name.
name | The name of the parameter to look for. |
Implements bpp::Parametrizable.
Definition at line 39 of file AbstractParametrizable.h.
References bpp::ParameterList::hasParameter().
Referenced by aliasParameters(), bpp::GammaDiscreteDistribution::fireParameterChanged(), bpp::AbstractParametrizable::getParameter_(), and unaliasParameters().
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 227 of file AbstractParameterAliasable.h.
References bpp::AliasParameterListener::getName(), bpp::AbstractParametrizable::includeParameters_(), bpp::ParameterList::shareParameter(), and bpp::ParameterList::size().
|
inlineoverridevirtualinherited |
Update the parameters from parameters.
Only common parameters with parameters will be updated.
parameters | A list of parameters. |
ConstraintException | If a value in parameters does not match the constraint in the corresponding parameter in the list. |
Implements bpp::Parametrizable.
Definition at line 76 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), bpp::ParameterList::matchParametersValues(), and bpp::ParameterList::shareSubList().
Referenced by aliasParameters(), bpp::Simplex::setFrequencies(), bpp::ReparametrizationFunctionWrapper::setParameters(), and bpp::FullHmmTransitionMatrix::setTransitionProbabilities().
AbstractParameterAliasable & AbstractParameterAliasable::operator= | ( | const AbstractParameterAliasable & | ap | ) |
Definition at line 39 of file AbstractParameterAliasable.cpp.
References aliasListenersRegister_, bpp::AbstractParametrizable::getNumberOfParameters(), bpp::AbstractParametrizable::getParameter(), bpp::AbstractParametrizable::getParameterNameWithoutNamespace(), bpp::AbstractParametrizable::getParameters_(), independentParameters_, bpp::ParameterList::shareParameter(), and bpp::ParameterList::size().
Referenced by bpp::ParametrizableCollection< N >::operator=(), and bpp::AbstractDiscreteDistribution::operator=().
|
inlineoverridevirtualinherited |
Get the parameter with specified name.
name | The name of the parameter to look for. |
ParameterNotFoundException | if no parameter with this name is found. |
Implements bpp::Parametrizable.
Definition at line 43 of file AbstractParametrizable.h.
References bpp::ParameterList::parameter().
Referenced by getAliasedParameters(), bpp::ReparametrizationDerivableFirstOrderWrapper::getFirstOrderDerivative(), getFromParameters(), bpp::AbstractParametrizable::getParameterValue(), bpp::AbstractParametrizable::getParameterWithNamespace_(), and bpp::ReparametrizationDerivableSecondOrderWrapper::getSecondOrderDerivative().
|
inlineoverridevirtualinherited |
Remove the constraint associated with one parameter, if any.
name | The name of the parameter to look for. |
ParameterNotFoundException | if no parameter with this name is found. |
Implements bpp::Parametrizable.
Definition at line 85 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::getParameter_(), and bpp::Parameter::removeConstraint().
|
inlineprotected |
Definition at line 262 of file AbstractParameterAliasable.h.
References bpp::ParameterList::reset(), and bpp::AbstractParametrizable::resetParameters_().
Referenced by bpp::ParametrizableCollection< N >::clear().
|
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 | A list with all parameters. |
ParameterNotFoundException | If a some parameter in the list is not in params. |
ConstraintException | If a value in parameters does not match the constraint in the corresponding parameter in the list. |
Implements bpp::Parametrizable.
Definition at line 58 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), and bpp::ParameterList::setAllParametersValues().
|
inlineoverridevirtualinherited |
Set/Change the constraint associated with one parameter.
name | The name of the parameter to look for. |
constraint | A pointer to the constraint (may be null) |
ParameterNotFoundException | if no parameter with this name is found. |
Implements bpp::Parametrizable.
Definition at line 90 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::getParameter_(), and bpp::Parameter::setConstraint().
Referenced by bpp::SimpleDiscreteDistribution::restrictToConstraint().
|
virtual |
Set the namespace for the parameter names.
prefix | The '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.
Reimplemented in bpp::MixtureOfDiscreteDistributions, and bpp::InvariantMixedDiscreteDistribution.
Definition at line 186 of file AbstractParameterAliasable.cpp.
References aliasListenersRegister_, bpp::AbstractParametrizable::getNamespace(), bpp::AbstractParametrizable::setNamespace(), and bpp::TextTools::startsWith().
Referenced by bpp::InvariantMixedDiscreteDistribution::setNamespace(), and bpp::MixtureOfDiscreteDistributions::setNamespace().
|
inlineoverridevirtualinherited |
Update the parameters from parameters.
parameters must be a subset of all parameters available.
parameters | A list containing all parameters to update. |
ParameterNotFoundException | If a some parameter in params is not in the list. |
ConstraintException | If a value in parameters does not match the constraint in the corresponding parameter in the list. |
Implements bpp::Parametrizable.
Definition at line 70 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), and bpp::ParameterList::setParametersValues().
Referenced by bpp::LowMemoryRescaledHmmLikelihood::setParameters(), bpp::LogsumHmmLikelihood::setParameters(), and bpp::RescaledHmmLikelihood::setParameters().
|
inlineoverridevirtualinherited |
Set the value of parameter with name name to be equal to value.
name | the name of the parameter to set. |
value | The value of the parameter. |
ParameterNotFoundException | If no parameter in the list has the name name. |
ConstraintException | If value does not match the constraint associated to parameter name. |
Implements bpp::Parametrizable.
Definition at line 64 of file AbstractParametrizable.h.
References bpp::ParameterList::createSubList(), bpp::AbstractParametrizable::fireParameterChanged(), and bpp::ParameterList::setParameterValue().
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 212 of file AbstractParameterAliasable.h.
References bpp::ParameterList::shareParameter(), and bpp::AbstractParametrizable::shareParameter_().
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 218 of file AbstractParameterAliasable.h.
References bpp::AliasParameterListener::getName(), bpp::ParameterList::shareParameter(), bpp::AbstractParametrizable::shareParameters_(), and bpp::ParameterList::size().
|
virtual |
Detach two parameters previously set as 'aliased'.
The values of the two parameters will now be independent.
p1 | Original parameter. |
p2 | Aliased parameter. |
ParameterNotFoundException | if p1 or p2 do not correspond to existing parameters. |
Exception | when trying to perform non-valid dissociation. |
Implements bpp::ParameterAliasable.
Definition at line 168 of file AbstractParameterAliasable.cpp.
References aliasListenersRegister_, bpp::AbstractParametrizable::getParameter(), bpp::AbstractParametrizable::getParameter_(), bpp::AbstractParametrizable::hasParameter(), independentParameters_, bpp::Parameter::removeParameterListener(), and bpp::ParameterList::shareParameter().
Referenced by bpp::ParametrizableCollection< N >::removeObject().
|
private |
Contains all parameter listeners for maintening alias relationships. The registry will be updated appropriately upon cloning and deleting.
Definition at line 115 of file AbstractParameterAliasable.h.
Referenced by AbstractParameterAliasable(), aliasParameters(), getAlias(), getAliasedParameters(), getAliases(), getFrom(), getFromParameters(), operator=(), setNamespace(), and unaliasParameters().
|
mutableprivate |
Definition at line 109 of file AbstractParameterAliasable.h.
Referenced by AbstractParameterAliasable(), aliasParameters(), operator=(), and unaliasParameters().