bpp-phyl3  3.0.0
bpp::AbstractAlignedPhyloLikelihood Class Referenceabstract

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

+ Inheritance diagram for bpp::AbstractAlignedPhyloLikelihood:
+ Collaboration diagram for bpp::AbstractAlignedPhyloLikelihood:

Public Member Functions

 AbstractAlignedPhyloLikelihood (Context &context, size_t nbSites)
 
virtual ~AbstractAlignedPhyloLikelihood ()
 
size_t getNumberOfSites () const
 Get the number of sites in the dataset. More...
 
DataLik getLikelihoodForASite (size_t site) const
 Get the likelihood for a site (on uncompressed data) More...
 
double getLogLikelihoodForASite (size_t site) const
 Get the log likelihood for a site, and its derivatives. More...
 
VDataLik getLikelihoodPerSite () const
 Get the likelihood for each site. More...
 
virtual AlignedPhyloLikelihoodInterfaceclone () const =0
 
virtual LikelihoodCalculationlikelihoodCalculation () const =0
 
virtual std::shared_ptr< LikelihoodCalculationgetLikelihoodCalculation () const =0
 
virtual void enableSecondOrderDerivatives (bool yn)=0
 
virtual bool enableSecondOrderDerivatives () const=0
 
virtual double getSecondOrderDerivative (const std::string &variable) const=0
 
virtual double getSecondOrderDerivative (const std::string &variable1, const std::string &variable2) const=0
 
virtual double d2f (const std::string &variable, const ParameterList &parameters)
 
virtual double d2f (const std::string &variable1, const std::string &variable2, const ParameterList &parameters)
 
virtual void enableFirstOrderDerivatives (bool yn)=0
 
virtual bool enableFirstOrderDerivatives () const=0
 
virtual double getFirstOrderDerivative (const std::string &variable) const=0
 
virtual double df (const std::string &variable, const ParameterList &parameters)
 
virtual void setParameters (const ParameterList &parameters)=0
 
virtual double getValue () const=0
 
virtual double f (const ParameterList &parameters)
 
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
 
const Contextcontext () const override
 
Contextcontext () override
 
virtual bool isInitialized () const override
 Sets the computeLikelihoods_ to true. More...
 
void shareParameters (const ParameterList &variableNodes)
 Share Parameters, that are DF_parameters. More...
 
void setParameters (const ParameterList &parameters) override
 
ValueRef< DataLikgetLikelihoodNode () const override
 
virtual void enableFirstOrderDerivatives (bool yn) override
 Tell if derivatives must be computed: for Function inheritance. More...
 
bool enableFirstOrderDerivatives () const override
 
virtual void enableSecondOrderDerivatives (bool yn) override
 
bool enableSecondOrderDerivatives () const override
 
double getValue () const override
 
double getFirstOrderDerivative (const std::string &variable) const override
 
ValueRef< DataLikfirstOrderDerivativeNode (const std::string &variable) const
 
double getSecondOrderDerivative (const std::string &variable) const override
 
double getSecondOrderDerivative (const std::string &variable1, const std::string &variable2) const override
 
ValueRef< DataLiksecondOrderDerivativeNode (const std::string &variable1, const std::string &variable2) const
 
The likelihood functions.
virtual AlignedLikelihoodCalculationalignedLikelihoodCalculation () const =0
 
virtual std::shared_ptr< AlignedLikelihoodCalculationgetAlignedLikelihoodCalculation () const =0
 
The data functions
virtual bool isInitialized () const =0
 
virtual const Contextcontext () const =0
 
virtual Contextcontext ()=0
 
The likelihood functions.
virtual ValueRef< DataLikgetLikelihoodNode () const =0
 
double getLogLikelihood () const
 Get the logarithm of the likelihood for the whole dataset. More...
 
Retrieve some particular independent parameters subsets.

Get the derivates of the LogLikelihood.

virtual ParameterList getNonDerivableParameters () const =0
 
virtual ParameterList getDerivableParameters () const =0
 
virtual ParameterList getBranchLengthParameters () const =0
 Get the independent branch lengths parameters. More...
 
virtual ParameterList getSubstitutionModelParameters () const =0
 Get the independent parameters associated to substitution model(s). More...
 
virtual ParameterList getRateDistributionParameters () const =0
 Get the independent parameters associated to the rate distribution(s). More...
 
virtual ParameterList getRootFrequenciesParameters () const =0
 Get the independent parameters associated to the root frequencies(s). More...
 

Protected Member Functions

 AbstractAlignedPhyloLikelihood (const AbstractAlignedPhyloLikelihood &aasd)
 
AbstractAlignedPhyloLikelihoodoperator= (const AbstractAlignedPhyloLikelihood &aasd)
 
void setNumberOfSites (size_t nbSites)
 
virtual ParameterListgetParameters_ ()=0
 
Node_DFaccessVariableNode (const std::string &name) const
 

Static Protected Member Functions

static Node_DFaccessVariableNode (const Parameter &param)
 

Protected Attributes

size_t nbSites_
 
Contextcontext_
 
DataLik minusLogLik_
 the value More...
 
std::unordered_map< std::string, ValueRef< DataLik > > firstOrderDerivativeNodes_
 For Dataflow computing. More...
 
std::unordered_map< std::pair< std::string, std::string >, ValueRef< DataLik >, StringPairHashsecondOrderDerivativeNodes_
 

Detailed Description

Definition at line 106 of file AlignedPhyloLikelihood.h.

Constructor & Destructor Documentation

◆ AbstractAlignedPhyloLikelihood() [1/2]

bpp::AbstractAlignedPhyloLikelihood::AbstractAlignedPhyloLikelihood ( Context context,
size_t  nbSites 
)
inline

Definition at line 114 of file AlignedPhyloLikelihood.h.

◆ AbstractAlignedPhyloLikelihood() [2/2]

bpp::AbstractAlignedPhyloLikelihood::AbstractAlignedPhyloLikelihood ( const AbstractAlignedPhyloLikelihood aasd)
inlineprotected

Definition at line 120 of file AlignedPhyloLikelihood.h.

◆ ~AbstractAlignedPhyloLikelihood()

virtual bpp::AbstractAlignedPhyloLikelihood::~AbstractAlignedPhyloLikelihood ( )
inlinevirtual

Definition at line 133 of file AlignedPhyloLikelihood.h.

Member Function Documentation

◆ accessVariableNode() [1/2]

◆ accessVariableNode() [2/2]

Node_DF& bpp::AbstractPhyloLikelihood::accessVariableNode ( const std::string &  name) const
inlineprotectedinherited

◆ alignedLikelihoodCalculation()

◆ clone()

◆ context() [1/4]

virtual const Context& bpp::PhyloLikelihoodInterface::context ( ) const
pure virtualinherited

◆ context() [2/4]

◆ context() [3/4]

Context& bpp::AbstractPhyloLikelihood::context ( )
inlineoverridevirtualinherited

◆ context() [4/4]

virtual Context& bpp::PhyloLikelihoodInterface::context ( )
pure virtualinherited

◆ enableFirstOrderDerivatives() [1/2]

bool bpp::AbstractPhyloLikelihood::enableFirstOrderDerivatives ( ) const
inlineoverridevirtualinherited

Implements bpp::SecondOrderDerivable.

Definition at line 115 of file AbstractPhyloLikelihood.h.

◆ enableFirstOrderDerivatives() [2/2]

virtual void bpp::AbstractPhyloLikelihood::enableFirstOrderDerivatives ( bool  yn)
inlineoverridevirtualinherited

Tell if derivatives must be computed: for Function inheritance.

Implements bpp::SecondOrderDerivable.

Definition at line 113 of file AbstractPhyloLikelihood.h.

◆ enableSecondOrderDerivatives() [1/2]

bool bpp::AbstractPhyloLikelihood::enableSecondOrderDerivatives ( ) const
inlineoverridevirtualinherited

Implements bpp::SecondOrderDerivable.

Definition at line 116 of file AbstractPhyloLikelihood.h.

◆ enableSecondOrderDerivatives() [2/2]

virtual void bpp::AbstractPhyloLikelihood::enableSecondOrderDerivatives ( bool  yn)
inlineoverridevirtualinherited

Implements bpp::SecondOrderDerivable.

Definition at line 114 of file AbstractPhyloLikelihood.h.

◆ firstOrderDerivativeNode()

◆ getAlignedLikelihoodCalculation()

◆ getBranchLengthParameters()

virtual ParameterList bpp::PhyloLikelihoodInterface::getBranchLengthParameters ( ) const
pure virtualinherited

◆ getDerivableParameters()

virtual ParameterList bpp::PhyloLikelihoodInterface::getDerivableParameters ( ) const
pure virtualinherited

◆ getFirstOrderDerivative()

double bpp::AbstractPhyloLikelihood::getFirstOrderDerivative ( const std::string &  variable) const
inlineoverridevirtualinherited

◆ getLikelihoodCalculation()

◆ getLikelihoodForASite()

DataLik bpp::AbstractAlignedPhyloLikelihood::getLikelihoodForASite ( size_t  site) const
inlinevirtual

Get the likelihood for a site (on uncompressed data)

Parameters
siteThe site index to analyse.
Returns
The likelihood for site site.

Implements bpp::AlignedPhyloLikelihoodInterface.

Definition at line 143 of file AlignedPhyloLikelihood.h.

References bpp::AlignedPhyloLikelihoodInterface::alignedLikelihoodCalculation(), and bpp::AlignedLikelihoodCalculation::getLikelihoodForASite().

◆ getLikelihoodNode() [1/2]

virtual ValueRef<DataLik> bpp::PhyloLikelihoodInterface::getLikelihoodNode ( ) const
pure virtualinherited
Returns
the LikDF node where the Likelihood is computed.

Implemented in bpp::AbstractPhyloLikelihood.

◆ getLikelihoodNode() [2/2]

ValueRef<DataLik> bpp::AbstractPhyloLikelihood::getLikelihoodNode ( ) const
inlineoverridevirtualinherited

◆ getLikelihoodPerSite()

VDataLik bpp::AbstractAlignedPhyloLikelihood::getLikelihoodPerSite ( ) const
inlinevirtual

◆ getLogLikelihood()

double bpp::PhyloLikelihoodInterface::getLogLikelihood ( ) const
inlineinherited

Get the logarithm of the likelihood for the whole dataset.

Returns
The logarithm of the likelihood of the dataset.

Definition at line 66 of file PhyloLikelihood.h.

References bpp::SecondOrderDerivable::getValue().

◆ getLogLikelihoodForASite()

double bpp::AbstractAlignedPhyloLikelihood::getLogLikelihoodForASite ( size_t  site) const
inlinevirtual

Get the log likelihood for a site, and its derivatives.

Parameters
siteThe site index to analyse.
Returns
The (D)log likelihood for site site.

Implements bpp::AlignedPhyloLikelihoodInterface.

Definition at line 154 of file AlignedPhyloLikelihood.h.

References bpp::convert(), and bpp::AlignedPhyloLikelihoodInterface::getAlignedLikelihoodCalculation().

◆ getNonDerivableParameters()

virtual ParameterList bpp::PhyloLikelihoodInterface::getNonDerivableParameters ( ) const
pure virtualinherited

◆ getNumberOfSites()

◆ getRateDistributionParameters()

virtual ParameterList bpp::PhyloLikelihoodInterface::getRateDistributionParameters ( ) const
pure virtualinherited

Get the independent parameters associated to the rate distribution(s).

Returns
A ParameterList.

Implemented in bpp::SingleProcessPhyloLikelihood, bpp::AbstractParametrizableSequencePhyloLikelihood, bpp::AbstractPhyloLikelihoodSet, and bpp::OnABranchPhyloLikelihood.

◆ getRootFrequenciesParameters()

virtual ParameterList bpp::PhyloLikelihoodInterface::getRootFrequenciesParameters ( ) const
pure virtualinherited

Get the independent parameters associated to the root frequencies(s).

Returns
A ParameterList.

Implemented in bpp::SingleProcessPhyloLikelihood, bpp::AbstractParametrizableSequencePhyloLikelihood, bpp::AbstractPhyloLikelihoodSet, and bpp::OnABranchPhyloLikelihood.

◆ getSecondOrderDerivative() [1/2]

double bpp::AbstractPhyloLikelihood::getSecondOrderDerivative ( const std::string &  variable) const
inlineoverridevirtualinherited

Implements bpp::SecondOrderDerivable.

Definition at line 155 of file AbstractPhyloLikelihood.h.

◆ getSecondOrderDerivative() [2/2]

double bpp::AbstractPhyloLikelihood::getSecondOrderDerivative ( const std::string &  variable1,
const std::string &  variable2 
) const
inlineoverridevirtualinherited

◆ getSubstitutionModelParameters()

virtual ParameterList bpp::PhyloLikelihoodInterface::getSubstitutionModelParameters ( ) const
pure virtualinherited

Get the independent parameters associated to substitution model(s).

Returns
A ParameterList.

Implemented in bpp::SingleProcessPhyloLikelihood, bpp::AbstractParametrizableSequencePhyloLikelihood, bpp::AbstractPhyloLikelihoodSet, and bpp::OnABranchPhyloLikelihood.

◆ getValue()

double bpp::AbstractPhyloLikelihood::getValue ( ) const
inlineoverridevirtualinherited

◆ isInitialized() [1/2]

virtual bool bpp::PhyloLikelihoodInterface::isInitialized ( ) const
pure virtualinherited

◆ isInitialized() [2/2]

virtual bool bpp::AbstractPhyloLikelihood::isInitialized ( ) const
inlineoverridevirtualinherited

◆ likelihoodCalculation()

◆ operator=()

◆ secondOrderDerivativeNode()

ValueRef<DataLik> bpp::AbstractPhyloLikelihood::secondOrderDerivativeNode ( const std::string &  variable1,
const std::string &  variable2 
) const
inlineinherited

◆ setNumberOfSites()

void bpp::AbstractAlignedPhyloLikelihood::setNumberOfSites ( size_t  nbSites)
inlineprotected

◆ setParameters()

void bpp::AbstractPhyloLikelihood::setParameters ( const ParameterList parameters)
inlineoverridevirtualinherited

◆ shareParameters()

void bpp::AbstractPhyloLikelihood::shareParameters ( const ParameterList variableNodes)
inlineinherited

Member Data Documentation

◆ context_

◆ firstOrderDerivativeNodes_

std::unordered_map<std::string, ValueRef<DataLik> > bpp::AbstractPhyloLikelihood::firstOrderDerivativeNodes_
mutableprotectedinherited

For Dataflow computing.

Definition at line 44 of file AbstractPhyloLikelihood.h.

Referenced by bpp::AbstractPhyloLikelihood::firstOrderDerivativeNode().

◆ minusLogLik_

DataLik bpp::AbstractPhyloLikelihood::minusLogLik_
mutableprotectedinherited

◆ nbSites_

◆ secondOrderDerivativeNodes_

std::unordered_map<std::pair<std::string, std::string>, ValueRef<DataLik>, StringPairHash> bpp::AbstractPhyloLikelihood::secondOrderDerivativeNodes_
mutableprotectedinherited

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