bpp-core3
3.0.0
|
Plain collection of parametrizable objects. More...
#include <Bpp/Numeric/ParametrizableCollection.h>
Public Member Functions | |
ParametrizableCollection () | |
Create an empty object set. More... | |
ParametrizableCollection (const ParametrizableCollection< N > &set) | |
ParametrizableCollection< N > & | operator= (const ParametrizableCollection< N > &set) |
void | clear () |
Resets all the information contained in this object. More... | |
~ParametrizableCollection () | |
ParametrizableCollection< N > * | clone () const |
Create a copy of this object and send a pointer to it. More... | |
void | fireParameterChanged (const ParameterList ¶meters) |
std::vector< size_t > | hasChanged () const |
void | clearChanged () |
size_t | getNumberOfObjects () const |
bool | hasObject (size_t objectIndex) const |
Says if there is a object with a given index. More... | |
bool | hasObject (std::shared_ptr< N > object) const |
Says if there is an object in the map. More... | |
size_t | getFirstKey (std::shared_ptr< N > object) const |
Return the first key mapping an object in the map. More... | |
const std::vector< size_t > | keys () const |
Returns the keys of the set. More... | |
std::shared_ptr< const N > | operator[] (size_t objectIndex) const |
Get one object from the set knowing its index. More... | |
std::shared_ptr< N > | operator[] (size_t objectIndex) |
ParameterList | getParametersForObject (size_t objectIndex) const |
Get the paramters of the Collection corresponding to an object from the set knowing its index. More... | |
void | addObject (std::shared_ptr< N > object, size_t objectIndex) |
Add a new object to the set with a given number. More... | |
std::shared_ptr< N > | removeObject (size_t objectIndex) |
Remove a object from the set, and all corresponding parameters. More... | |
std::shared_ptr< N > | replaceObject (std::shared_ptr< N > object, size_t objectIndex) |
Replace a object in the set, and returns the replaced one. More... | |
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 | 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... | |
void | unaliasParameters (const std::string &p1, const std::string &p2) |
Detach two parameters previously set as 'aliased'. 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... | |
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... | |
Protected Attributes | |
std::map< size_t, std::shared_ptr< N > > | objectsSet_ |
Contains all objects used. More... | |
std::vector< size_t > | vChanged_ |
A vector of the numbers of objects that have changed during the last fireParameterChanged. More... | |
Plain collection of parametrizable objects.
The collection is a map from unsigned integers to Parametrizables.
The access to the parameters of the objects will be done through this collection.
Definition at line 29 of file ParametrizableCollection.h.
|
inline |
Create an empty object set.
Definition at line 53 of file ParametrizableCollection.h.
|
inline |
Definition at line 59 of file ParametrizableCollection.h.
|
inline |
Definition at line 101 of file ParametrizableCollection.h.
References bpp::ParametrizableCollection< N >::clear().
|
inline |
Add a new object to the set with a given number.
Exception | if the number is already used. See replace function instead. |
object | A pointer toward an object, that will added to the set. |
WARNING! The set will now be the owner of the pointer, and will destroy it if needed! Copy the object first if you don't want it to be lost!
objectIndex | The number of the object in the Collection |
Definition at line 284 of file ParametrizableCollection.h.
References bpp::AbstractParameterAliasable::addParameter_(), bpp::AbstractParameterAliasable::aliasParameters(), bpp::ParameterAliasable::getAlias(), bpp::Parameter::setName(), and bpp::TextTools::toString().
Referenced by bpp::ParametrizableCollection< N >::replaceObject().
|
inlineprotectedvirtualinherited |
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().
|
inlineprotectedvirtualinherited |
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().
|
virtualinherited |
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(), bpp::AbstractParameterAliasable::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(), bpp::AbstractParameterAliasable::independentParameters_, bpp::Parameter::setConstraint(), bpp::ParameterList::shareParameters(), bpp::ParameterList::size(), and bpp::ParameterList::whichParameterHasName().
Referenced by bpp::ParametrizableCollection< N >::addObject(), and bpp::AbstractParameterAliasable::aliasParameters().
|
virtualinherited |
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(), bpp::AbstractParameterAliasable::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().
|
inline |
Resets all the information contained in this object.
Definition at line 93 of file ParametrizableCollection.h.
References bpp::AbstractParameterAliasable::resetParameters_().
Referenced by bpp::ParametrizableCollection< N >::operator=(), and bpp::ParametrizableCollection< N >::~ParametrizableCollection().
|
inline |
Definition at line 147 of file ParametrizableCollection.h.
|
inlinevirtual |
Create a copy of this object and send a pointer to it.
Implements bpp::Clonable.
Definition at line 106 of file ParametrizableCollection.h.
|
inlineprotectedvirtualinherited |
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().
|
inlineprotectedvirtualinherited |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 245 of file AbstractParameterAliasable.h.
References bpp::ParameterList::deleteParameter(), bpp::AbstractParametrizable::deleteParameter_(), and bpp::ParameterList::hasParameter().
|
inlineprotectedvirtualinherited |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 252 of file AbstractParameterAliasable.h.
|
inlinevirtual |
To be called when a parameter has changed. Depending on parameters, this will actualize the corresponding objects in the set.
parameters | The modified parameters. |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 114 of file ParametrizableCollection.h.
References bpp::ParametrizableCollection< N >::hasObject(), and bpp::ParameterList::size().
|
virtualinherited |
name | The name of the parameter to look for. |
Implements bpp::ParameterAliasable.
Definition at line 204 of file AbstractParameterAliasable.cpp.
References bpp::AbstractParameterAliasable::aliasListenersRegister_, and bpp::VectorTools::append().
Referenced by bpp::AbstractParameterAliasable::getAliases(), and bpp::ParametrizableCollection< N >::removeObject().
|
inherited |
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(), bpp::AbstractParameterAliasable::aliasListenersRegister_, bpp::ParameterList::hasParameter(), and bpp::AbstractParametrizable::parameter().
|
virtualinherited |
Implements bpp::ParameterAliasable.
Definition at line 225 of file AbstractParameterAliasable.cpp.
References bpp::AbstractParameterAliasable::aliasListenersRegister_, and bpp::AbstractParameterAliasable::getAlias().
|
inline |
Return the first key mapping an object in the map.
object | Object in the set. |
Throw Exception if object not found.
Definition at line 192 of file ParametrizableCollection.h.
|
inherited |
name | The name of the parameter to look for. |
Definition at line 280 of file AbstractParameterAliasable.cpp.
References bpp::AbstractParameterAliasable::aliasListenersRegister_.
|
inherited |
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(), bpp::AbstractParameterAliasable::aliasListenersRegister_, bpp::ParameterList::hasParameter(), and bpp::AbstractParametrizable::parameter().
|
inlinevirtualinherited |
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 bpp::AbstractParameterAliasable::aliasParameters(), bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(), bpp::Simplex::setFrequencies(), and bpp::AbstractParameterAliasable::setNamespace().
|
inlinevirtualinherited |
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().
|
inline |
Definition at line 155 of file ParametrizableCollection.h.
|
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 bpp::AbstractParameterAliasable::AbstractParameterAliasable(), bpp::AbstractParameterAliasable::aliasParameters(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::AbstractParameterAliasable::operator=(), bpp::ConstantDistribution::restrictToConstraint(), and bpp::SimpleDiscreteDistribution::restrictToConstraint().
|
inlineinherited |
Definition at line 48 of file AbstractParametrizable.h.
References bpp::ParameterList::getParameter().
Referenced by bpp::AbstractParameterAliasable::AbstractParameterAliasable(), bpp::AbstractParameterAliasable::operator=(), and bpp::AbstractParameterAliasable::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 bpp::AbstractParameterAliasable::aliasParameters(), bpp::AbstractParametrizable::getParameterWithNamespace_(), bpp::AbstractParametrizable::removeConstraint(), bpp::ConstantDistribution::restrictToConstraint(), bpp::TruncatedExponentialDiscreteDistribution::restrictToConstraint(), bpp::SimpleDiscreteDistribution::restrictToConstraint(), bpp::InvariantMixedDiscreteDistribution::restrictToConstraint(), bpp::AbstractParametrizable::setConstraint(), and bpp::AbstractParameterAliasable::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 bpp::AbstractParameterAliasable::AbstractParameterAliasable(), bpp::AbstractParametrizable::getNamespace(), and bpp::AbstractParameterAliasable::operator=().
|
inlineoverridevirtualinherited |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 41 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_.
Referenced by bpp::AbstractParameterAliasable::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 bpp::AbstractParameterAliasable::AbstractParameterAliasable(), bpp::AbstractParameterAliasable::aliasParameters(), and bpp::AbstractParameterAliasable::operator=().
|
inline |
Get the paramters of the Collection corresponding to an object from the set knowing its index.
objectIndex | Index of the object in the set. |
Definition at line 251 of file ParametrizableCollection.h.
References bpp::ParameterList::size(), and bpp::TextTools::toString().
|
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::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 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 142 of file ParametrizableCollection.h.
References bpp::ParametrizableCollection< N >::vChanged_.
|
inlineinherited |
Definition at line 133 of file AbstractParameterAliasable.h.
References bpp::ParameterList::hasParameter().
|
inline |
Says if there is a object with a given index.
objectIndex | Index of the object in the set. |
Definition at line 163 of file ParametrizableCollection.h.
Referenced by bpp::ParametrizableCollection< N >::fireParameterChanged().
|
inline |
Says if there is an object in the map.
object | Object in the set. |
Definition at line 174 of file ParametrizableCollection.h.
|
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 bpp::AbstractParameterAliasable::aliasParameters(), bpp::GammaDiscreteDistribution::fireParameterChanged(), bpp::AbstractParametrizable::getParameter_(), and bpp::AbstractParameterAliasable::unaliasParameters().
|
inlineprotectedvirtualinherited |
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().
|
inline |
Returns the keys of the set.
Definition at line 208 of file ParametrizableCollection.h.
|
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 bpp::AbstractParameterAliasable::aliasParameters(), bpp::Simplex::setFrequencies(), bpp::ReparametrizationFunctionWrapper::setParameters(), and bpp::FullHmmTransitionMatrix::setTransitionProbabilities().
|
inline |
Definition at line 72 of file ParametrizableCollection.h.
References bpp::ParametrizableCollection< N >::clear(), and bpp::AbstractParameterAliasable::operator=().
|
inline |
Get one object from the set knowing its index.
objectIndex | Index of the object in the set. |
Definition at line 226 of file ParametrizableCollection.h.
|
inline |
Definition at line 235 of file ParametrizableCollection.h.
|
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 bpp::AbstractParameterAliasable::getAliasedParameters(), bpp::ReparametrizationDerivableFirstOrderWrapper::getFirstOrderDerivative(), bpp::AbstractParameterAliasable::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().
|
inline |
Remove a object from the set, and all corresponding parameters.
objectIndex | The index of the object in the set. |
Definition at line 324 of file ParametrizableCollection.h.
References bpp::AbstractParameterAliasable::deleteParameter_(), bpp::AbstractParameterAliasable::getAlias(), bpp::AbstractParametrizable::getParameters(), bpp::ParameterList::size(), and bpp::AbstractParameterAliasable::unaliasParameters().
Referenced by bpp::ParametrizableCollection< N >::replaceObject().
|
inline |
Replace a object in the set, and returns the replaced one.
objectIndex | The index of the object to be replaced in the set. |
object | the replacing N |
Definition at line 370 of file ParametrizableCollection.h.
References bpp::ParametrizableCollection< N >::addObject(), and bpp::ParametrizableCollection< N >::removeObject().
|
inlineprotectedinherited |
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().
|
virtualinherited |
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 bpp::AbstractParameterAliasable::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::RescaledHmmLikelihood::setParameters(), and bpp::LogsumHmmLikelihood::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().
|
inlineprotectedvirtualinherited |
Reimplemented from bpp::AbstractParametrizable.
Definition at line 212 of file AbstractParameterAliasable.h.
References bpp::ParameterList::shareParameter(), and bpp::AbstractParametrizable::shareParameter_().
|
inlineprotectedvirtualinherited |
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().
|
virtualinherited |
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 bpp::AbstractParameterAliasable::aliasListenersRegister_, bpp::AbstractParametrizable::getParameter(), bpp::AbstractParametrizable::getParameter_(), bpp::AbstractParametrizable::hasParameter(), bpp::AbstractParameterAliasable::independentParameters_, bpp::Parameter::removeParameterListener(), and bpp::ParameterList::shareParameter().
Referenced by bpp::ParametrizableCollection< N >::removeObject().
|
protected |
Contains all objects used.
Definition at line 37 of file ParametrizableCollection.h.
|
protected |
A vector of the numbers of objects that have changed during the last fireParameterChanged.
Definition at line 45 of file ParametrizableCollection.h.
Referenced by bpp::ParametrizableCollection< N >::hasChanged().