bpp-phyl3  3.0.0
bpp::AbstractPhyloLikelihood Class Referenceabstract

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

+ Inheritance diagram for bpp::AbstractPhyloLikelihood:
+ Collaboration diagram for bpp::AbstractPhyloLikelihood:

Classes

struct  StringPairHash
 

Public Member Functions

 AbstractPhyloLikelihood (Context &context)
 
 AbstractPhyloLikelihood (const AbstractPhyloLikelihood &apl)
 
AbstractPhyloLikelihoodoperator= (const AbstractPhyloLikelihood &apl)
 
virtual ~AbstractPhyloLikelihood ()
 
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...
 
virtual void enableSecondOrderDerivatives (bool yn) override
 
bool enableFirstOrderDerivatives () const 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
 
PhyloLikelihoodInterfaceclone () const =0
 
virtual LikelihoodCalculationlikelihoodCalculation () const =0
 
virtual std::shared_ptr< LikelihoodCalculationgetLikelihoodCalculation () 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 double df (const std::string &variable, const ParameterList &parameters)
 
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
 
The likelihood functions.
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

Node_DFaccessVariableNode (const std::string &name) const
 
virtual ParameterListgetParameters_ ()=0
 

Static Protected Member Functions

static Node_DFaccessVariableNode (const Parameter &param)
 

Protected Attributes

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 18 of file AbstractPhyloLikelihood.h.

Constructor & Destructor Documentation

◆ AbstractPhyloLikelihood() [1/2]

bpp::AbstractPhyloLikelihood::AbstractPhyloLikelihood ( Context context)
inline

Definition at line 51 of file AbstractPhyloLikelihood.h.

◆ AbstractPhyloLikelihood() [2/2]

bpp::AbstractPhyloLikelihood::AbstractPhyloLikelihood ( const AbstractPhyloLikelihood apl)
inline

◆ ~AbstractPhyloLikelihood()

virtual bpp::AbstractPhyloLikelihood::~AbstractPhyloLikelihood ( )
inlinevirtual

Definition at line 71 of file AbstractPhyloLikelihood.h.

Member Function Documentation

◆ accessVariableNode() [1/2]

◆ accessVariableNode() [2/2]

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

◆ clone()

◆ context() [1/2]

◆ context() [2/2]

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

Implements bpp::PhyloLikelihoodInterface.

Definition at line 75 of file AbstractPhyloLikelihood.h.

References context_.

◆ enableFirstOrderDerivatives() [1/2]

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

Implements bpp::SecondOrderDerivable.

Definition at line 115 of file AbstractPhyloLikelihood.h.

◆ enableFirstOrderDerivatives() [2/2]

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

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
inlineoverridevirtual

Implements bpp::SecondOrderDerivable.

Definition at line 116 of file AbstractPhyloLikelihood.h.

◆ enableSecondOrderDerivatives() [2/2]

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

Implements bpp::SecondOrderDerivable.

Definition at line 114 of file AbstractPhyloLikelihood.h.

◆ firstOrderDerivativeNode()

ValueRef<DataLik> bpp::AbstractPhyloLikelihood::firstOrderDerivativeNode ( const std::string &  variable) const
inline

◆ 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
inlineoverridevirtual

Implements bpp::SecondOrderDerivable.

Definition at line 131 of file AbstractPhyloLikelihood.h.

References bpp::convert(), and firstOrderDerivativeNode().

◆ getLikelihoodCalculation()

◆ getLikelihoodNode()

ValueRef<DataLik> bpp::AbstractPhyloLikelihood::getLikelihoodNode ( ) const
inlineoverridevirtual
Returns
the LikDF node where the Likelihood is computed.

Implements bpp::PhyloLikelihoodInterface.

Definition at line 100 of file AbstractPhyloLikelihood.h.

References bpp::PhyloLikelihoodInterface::getLikelihoodCalculation().

Referenced by firstOrderDerivativeNode(), and getValue().

◆ 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().

◆ getNonDerivableParameters()

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

◆ 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
inlineoverridevirtual

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
inlineoverridevirtual

Implements bpp::SecondOrderDerivable.

Definition at line 160 of file AbstractPhyloLikelihood.h.

References bpp::convert(), and secondOrderDerivativeNode().

◆ 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
inlineoverridevirtual

◆ isInitialized()

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

◆ likelihoodCalculation()

◆ operator=()

◆ secondOrderDerivativeNode()

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

◆ setParameters()

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

◆ shareParameters()

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

Share Parameters, that are DF_parameters.

Definition at line 90 of file AbstractPhyloLikelihood.h.

References bpp::SecondOrderDerivable::getParameters_(), and bpp::ParameterList::shareParameters().

Referenced by AbstractPhyloLikelihood(), and operator=().

Member Data Documentation

◆ context_

◆ firstOrderDerivativeNodes_

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

For Dataflow computing.

Definition at line 44 of file AbstractPhyloLikelihood.h.

Referenced by firstOrderDerivativeNode().

◆ minusLogLik_

DataLik bpp::AbstractPhyloLikelihood::minusLogLik_
mutableprotected

the value

Definition at line 39 of file AbstractPhyloLikelihood.h.

Referenced by getValue(), and operator=().

◆ secondOrderDerivativeNodes_

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

Definition at line 48 of file AbstractPhyloLikelihood.h.

Referenced by secondOrderDerivativeNode().


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