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 |
Tell if there is a parameter with specified name. More... | |
const ParameterList & | getParameters () const |
Get all parameters available. More... | |
const Parameter & | getParameter (const std::string &name) const |
Get the parameter with specified name. More... | |
const std::shared_ptr< Parameter > & | getSharedParameter (const std::string &name) const |
double | getParameterValue (const std::string &name) const |
Get the value for parameter of name 'name'. More... | |
void | setAllParametersValues (const ParameterList ¶meters) |
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 ¶meters) |
Update the parameters from parameters. More... | |
bool | matchParametersValues (const ParameterList ¶meters) |
Update the parameters from parameters. More... | |
size_t | getNumberOfParameters () const |
Get the number of parameters. More... | |
std::string | getNamespace () const |
std::string | getParameterNameWithoutNamespace (const std::string &name) const |
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 > & | getSharedParameter (size_t i) const |
std::shared_ptr< Parameter > & | getSharedParameter (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_ () |
Get all parameters available. More... | |
Private Attributes | |
ParameterList | independentParameters_ |
std::map< std::string, AliasParameterListener * > | aliasListenersRegister_ |
ParameterList | parameters_ |
std::string | prefix_ |
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 140 of file AbstractParameterAliasable.h.
|
inline |
Definition at line 154 of file AbstractParameterAliasable.h.
AbstractParameterAliasable::AbstractParameterAliasable | ( | const AbstractParameterAliasable & | ap | ) |
Definition at line 48 of file AbstractParameterAliasable.cpp.
References aliasListenersRegister_, bpp::AliasParameterListener::clone(), bpp::AbstractParametrizable::getNumberOfParameters(), bpp::AbstractParametrizable::getParameterNameWithoutNamespace(), bpp::AbstractParametrizable::getParameters_(), bpp::AbstractParametrizable::getSharedParameter(), independentParameters_, bpp::AliasParameterListener::setParameterList(), bpp::ParameterList::shareParameter(), and bpp::ParameterList::size().
|
virtual |
Definition at line 108 of file AbstractParameterAliasable.cpp.
References aliasListenersRegister_.
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 244 of file AbstractParameterAliasable.h.
References bpp::AbstractParametrizable::addParameter_(), bpp::Parameter::getName(), bpp::AbstractParametrizable::getParameterNameWithoutNamespace(), bpp::AbstractParametrizable::getSharedParameter(), independentParameters_, 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 250 of file AbstractParameterAliasable.h.
References bpp::AbstractParametrizable::addParameters_(), bpp::AbstractParametrizable::getParameterNameWithoutNamespace(), bpp::AbstractParametrizable::getSharedParameter(), independentParameters_, 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 119 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(), and bpp::ParameterList::size().
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 173 of file AbstractParameterAliasable.cpp.
References bpp::ParameterList::addParameter(), aliasParameters(), bpp::Parameter::clone(), bpp::Clonable::clone(), bpp::ApplicationTools::displayResult(), bpp::ParameterList::getParameter(), bpp::AbstractParametrizable::getParameters(), bpp::Parameter::getValue(), bpp::ParameterList::hasParameter(), bpp::AbstractParametrizable::matchParametersValues(), bpp::ParameterList::size(), and bpp::TextTools::toString().
|
pure virtualinherited |
Create a copy of this object and send a pointer to it.
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 aliasParameters(), bpp::LogsumHmmLikelihood::LogsumHmmLikelihood(), and bpp::LogsumHmmLikelihood::operator=().
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 285 of file AbstractParameterAliasable.h.
References bpp::ParameterList::deleteParameter(), bpp::AbstractParametrizable::deleteParameter_(), bpp::Parameter::getName(), bpp::AbstractParametrizable::getParameter_(), bpp::ParameterList::hasParameter(), and independentParameters_.
Referenced by deleteParameters_(), and bpp::ParametrizableCollection< N >::removeObject().
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 293 of file AbstractParameterAliasable.h.
References bpp::ParameterList::deleteParameter(), bpp::AbstractParametrizable::deleteParameter_(), bpp::ParameterList::hasParameter(), and independentParameters_.
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 300 of file AbstractParameterAliasable.h.
References deleteParameter_().
|
inlinevirtualinherited |
Notify the class when one or several parameters have changed.
parameters | A ParameterList object with parameters that changed. |
Reimplemented in bpp::RescaledHmmLikelihood, bpp::LowMemoryRescaledHmmLikelihood, bpp::LogsumHmmLikelihood, 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::FullHmmTransitionMatrix, bpp::AutoCorrelationTransitionMatrix, bpp::ReparametrizationFunctionWrapper, and bpp::TestFunction.
Definition at line 134 of file AbstractParametrizable.h.
Referenced by bpp::BetaDiscreteDistribution::fireParameterChanged(), bpp::ConstantDistribution::fireParameterChanged(), bpp::DirichletDiscreteDistribution::fireParameterChanged(), bpp::ExponentialDiscreteDistribution::fireParameterChanged(), bpp::GammaDiscreteDistribution::fireParameterChanged(), bpp::GaussianDiscreteDistribution::fireParameterChanged(), bpp::InvariantMixedDiscreteDistribution::fireParameterChanged(), bpp::MixtureOfDiscreteDistributions::fireParameterChanged(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::TruncatedExponentialDiscreteDistribution::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 260 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 304 of file AbstractParameterAliasable.cpp.
References bpp::ParameterList::addParameter(), aliasListenersRegister_, bpp::AbstractParametrizable::getParameter(), and bpp::ParameterList::hasParameter().
|
virtual |
Implements bpp::ParameterAliasable.
Definition at line 283 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 344 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 363 of file AbstractParameterAliasable.cpp.
References bpp::ParameterList::addParameter(), aliasListenersRegister_, bpp::AbstractParametrizable::getParameter(), and bpp::ParameterList::hasParameter().
|
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 171 of file AbstractParameterAliasable.h.
References independentParameters_.
|
inlinevirtualinherited |
Implements bpp::Parametrizable.
Definition at line 125 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::prefix_.
Referenced by aliasParameters(), hasIndependentParameter(), bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(), bpp::Simplex::setFrequencies(), setNamespace(), and bpp::BppODiscreteDistributionFormat::writeDiscreteDistribution().
|
inlinevirtual |
Get the number of independent parameters.
Implements bpp::ParameterAliasable.
Definition at line 173 of file AbstractParameterAliasable.h.
References independentParameters_, and bpp::ParameterList::size().
|
inlinevirtualinherited |
Get the number of parameters.
Implements bpp::Parametrizable.
Definition at line 121 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::size().
Referenced by AbstractParameterAliasable(), aliasParameters(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), operator=(), bpp::ConstantDistribution::restrictToConstraint(), and bpp::SimpleDiscreteDistribution::restrictToConstraint().
|
inlinevirtualinherited |
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 79 of file AbstractParametrizable.h.
References bpp::ParameterList::getParameter(), bpp::AbstractParametrizable::parameters_, and bpp::AbstractParametrizable::prefix_.
Referenced by getAliasedParameters(), bpp::ReparametrizationDerivableFirstOrderWrapper::getFirstOrderDerivative(), getFromParameters(), bpp::AbstractParametrizable::getParameterValue(), bpp::AbstractParametrizable::getParameterWithNamespace_(), bpp::ReparametrizationDerivableSecondOrderWrapper::getSecondOrderDerivative(), and bpp::TestFunction::getValue().
|
inlineprotectedinherited |
name | The name of the parameter. |
ParameterNotFoundException | If no parameter with that name is found in the list. |
Definition at line 190 of file AbstractParametrizable.h.
References bpp::ParameterList::getParameter(), bpp::AbstractParametrizable::hasParameter(), bpp::AbstractParametrizable::parameters_, and bpp::AbstractParametrizable::prefix_.
Referenced by aliasParameters(), deleteParameter_(), bpp::AbstractParametrizable::getParameterWithNamespace_(), bpp::ConstantDistribution::restrictToConstraint(), bpp::InvariantMixedDiscreteDistribution::restrictToConstraint(), bpp::SimpleDiscreteDistribution::restrictToConstraint(), bpp::TruncatedExponentialDiscreteDistribution::restrictToConstraint(), and unaliasParameters().
|
inlineprotectedinherited |
Definition at line 216 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::size().
|
inlineprotectedinherited |
Definition at line 223 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::size().
|
virtualinherited |
Resolves a parameter name according to the current namespace.
Implements bpp::Parametrizable.
Definition at line 65 of file AbstractParametrizable.cpp.
References bpp::TextTools::startsWith().
Referenced by AbstractParameterAliasable(), addParameter_(), addParameters_(), includeParameters_(), operator=(), and shareParameters_().
|
inlinevirtualinherited |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 77 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_.
Referenced by aliasParameters(), bpp::FullHmmTransitionMatrix::FullHmmTransitionMatrix(), bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(), and bpp::ParametrizableCollection< N >::removeObject().
|
inlineprotectedvirtualinherited |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 231 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_.
Referenced by AbstractParameterAliasable(), aliasParameters(), and operator=().
|
inlinevirtualinherited |
Get the value for parameter of name 'name'.
name | The name of the parameter. |
Implements bpp::Parametrizable.
Definition at line 89 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::getParameter(), and bpp::Parameter::getValue().
Referenced by bpp::DirichletDiscreteDistribution::applyParameters(), bpp::AutoCorrelationTransitionMatrix::fireParameterChanged(), bpp::BetaDiscreteDistribution::fireParameterChanged(), bpp::ConstantDistribution::fireParameterChanged(), bpp::ExponentialDiscreteDistribution::fireParameterChanged(), bpp::GammaDiscreteDistribution::fireParameterChanged(), bpp::GaussianDiscreteDistribution::fireParameterChanged(), bpp::InvariantMixedDiscreteDistribution::fireParameterChanged(), bpp::MixtureOfDiscreteDistributions::fireParameterChanged(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::Simplex::fireParameterChanged(), bpp::TruncatedExponentialDiscreteDistribution::fireParameterChanged(), bpp::BetaDiscreteDistribution::randC(), bpp::ExponentialDiscreteDistribution::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 202 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 211 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::getParameter().
|
inlineinherited |
Definition at line 84 of file AbstractParametrizable.h.
References bpp::ParameterList::getSharedParameter(), bpp::AbstractParametrizable::parameters_, and bpp::AbstractParametrizable::prefix_.
Referenced by AbstractParameterAliasable(), addParameter_(), addParameters_(), includeParameters_(), operator=(), shareParameters_(), and unaliasParameters().
|
inlineprotectedinherited |
Definition at line 242 of file AbstractParametrizable.h.
References bpp::ParameterList::getSharedParameter(), and bpp::AbstractParametrizable::parameters_.
|
inlineprotectedinherited |
Definition at line 237 of file AbstractParametrizable.h.
References bpp::ParameterList::getSharedParameter(), and bpp::AbstractParametrizable::parameters_.
|
inline |
Definition at line 169 of file AbstractParameterAliasable.h.
References bpp::AbstractParametrizable::getNamespace(), bpp::ParameterList::hasParameter(), and independentParameters_.
|
inlinevirtualinherited |
Tell if there is a parameter with specified name.
name | The name of the parameter to look for. |
Implements bpp::Parametrizable.
Definition at line 75 of file AbstractParametrizable.h.
References bpp::ParameterList::hasParameter(), bpp::AbstractParametrizable::parameters_, and bpp::AbstractParametrizable::prefix_.
Referenced by aliasParameters(), bpp::GammaDiscreteDistribution::fireParameterChanged(), bpp::AbstractParametrizable::getParameter_(), and unaliasParameters().
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 275 of file AbstractParameterAliasable.h.
References bpp::AbstractParametrizable::getParameterNameWithoutNamespace(), bpp::AbstractParametrizable::getSharedParameter(), bpp::AbstractParametrizable::includeParameters_(), independentParameters_, bpp::ParameterList::shareParameter(), and bpp::ParameterList::size().
|
inlinevirtualinherited |
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 112 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), bpp::ParameterList::matchParametersValues(), bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::shareSubList().
Referenced by aliasParameters(), bpp::Simplex::setFrequencies(), bpp::TestFunction::setParameters(), bpp::ReparametrizationFunctionWrapper::setParameters(), and bpp::FullHmmTransitionMatrix::setTransitionProbabilities().
AbstractParameterAliasable & AbstractParameterAliasable::operator= | ( | const AbstractParameterAliasable & | ap | ) |
Definition at line 78 of file AbstractParameterAliasable.cpp.
References aliasListenersRegister_, bpp::AliasParameterListener::clone(), bpp::AbstractParametrizable::getNumberOfParameters(), bpp::AbstractParametrizable::getParameterNameWithoutNamespace(), bpp::AbstractParametrizable::getParameters_(), bpp::AbstractParametrizable::getSharedParameter(), independentParameters_, bpp::AliasParameterListener::setParameterList(), bpp::ParameterList::shareParameter(), and bpp::ParameterList::size().
Referenced by bpp::AbstractDiscreteDistribution::operator=(), and bpp::ParametrizableCollection< N >::operator=().
|
inlineprotected |
Definition at line 310 of file AbstractParameterAliasable.h.
References independentParameters_, bpp::ParameterList::reset(), and bpp::AbstractParametrizable::resetParameters_().
Referenced by bpp::ParametrizableCollection< N >::clear().
|
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 | 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 94 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::setAllParametersValues().
|
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 240 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().
|
inlinevirtualinherited |
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 106 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::setParametersValues().
Referenced by bpp::LogsumHmmLikelihood::setParameters(), bpp::LowMemoryRescaledHmmLikelihood::setParameters(), and bpp::RescaledHmmLikelihood::setParameters().
|
inlinevirtualinherited |
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 100 of file AbstractParametrizable.h.
References bpp::ParameterList::createSubList(), bpp::AbstractParametrizable::fireParameterChanged(), bpp::AbstractParametrizable::parameters_, bpp::AbstractParametrizable::prefix_, and bpp::ParameterList::setParameterValue().
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 260 of file AbstractParameterAliasable.h.
References independentParameters_, bpp::ParameterList::shareParameter(), and bpp::AbstractParametrizable::shareParameter_().
|
inlineprotectedvirtual |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 266 of file AbstractParameterAliasable.h.
References bpp::AbstractParametrizable::getParameterNameWithoutNamespace(), bpp::AbstractParametrizable::getSharedParameter(), independentParameters_, 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 221 of file AbstractParameterAliasable.cpp.
References aliasListenersRegister_, bpp::AbstractParametrizable::getParameter_(), bpp::AbstractParametrizable::getSharedParameter(), 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 151 of file AbstractParameterAliasable.h.
Referenced by AbstractParameterAliasable(), aliasParameters(), getAlias(), getAliasedParameters(), getAliases(), getFrom(), getFromParameters(), operator=(), setNamespace(), unaliasParameters(), and ~AbstractParameterAliasable().
|
mutableprivate |
Definition at line 145 of file AbstractParameterAliasable.h.
Referenced by AbstractParameterAliasable(), addParameter_(), addParameters_(), aliasParameters(), deleteParameter_(), getIndependentParameters(), getNumberOfIndependentParameters(), hasIndependentParameter(), includeParameters_(), operator=(), resetParameters_(), shareParameter_(), shareParameters_(), and unaliasParameters().
|
privateinherited |
Definition at line 66 of file AbstractParametrizable.h.
Referenced by bpp::AbstractParametrizable::addParameter_(), bpp::AbstractParametrizable::addParameters_(), bpp::AbstractParametrizable::deleteParameter_(), bpp::AbstractParametrizable::deleteParameters_(), bpp::AbstractParametrizable::getNumberOfParameters(), bpp::AbstractParametrizable::getParameter(), bpp::AbstractParametrizable::getParameter_(), bpp::AbstractParametrizable::getParameters(), bpp::AbstractParametrizable::getParameters_(), bpp::AbstractParametrizable::getSharedParameter(), bpp::AbstractParametrizable::hasParameter(), bpp::AbstractParametrizable::includeParameters_(), bpp::AbstractParametrizable::matchParametersValues(), bpp::AbstractParametrizable::resetParameters_(), bpp::AbstractParametrizable::setAllParametersValues(), bpp::AbstractParametrizable::setParametersValues(), bpp::AbstractParametrizable::setParameterValue(), bpp::AbstractParametrizable::shareParameter_(), and bpp::AbstractParametrizable::shareParameters_().
|
privateinherited |
Definition at line 67 of file AbstractParametrizable.h.
Referenced by bpp::AbstractParametrizable::getNamespace(), bpp::AbstractParametrizable::getParameter(), bpp::AbstractParametrizable::getParameter_(), bpp::AbstractParametrizable::getSharedParameter(), bpp::AbstractParametrizable::hasParameter(), and bpp::AbstractParametrizable::setParameterValue().