bpp-phyl3  3.0.0
bpp::HmmPhyloEmissionProbabilities Class Referenceabstract

Emission probabilities in the context of DF phylolikeihoods. More...

#include <Bpp/Phyl/Likelihood/PhyloLikelihoods/HmmPhyloEmissionProbabilities.h>

+ Inheritance diagram for bpp::HmmPhyloEmissionProbabilities:
+ Collaboration diagram for bpp::HmmPhyloEmissionProbabilities:

Public Member Functions

 HmmPhyloEmissionProbabilities (std::shared_ptr< HmmPhyloAlphabet > alphabet)
 
 HmmPhyloEmissionProbabilities (const HmmPhyloEmissionProbabilities &hEP)
 
HmmPhyloEmissionProbabilitiesclone () const
 
const HmmStateAlphabetgetHmmStateAlphabet () const
 
size_t getNumberOfStates () const
 
size_t getNumberOfSites () const
 
void setHmmStateAlphabet (std::shared_ptr< HmmStateAlphabet > stateAlphabet)
 Set the new hidden state alphabet. More...
 
DataLik operator() (size_t pos, size_t state) const
 Operator access to the emission probabilities. More...
 
ValueRef< MatrixLikgetEmissionProbabilities ()
 
VectorLik operator() (size_t pos) const
 Operator access to the emission probabilities. More...
 
size_t getNumberOfPositions () const
 
virtual bool hasParameter (const std::string &name) const=0
 
virtual const ParameterListgetParameters () const=0
 
virtual const Parameterparameter (const std::string &name) const=0
 
virtual double getParameterValue (const std::string &name) const=0
 
virtual void setAllParametersValues (const ParameterList &parameters)=0
 
virtual void setParameterValue (const std::string &name, double value)=0
 
virtual void setParametersValues (const ParameterList &parameters)=0
 
virtual bool matchParametersValues (const ParameterList &parameters)=0
 
virtual void removeConstraint (const std::string &name)=0
 
virtual void setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint)=0
 
virtual size_t getNumberOfParameters () const=0
 
virtual void setNamespace (const std::string &prefix)=0
 
virtual std::string getNamespace () const=0
 
virtual std::string getParameterNameWithoutNamespace (const std::string &name) const=0
 
bool hasParameter (const std::string &name) const override
 
const ParameterListgetParameters () const override
 
const Parameterparameter (const std::string &name) const override
 
const std::shared_ptr< Parameter > & getParameter (const std::string &name) const
 
double getParameterValue (const std::string &name) const override
 
void setAllParametersValues (const ParameterList &parameters) override
 
void setParameterValue (const std::string &name, double value) override
 
void setParametersValues (const ParameterList &parameters) override
 
bool matchParametersValues (const ParameterList &parameters) override
 
void removeConstraint (const std::string &name) override
 
void setConstraint (const std::string &name, std::shared_ptr< ConstraintInterface > constraint) override
 
size_t getNumberOfParameters () const override
 
void setNamespace (const std::string &prefix) override
 
std::string getNamespace () const override
 
std::string getParameterNameWithoutNamespace (const std::string &name) const override
 
virtual void fireParameterChanged (const ParameterList &parameters)
 

Protected Member Functions

virtual ParameterListgetParameters_ ()=0
 
const std::shared_ptr< Parameter > & getParameter (size_t i) const
 
std::shared_ptr< Parameter > & getParameter (size_t i)
 
virtual void addParameter_ (Parameter *parameter)
 
virtual void addParameters_ (const ParameterList &parameters)
 
virtual void shareParameter_ (const std::shared_ptr< Parameter > &parameter)
 
virtual void shareParameters_ (const ParameterList &parameters)
 
virtual void includeParameters_ (const ParameterList &parameters)
 
virtual void deleteParameter_ (size_t index)
 
virtual void deleteParameter_ (std::string &name)
 
virtual void deleteParameters_ (const std::vector< std::string > &names)
 
void resetParameters_ ()
 
ParametergetParameter_ (const std::string &name)
 
ParametergetParameter_ (size_t index)
 
const ParametergetParameter_ (size_t index) const
 
ParametergetParameterWithNamespace_ (const std::string &name)
 
const ParametergetParameterWithNamespace_ (const std::string &name) const
 
ParameterListgetParameters_ () override
 

Private Attributes

Contextcontext_
 
std::shared_ptr< HmmPhyloAlphabetphylAlph_
 
ValueRef< MatrixLikemProb_
 
size_t nbSites_
 
ParameterList parameters_
 
std::string prefix_
 

Detailed Description

Emission probabilities in the context of DF phylolikeihoods.

Definition at line 23 of file HmmPhyloEmissionProbabilities.h.

Constructor & Destructor Documentation

◆ HmmPhyloEmissionProbabilities() [1/2]

HmmPhyloEmissionProbabilities::HmmPhyloEmissionProbabilities ( std::shared_ptr< HmmPhyloAlphabet alphabet)

Definition at line 10 of file HmmPhyloEmissionProbabilities.cpp.

References setHmmStateAlphabet().

Referenced by clone().

◆ HmmPhyloEmissionProbabilities() [2/2]

bpp::HmmPhyloEmissionProbabilities::HmmPhyloEmissionProbabilities ( const HmmPhyloEmissionProbabilities hEP)
inline

Definition at line 45 of file HmmPhyloEmissionProbabilities.h.

Member Function Documentation

◆ clone()

HmmPhyloEmissionProbabilities* bpp::HmmPhyloEmissionProbabilities::clone ( ) const
inlinevirtual

◆ getEmissionProbabilities()

ValueRef<MatrixLik> bpp::HmmPhyloEmissionProbabilities::getEmissionProbabilities ( )
inline

Definition at line 93 of file HmmPhyloEmissionProbabilities.h.

References emProb_.

◆ getHmmStateAlphabet()

const HmmStateAlphabet* bpp::HmmPhyloEmissionProbabilities::getHmmStateAlphabet ( ) const
inlinevirtual

Implements bpp::HmmEmissionProbabilities_Eigen.

Definition at line 55 of file HmmPhyloEmissionProbabilities.h.

References phylAlph_.

◆ getNumberOfPositions()

size_t bpp::HmmPhyloEmissionProbabilities::getNumberOfPositions ( ) const
inlinevirtual
Returns
The number of positions in the data.

Implements bpp::HmmEmissionProbabilities_Eigen.

Definition at line 115 of file HmmPhyloEmissionProbabilities.h.

References nbSites_.

◆ getNumberOfSites()

size_t bpp::HmmPhyloEmissionProbabilities::getNumberOfSites ( ) const
inline

Definition at line 65 of file HmmPhyloEmissionProbabilities.h.

References nbSites_.

◆ getNumberOfStates()

size_t bpp::HmmPhyloEmissionProbabilities::getNumberOfStates ( ) const
inline

Definition at line 60 of file HmmPhyloEmissionProbabilities.h.

References phylAlph_.

◆ operator()() [1/2]

VectorLik bpp::HmmPhyloEmissionProbabilities::operator() ( size_t  pos) const
inlinevirtual

Operator access to the emission probabilities.

This is the fastest way to get the values, but no checking is performed on the indices. For debugging purpose, the getPhyloEmissionProbability would be a safer use.

Parameters
posThe position of the sequential data to consider.
Returns
A vector of probabilities, whose size is the number of hidden states.

Implements bpp::HmmEmissionProbabilities_Eigen.

Definition at line 107 of file HmmPhyloEmissionProbabilities.h.

References emProb_.

◆ operator()() [2/2]

DataLik bpp::HmmPhyloEmissionProbabilities::operator() ( size_t  pos,
size_t  state 
) const
inlinevirtual

Operator access to the emission probabilities.

This is the fastest way to get the values, but no checking is performed on the indices. For debugging purpose, the getPhyloEmissionProbability would be a safer use.

Parameters
posThe position of the sequential data to consider.
stateThe index of the hidden state to consider, as defined by the HmmStateAlphabet object associated to this class

Implements bpp::HmmEmissionProbabilities_Eigen.

Definition at line 88 of file HmmPhyloEmissionProbabilities.h.

References emProb_.

◆ setHmmStateAlphabet()

void HmmPhyloEmissionProbabilities::setHmmStateAlphabet ( std::shared_ptr< HmmStateAlphabet stateAlphabet)
virtual

Set the new hidden state alphabet.

Parameters
stateAlphabetThe new state alphabet.
Exceptions
UnvalidStateAlphabetExceptionif the new alphabet is incorrect (for instance is NULL pointer).

Implements bpp::HmmEmissionProbabilities_Eigen.

Definition at line 21 of file HmmPhyloEmissionProbabilities.cpp.

References context_, emProb_, nbSites_, and phylAlph_.

Referenced by HmmPhyloEmissionProbabilities().

Member Data Documentation

◆ context_

Context& bpp::HmmPhyloEmissionProbabilities::context_
private

Definition at line 28 of file HmmPhyloEmissionProbabilities.h.

Referenced by setHmmStateAlphabet().

◆ emProb_

ValueRef<MatrixLik> bpp::HmmPhyloEmissionProbabilities::emProb_
private

◆ nbSites_

size_t bpp::HmmPhyloEmissionProbabilities::nbSites_
private

◆ phylAlph_

std::shared_ptr<HmmPhyloAlphabet> bpp::HmmPhyloEmissionProbabilities::phylAlph_
private

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