|
bpp-core
2.1.0
|
A modified implementation of the RescaledHmmLikelihood implementation, with lower memory usage. More...
#include <Bpp/Numeric/Hmm/LowMemoryRescaledHmmLikelihood.h>
Inheritance diagram for bpp::LowMemoryRescaledHmmLikelihood:
Collaboration diagram for bpp::LowMemoryRescaledHmmLikelihood:Public Member Functions | |
| LowMemoryRescaledHmmLikelihood (HmmStateAlphabet *hiddenAlphabet, HmmTransitionMatrix *transitionMatrix, HmmEmissionProbabilities *emissionProbabilities, const std::string &prefix, size_t maxSize=1000000) throw (Exception) | |
| Build a new LowMemoryRescaledHmmLikelihood object. | |
| LowMemoryRescaledHmmLikelihood (const LowMemoryRescaledHmmLikelihood &lik) | |
| LowMemoryRescaledHmmLikelihood & | operator= (const LowMemoryRescaledHmmLikelihood &lik) |
| virtual | ~LowMemoryRescaledHmmLikelihood () |
| LowMemoryRescaledHmmLikelihood * | clone () const |
| Create a copy of this object and send a pointer to it. | |
| const HmmStateAlphabet & | getHmmStateAlphabet () const |
| HmmStateAlphabet & | getHmmStateAlphabet () |
| const HmmTransitionMatrix & | getHmmTransitionMatrix () const |
| HmmTransitionMatrix & | getHmmTransitionMatrix () |
| const HmmEmissionProbabilities & | getHmmEmissionProbabilities () const |
| HmmEmissionProbabilities & | getHmmEmissionProbabilities () |
| void | setBreakPoints (const std::vector< size_t > &breakPoints) |
| const std::vector< size_t > & | getBreakPoints () const |
| void | setParameters (const ParameterList &pl) throw (Exception) |
| Set the point where the function must be computed. | |
| double | getValue () const throw (Exception) |
| Get the value of the function at the current point. | |
| double | getLogLikelihood () const |
| void | fireParameterChanged (const ParameterList &pl) |
| Notify the class when one or several parameters have changed. | |
| void | getHiddenStatesPosteriorProbabilities (std::vector< std::vector< double > > &probs, bool append=false) const throw (NotImplementedException) |
| virtual double | f (const ParameterList ¶meters) throw (Exception) |
| Get the value of the function according to a given set of parameters. | |
| virtual bool | hasParameter (const std::string &name) const =0 |
| Tell if there is a parameter with specified name. | |
| virtual const ParameterList & | getParameters () const =0 |
| Get all parameters available. | |
| virtual const Parameter & | getParameter (const std::string &name) const =0 throw (ParameterNotFoundException) |
| Get the parameter with specified name. | |
| virtual double | getParameterValue (const std::string &name) const =0 throw (ParameterNotFoundException) |
| Get the value for parameter of name 'name'. | |
| virtual void | setAllParametersValues (const ParameterList ¶meters)=0 throw (ParameterNotFoundException, ConstraintException) |
| Set the parameters values to be equals to those of parameters. | |
| virtual void | setParameterValue (const std::string &name, double value)=0 throw (ParameterNotFoundException, ConstraintException) |
| Set the value of parameter with name name to be equal to value. | |
| virtual void | setParametersValues (const ParameterList ¶meters)=0 throw (ParameterNotFoundException, ConstraintException) |
| Update the parameters from parameters. | |
| virtual bool | matchParametersValues (const ParameterList ¶meters)=0 throw (ConstraintException) |
| Update the parameters from parameters. | |
| virtual size_t | getNumberOfParameters () const =0 |
| Get the number of parameters. | |
| virtual void | setNamespace (const std::string &prefix)=0 |
| Set the namespace for the parameter names. | |
| virtual std::string | getNamespace () const =0 |
| virtual std::string | getParameterNameWithoutNamespace (const std::string &name) const =0 |
| Resolves a parameter name according to the current namespace. | |
| bool | hasParameter (const std::string &name) const |
| Tell if there is a parameter with specified name. | |
| const ParameterList & | getParameters () const |
| Get all parameters available. | |
| const Parameter & | getParameter (const std::string &name) const throw (ParameterNotFoundException) |
| Get the parameter with specified name. | |
| double | getParameterValue (const std::string &name) const throw (ParameterNotFoundException) |
| Get the value for parameter of name 'name'. | |
| void | setAllParametersValues (const ParameterList ¶meters) throw (ParameterNotFoundException, ConstraintException) |
| Set the parameters values to be equals to those of parameters. | |
| void | setParameterValue (const std::string &name, double value) throw (ParameterNotFoundException, ConstraintException) |
| Set the value of parameter with name name to be equal to value. | |
| void | setParametersValues (const ParameterList ¶meters) throw (ParameterNotFoundException, ConstraintException) |
| Update the parameters from parameters. | |
| bool | matchParametersValues (const ParameterList ¶meters) throw (ConstraintException) |
| Update the parameters from parameters. | |
| size_t | getNumberOfParameters () const |
| Get the number of parameters. | |
| void | setNamespace (const std::string &prefix) |
| Set the namespace for the parameter names. | |
| std::string | getNamespace () const |
| std::string | getParameterNameWithoutNamespace (const std::string &name) const |
| Resolves a parameter name according to the current namespace. | |
Protected Member Functions | |
| void | computeForward_ () |
| void | addParameter_ (Parameter *parameter) |
| void | addParameters_ (const ParameterList ¶meters) |
| void | deleteParameter_ (size_t index) throw (IndexOutOfBoundsException) |
| void | resetParameters_ () |
| Parameter & | getParameter_ (const std::string &name) throw (ParameterNotFoundException) |
| Parameter & | getParameter_ (size_t index) throw (IndexOutOfBoundsException) |
| const Parameter & | getParameter_ (size_t index) const throw (IndexOutOfBoundsException) |
| Parameter & | getParameterWithNamespace_ (const std::string &name) throw (ParameterNotFoundException) |
| const Parameter & | getParameterWithNamespace_ (const std::string &name) const throw (ParameterNotFoundException) |
| ParameterList & | getParameters_ () |
Private Attributes | |
| std::auto_ptr< HmmStateAlphabet > | hiddenAlphabet_ |
| The alphabet describing the hidden states. | |
| std::auto_ptr < HmmTransitionMatrix > | transitionMatrix_ |
| std::auto_ptr < HmmEmissionProbabilities > | emissionProbabilities_ |
| std::vector< double > | likelihood1_ |
| The likelihood array. | |
| std::vector< double > | likelihood2_ |
| double | logLik_ |
| size_t | maxSize_ |
| std::vector< size_t > | breakPoints_ |
| size_t | nbStates_ |
| size_t | nbSites_ |
A modified implementation of the RescaledHmmLikelihood implementation, with lower memory usage.
This implementation is similar to the one used in the RescaledHmmLikelihood class, but does not store the full likelihood array. The benefit of it is a significantly reduced memory usage, allowing to compute likelihood for very large data sets. The drawback is that this class can't compute posterior probabilities, and can hence only be used to estimate parameters.
Definition at line 62 of file LowMemoryRescaledHmmLikelihood.h.
| LowMemoryRescaledHmmLikelihood::LowMemoryRescaledHmmLikelihood | ( | HmmStateAlphabet * | hiddenAlphabet, |
| HmmTransitionMatrix * | transitionMatrix, | ||
| HmmEmissionProbabilities * | emissionProbabilities, | ||
| const std::string & | prefix, | ||
| size_t | maxSize = 1000000 |
||
| ) | throw (Exception) |
Build a new LowMemoryRescaledHmmLikelihood object.
| hiddenAlphabet | The hidden states alphabet to use. |
| transitionMatrix | The transition matrix to use. |
| emissionProbabilities | The emission probabilities to use. |
| prefix | A namespace for parameter names. |
| maxSize | the maximum size of the vector of scales. If this size is exceeded, then a temporary likelihood computation is made and stored, and the vector is reset. the size of the vector specify the memory usage of the class. A two low value can lead to numerical precision errors. |
Definition at line 48 of file LowMemoryRescaledHmmLikelihood.cpp.
Referenced by clone().
| bpp::LowMemoryRescaledHmmLikelihood::LowMemoryRescaledHmmLikelihood | ( | const LowMemoryRescaledHmmLikelihood & | lik | ) | [inline] |
Definition at line 111 of file LowMemoryRescaledHmmLikelihood.h.
References emissionProbabilities_, hiddenAlphabet_, and transitionMatrix_.
| virtual bpp::LowMemoryRescaledHmmLikelihood::~LowMemoryRescaledHmmLikelihood | ( | ) | [inline, virtual] |
Definition at line 149 of file LowMemoryRescaledHmmLikelihood.h.
| void bpp::AbstractParametrizable::addParameter_ | ( | Parameter * | parameter | ) | [inline, protected, inherited] |
Reimplemented in bpp::AbstractParameterAliasable.
Definition at line 136 of file AbstractParametrizable.h.
References bpp::ParameterList::addParameter(), and bpp::AbstractParametrizable::parameters_.
Referenced by bpp::TestFunction::TestFunction().
| void bpp::AbstractParametrizable::addParameters_ | ( | const ParameterList & | parameters | ) | [inline, protected, inherited] |
Reimplemented in bpp::AbstractParameterAliasable.
Definition at line 142 of file AbstractParametrizable.h.
References bpp::ParameterList::addParameters(), and bpp::AbstractParametrizable::parameters_.
| LowMemoryRescaledHmmLikelihood* bpp::LowMemoryRescaledHmmLikelihood::clone | ( | ) | const [inline, virtual] |
Create a copy of this object and send a pointer to it.
Implements bpp::HmmLikelihood.
Definition at line 156 of file LowMemoryRescaledHmmLikelihood.h.
References LowMemoryRescaledHmmLikelihood().
| void LowMemoryRescaledHmmLikelihood::computeForward_ | ( | ) | [protected] |
Definition at line 105 of file LowMemoryRescaledHmmLikelihood.cpp.
Referenced by setBreakPoints().
| void bpp::AbstractParametrizable::deleteParameter_ | ( | size_t | index | ) | throw (IndexOutOfBoundsException) [inline, protected, inherited] |
Reimplemented in bpp::AbstractParameterAliasable.
Definition at line 147 of file AbstractParametrizable.h.
References bpp::ParameterList::deleteParameter(), bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::size().
| virtual double bpp::Function::f | ( | const ParameterList & | parameters | ) | throw (Exception) [inline, virtual, inherited] |
Get the value of the function according to a given set of parameters.
| parameters | The parameter set to pass to the function. |
| Exception | If an error occured. |
Reimplemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, and bpp::AbstractNumericalDerivative.
Definition at line 117 of file Functions.h.
References bpp::Function::getValue(), and bpp::Function::setParameters().
Referenced by bpp::NewtonOneDimension::doStep(), bpp::ConjugateGradientMultiDimensions::doStep(), bpp::BfgsMultiDimensions::doStep(), bpp::PowellMultiDimensions::doStep(), bpp::NewtonBacktrackOneDimension::doStep(), bpp::GoldenSectionSearch::doStep(), bpp::BrentOneDimension::doStep(), bpp::DownhillSimplexMethod::doStep(), bpp::FunctionWrapper::f(), bpp::PowellMultiDimensions::optimize(), bpp::BrentOneDimension::optimize(), bpp::DownhillSimplexMethod::optimize(), bpp::AbstractOptimizer::step(), and bpp::DownhillSimplexMethod::tryExtrapolation().
| void LowMemoryRescaledHmmLikelihood::fireParameterChanged | ( | const ParameterList & | parameters | ) | [virtual] |
Notify the class when one or several parameters have changed.
| parameters | A ParameterList object with parameters that changed. |
Implements bpp::AbstractParametrizable.
Definition at line 89 of file LowMemoryRescaledHmmLikelihood.cpp.
| const std::vector<size_t>& bpp::LowMemoryRescaledHmmLikelihood::getBreakPoints | ( | ) | const [inline, virtual] |
Implements bpp::HmmLikelihood.
Definition at line 173 of file LowMemoryRescaledHmmLikelihood.h.
References breakPoints_.
| void bpp::LowMemoryRescaledHmmLikelihood::getHiddenStatesPosteriorProbabilities | ( | std::vector< std::vector< double > > & | probs, |
| bool | append = false |
||
| ) | const throw (NotImplementedException) [inline, virtual] |
Implements bpp::HmmLikelihood.
Definition at line 186 of file LowMemoryRescaledHmmLikelihood.h.
| const HmmEmissionProbabilities& bpp::LowMemoryRescaledHmmLikelihood::getHmmEmissionProbabilities | ( | ) | const [inline, virtual] |
Implements bpp::HmmLikelihood.
Definition at line 165 of file LowMemoryRescaledHmmLikelihood.h.
References emissionProbabilities_.
| HmmEmissionProbabilities& bpp::LowMemoryRescaledHmmLikelihood::getHmmEmissionProbabilities | ( | ) | [inline, virtual] |
Implements bpp::HmmLikelihood.
Definition at line 166 of file LowMemoryRescaledHmmLikelihood.h.
References emissionProbabilities_.
| const HmmStateAlphabet& bpp::LowMemoryRescaledHmmLikelihood::getHmmStateAlphabet | ( | ) | const [inline, virtual] |
Implements bpp::HmmLikelihood.
Definition at line 159 of file LowMemoryRescaledHmmLikelihood.h.
References hiddenAlphabet_.
| HmmStateAlphabet& bpp::LowMemoryRescaledHmmLikelihood::getHmmStateAlphabet | ( | ) | [inline, virtual] |
Implements bpp::HmmLikelihood.
Definition at line 160 of file LowMemoryRescaledHmmLikelihood.h.
References hiddenAlphabet_.
| const HmmTransitionMatrix& bpp::LowMemoryRescaledHmmLikelihood::getHmmTransitionMatrix | ( | ) | const [inline, virtual] |
Implements bpp::HmmLikelihood.
Definition at line 162 of file LowMemoryRescaledHmmLikelihood.h.
References transitionMatrix_.
| HmmTransitionMatrix& bpp::LowMemoryRescaledHmmLikelihood::getHmmTransitionMatrix | ( | ) | [inline, virtual] |
Implements bpp::HmmLikelihood.
Definition at line 163 of file LowMemoryRescaledHmmLikelihood.h.
References transitionMatrix_.
| double bpp::LowMemoryRescaledHmmLikelihood::getLogLikelihood | ( | ) | const [inline, virtual] |
Implements bpp::HmmLikelihood.
Definition at line 182 of file LowMemoryRescaledHmmLikelihood.h.
References logLik_.
| std::string bpp::AbstractParametrizable::getNamespace | ( | ) | const [inline, virtual, inherited] |
Implements bpp::Parametrizable.
Definition at line 124 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::prefix_.
Referenced by bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions(), bpp::Simplex::setFrequencies(), bpp::AbstractParameterAliasable::setNamespace(), and bpp::BppODiscreteDistributionFormat::write().
| virtual std::string bpp::Parametrizable::getNamespace | ( | ) | const [pure virtual, inherited] |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::FunctionWrapper::getNamespace().
| size_t bpp::AbstractParametrizable::getNumberOfParameters | ( | ) | const [inline, virtual, inherited] |
Get the number of parameters.
Implements bpp::Parametrizable.
Definition at line 120 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::size().
Referenced by bpp::AbstractParameterAliasable::AbstractParameterAliasable(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::AbstractParameterAliasable::operator=(), bpp::ConstantDistribution::restrictToConstraint(), and bpp::SimpleDiscreteDistribution::restrictToConstraint().
| virtual size_t bpp::Parametrizable::getNumberOfParameters | ( | ) | const [pure virtual, inherited] |
Get the number of parameters.
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, bpp::AbstractParametrizable, and bpp::DirectionFunction.
Referenced by bpp::FunctionWrapper::getNumberOfParameters(), and bpp::BppODiscreteDistributionFormat::write().
| const Parameter& bpp::AbstractParametrizable::getParameter | ( | const std::string & | name | ) | const throw (ParameterNotFoundException) [inline, virtual, inherited] |
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 bpp::ReparametrizationDerivableFirstOrderWrapper::getFirstOrderDerivative(), bpp::AbstractParametrizable::getParameterValue(), bpp::AbstractParametrizable::getParameterWithNamespace_(), bpp::ReparametrizationDerivableSecondOrderWrapper::getSecondOrderDerivative(), and bpp::TestFunction::getValue().
| virtual const Parameter& bpp::Parametrizable::getParameter | ( | const std::string & | name | ) | const throw (ParameterNotFoundException) [pure virtual, inherited] |
Get the parameter with specified name.
| name | The name of the parameter to look for. |
| ParameterNotFoundException | if no parameter with this name is found. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::FunctionWrapper::getParameter().
| Parameter& bpp::AbstractParametrizable::getParameter_ | ( | const std::string & | name | ) | throw (ParameterNotFoundException) [inline, protected, inherited] |
| 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::ParameterList::getParameter(), bpp::AbstractParametrizable::parameters_, and bpp::AbstractParametrizable::prefix_.
Referenced by bpp::AbstractParameterAliasable::deleteParameter_(), bpp::AbstractParametrizable::getParameterWithNamespace_(), bpp::ConstantDistribution::restrictToConstraint(), bpp::TruncatedExponentialDiscreteDistribution::restrictToConstraint(), bpp::InvariantMixedDiscreteDistribution::restrictToConstraint(), and bpp::SimpleDiscreteDistribution::restrictToConstraint().
| Parameter& bpp::AbstractParametrizable::getParameter_ | ( | size_t | index | ) | throw (IndexOutOfBoundsException) [inline, protected, inherited] |
Definition at line 188 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::size().
| const Parameter& bpp::AbstractParametrizable::getParameter_ | ( | size_t | index | ) | const throw (IndexOutOfBoundsException) [inline, protected, inherited] |
Definition at line 194 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::size().
| std::string AbstractParametrizable::getParameterNameWithoutNamespace | ( | const std::string & | name | ) | const [virtual, inherited] |
Resolves a parameter name according to the current namespace.
Implements bpp::Parametrizable.
Definition at line 63 of file AbstractParametrizable.cpp.
References bpp::TextTools::startsWith().
| virtual std::string bpp::Parametrizable::getParameterNameWithoutNamespace | ( | const std::string & | name | ) | const [pure virtual, inherited] |
Resolves a parameter name according to the current namespace.
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::FunctionWrapper::getParameterNameWithoutNamespace(), bpp::BppODiscreteDistributionFormat::read(), and bpp::BppOParametrizableFormat::write().
| const ParameterList& bpp::AbstractParametrizable::getParameters | ( | ) | const [inline, virtual, inherited] |
Get all parameters available.
Implements bpp::Parametrizable.
Definition at line 77 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_.
Referenced by bpp::AbstractParameterAliasable::fireParameterChanged(), and bpp::MixtureOfDiscreteDistributions::MixtureOfDiscreteDistributions().
| virtual const ParameterList& bpp::Parametrizable::getParameters | ( | ) | const [pure virtual, inherited] |
Get all parameters available.
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, bpp::DirectionFunction, and bpp::AbstractParametrizable.
Referenced by bpp::NewtonOneDimension::doStep(), bpp::FunctionWrapper::getParameters(), bpp::BppODiscreteDistributionFormat::read(), bpp::AbstractNumericalDerivative::setParameterValue(), bpp::AbstractOptimizer::step(), and bpp::BppOParametrizableFormat::write().
| ParameterList& bpp::AbstractParametrizable::getParameters_ | ( | ) | [inline, protected, inherited] |
Definition at line 201 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_.
Referenced by bpp::AbstractParameterAliasable::AbstractParameterAliasable(), and bpp::AbstractParameterAliasable::operator=().
| double bpp::AbstractParametrizable::getParameterValue | ( | const std::string & | name | ) | const throw (ParameterNotFoundException) [inline, virtual, inherited] |
Get the value for parameter of name 'name'.
| name | The name of the parameter. |
Implements bpp::Parametrizable.
Definition at line 84 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::getParameter(), and bpp::Parameter::getValue().
Referenced by bpp::DirichletDiscreteDistribution::applyParameters(), bpp::ConstantDistribution::fireParameterChanged(), bpp::GaussianDiscreteDistribution::fireParameterChanged(), bpp::GammaDiscreteDistribution::fireParameterChanged(), bpp::ExponentialDiscreteDistribution::fireParameterChanged(), bpp::BetaDiscreteDistribution::fireParameterChanged(), bpp::InvariantMixedDiscreteDistribution::fireParameterChanged(), bpp::TruncatedExponentialDiscreteDistribution::fireParameterChanged(), bpp::SimpleDiscreteDistribution::fireParameterChanged(), bpp::MixtureOfDiscreteDistributions::fireParameterChanged(), bpp::Simplex::fireParameterChanged(), bpp::ExponentialDiscreteDistribution::randC(), bpp::GammaDiscreteDistribution::randC(), bpp::BetaDiscreteDistribution::randC(), bpp::TruncatedExponentialDiscreteDistribution::randC(), and bpp::ConstantDistribution::restrictToConstraint().
| virtual double bpp::Parametrizable::getParameterValue | ( | const std::string & | name | ) | const throw (ParameterNotFoundException) [pure virtual, inherited] |
Get the value for parameter of name 'name'.
| name | The name of the parameter. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::FunctionWrapper::getParameterValue(), and bpp::BppODiscreteDistributionFormat::read().
| Parameter& bpp::AbstractParametrizable::getParameterWithNamespace_ | ( | const std::string & | name | ) | throw (ParameterNotFoundException) [inline, protected, inherited] |
| name | The name of the parameter, including its namespace. |
| ParameterNotFoundException | If no parameter with that name is found in the list. |
Definition at line 174 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::getParameter_().
| const Parameter& bpp::AbstractParametrizable::getParameterWithNamespace_ | ( | const std::string & | name | ) | const throw (ParameterNotFoundException) [inline, protected, inherited] |
| name | The name of the parameter, including its namespace. |
| ParameterNotFoundException | If no parameter with that name is found in the list. |
Definition at line 183 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::getParameter().
| double bpp::LowMemoryRescaledHmmLikelihood::getValue | ( | ) | const throw (Exception) [inline, virtual] |
Get the value of the function at the current point.
| Exception | If no point is specified or if an error occured. |
Implements bpp::Function.
Definition at line 180 of file LowMemoryRescaledHmmLikelihood.h.
References logLik_.
| virtual bool bpp::Parametrizable::hasParameter | ( | const std::string & | name | ) | const [pure virtual, inherited] |
Tell if there is a parameter with specified name.
| name | The name of the parameter to look for. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::FunctionWrapper::hasParameter().
| bool bpp::AbstractParametrizable::hasParameter | ( | const std::string & | name | ) | const [inline, virtual, inherited] |
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 bpp::ConstantDistribution::fireParameterChanged().
| bool bpp::AbstractParametrizable::matchParametersValues | ( | const ParameterList & | parameters | ) | throw (ConstraintException) [inline, virtual, inherited] |
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 111 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), bpp::ParameterList::matchParametersValues(), and bpp::AbstractParametrizable::parameters_.
Referenced by bpp::Simplex::setFrequencies(), bpp::ReparametrizationFunctionWrapper::setParameters(), and bpp::TestFunction::setParameters().
| virtual bool bpp::Parametrizable::matchParametersValues | ( | const ParameterList & | parameters | ) | throw (ConstraintException) [pure virtual, inherited] |
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. |
Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::InvariantMixedDiscreteDistribution::fireParameterChanged(), bpp::AbstractNumericalDerivative::matchParametersValues(), bpp::FunctionWrapper::matchParametersValues(), and bpp::InfinityFunctionWrapper::matchParametersValues().
| LowMemoryRescaledHmmLikelihood& bpp::LowMemoryRescaledHmmLikelihood::operator= | ( | const LowMemoryRescaledHmmLikelihood & | lik | ) | [inline] |
Definition at line 129 of file LowMemoryRescaledHmmLikelihood.h.
References breakPoints_, emissionProbabilities_, hiddenAlphabet_, likelihood1_, likelihood2_, logLik_, maxSize_, nbSites_, nbStates_, and transitionMatrix_.
| void bpp::AbstractParametrizable::resetParameters_ | ( | ) | [inline, protected, inherited] |
Reimplemented in bpp::AbstractParameterAliasable.
Definition at line 154 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::reset().
| void bpp::AbstractParametrizable::setAllParametersValues | ( | const ParameterList & | parameters | ) | throw (ParameterNotFoundException, ConstraintException) [inline, virtual, inherited] |
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 90 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::setAllParametersValues().
| virtual void bpp::Parametrizable::setAllParametersValues | ( | const ParameterList & | parameters | ) | throw (ParameterNotFoundException, ConstraintException) [pure virtual, inherited] |
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. |
Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::AbstractNumericalDerivative::setAllParametersValues(), bpp::FunctionWrapper::setAllParametersValues(), and bpp::InfinityFunctionWrapper::setAllParametersValues().
| void bpp::LowMemoryRescaledHmmLikelihood::setBreakPoints | ( | const std::vector< size_t > & | breakPoints | ) | [inline, virtual] |
Implements bpp::HmmLikelihood.
Definition at line 168 of file LowMemoryRescaledHmmLikelihood.h.
References breakPoints_, and computeForward_().
| void AbstractParametrizable::setNamespace | ( | const std::string & | prefix | ) | [virtual, inherited] |
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::AbstractParameterAliasable, bpp::MixtureOfDiscreteDistributions, and bpp::InvariantMixedDiscreteDistribution.
Definition at line 45 of file AbstractParametrizable.cpp.
References bpp::TextTools::startsWith().
| virtual void bpp::Parametrizable::setNamespace | ( | const std::string & | prefix | ) | [pure virtual, inherited] |
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. |
Implemented in bpp::FunctionWrapper, bpp::ParametrizableAdapter, bpp::AbstractParameterAliasable, bpp::MixtureOfDiscreteDistributions, bpp::AbstractParametrizable, and bpp::InvariantMixedDiscreteDistribution.
Referenced by bpp::InvariantMixedDiscreteDistribution::InvariantMixedDiscreteDistribution(), bpp::InvariantMixedDiscreteDistribution::setNamespace(), and bpp::FunctionWrapper::setNamespace().
| void bpp::LowMemoryRescaledHmmLikelihood::setParameters | ( | const ParameterList & | parameters | ) | throw (Exception) [inline, virtual] |
Set the point where the function must be computed.
| parameters | The parameter set to pass to the function. |
Implements bpp::Function.
Definition at line 175 of file LowMemoryRescaledHmmLikelihood.h.
References bpp::AbstractParametrizable::setParametersValues().
| void bpp::AbstractParametrizable::setParametersValues | ( | const ParameterList & | parameters | ) | throw (ParameterNotFoundException, ConstraintException) [inline, virtual, inherited] |
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 104 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), bpp::AbstractParametrizable::parameters_, and bpp::ParameterList::setParametersValues().
Referenced by bpp::RescaledHmmLikelihood::setParameters(), bpp::LogsumHmmLikelihood::setParameters(), and setParameters().
| virtual void bpp::Parametrizable::setParametersValues | ( | const ParameterList & | parameters | ) | throw (ParameterNotFoundException, ConstraintException) [pure virtual, inherited] |
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. |
Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::AbstractNumericalDerivative::setParametersValues(), bpp::FunctionWrapper::setParametersValues(), and bpp::InfinityFunctionWrapper::setParametersValues().
| void bpp::AbstractParametrizable::setParameterValue | ( | const std::string & | name, |
| double | value | ||
| ) | throw (ParameterNotFoundException, ConstraintException) [inline, virtual, inherited] |
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 97 of file AbstractParametrizable.h.
References bpp::AbstractParametrizable::fireParameterChanged(), bpp::AbstractParametrizable::parameters_, bpp::AbstractParametrizable::prefix_, bpp::ParameterList::setParameterValue(), and bpp::ParameterList::subList().
| virtual void bpp::Parametrizable::setParameterValue | ( | const std::string & | name, |
| double | value | ||
| ) | throw (ParameterNotFoundException, ConstraintException) [pure virtual, inherited] |
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. |
Implemented in bpp::InfinityFunctionWrapper, bpp::FunctionWrapper, bpp::AbstractNumericalDerivative, bpp::ParametrizableAdapter, and bpp::AbstractParametrizable.
Referenced by bpp::AbstractNumericalDerivative::setParameterValue(), bpp::FunctionWrapper::setParameterValue(), and bpp::InfinityFunctionWrapper::setParameterValue().
std::vector<size_t> bpp::LowMemoryRescaledHmmLikelihood::breakPoints_ [private] |
Definition at line 84 of file LowMemoryRescaledHmmLikelihood.h.
Referenced by getBreakPoints(), operator=(), and setBreakPoints().
std::auto_ptr<HmmEmissionProbabilities> bpp::LowMemoryRescaledHmmLikelihood::emissionProbabilities_ [private] |
Definition at line 72 of file LowMemoryRescaledHmmLikelihood.h.
Referenced by getHmmEmissionProbabilities(), LowMemoryRescaledHmmLikelihood(), and operator=().
std::auto_ptr<HmmStateAlphabet> bpp::LowMemoryRescaledHmmLikelihood::hiddenAlphabet_ [private] |
The alphabet describing the hidden states.
Definition at line 70 of file LowMemoryRescaledHmmLikelihood.h.
Referenced by getHmmStateAlphabet(), LowMemoryRescaledHmmLikelihood(), and operator=().
std::vector<double> bpp::LowMemoryRescaledHmmLikelihood::likelihood1_ [private] |
The likelihood array.
Here we use two arrays for the i and i-1 positions
Definition at line 79 of file LowMemoryRescaledHmmLikelihood.h.
Referenced by operator=().
std::vector<double> bpp::LowMemoryRescaledHmmLikelihood::likelihood2_ [private] |
Definition at line 80 of file LowMemoryRescaledHmmLikelihood.h.
Referenced by operator=().
double bpp::LowMemoryRescaledHmmLikelihood::logLik_ [private] |
Definition at line 81 of file LowMemoryRescaledHmmLikelihood.h.
Referenced by getLogLikelihood(), getValue(), and operator=().
size_t bpp::LowMemoryRescaledHmmLikelihood::maxSize_ [private] |
Definition at line 82 of file LowMemoryRescaledHmmLikelihood.h.
Referenced by operator=().
size_t bpp::LowMemoryRescaledHmmLikelihood::nbSites_ [private] |
Definition at line 86 of file LowMemoryRescaledHmmLikelihood.h.
Referenced by operator=().
size_t bpp::LowMemoryRescaledHmmLikelihood::nbStates_ [private] |
Definition at line 86 of file LowMemoryRescaledHmmLikelihood.h.
Referenced by operator=().
std::auto_ptr<HmmTransitionMatrix> bpp::LowMemoryRescaledHmmLikelihood::transitionMatrix_ [private] |
Definition at line 71 of file LowMemoryRescaledHmmLikelihood.h.
Referenced by getHmmTransitionMatrix(), LowMemoryRescaledHmmLikelihood(), and operator=().