5 #ifndef BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_ABSTRACTPHYLOLIKELIHOOD_H
6 #define BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_ABSTRACTPHYLOLIKELIHOOD_H
9 #include "../DataFlow/DataFlowNumeric.h"
10 #include "../DataFlow/LikelihoodCalculation.h"
11 #include "../DataFlow/Parametrizable.h"
16 class LikelihoodCalculation;
26 std::size_t
operator()(
const std::pair<std::string, std::string>& p)
const
28 std::hash<std::string> strHash{};
29 return strHash (p.first) ^ (strHash (p.second) << 1);
46 mutable std::unordered_map<std::pair<std::string, std::string>,
ValueRef<DataLik>,
134 using namespace numeric;
161 const std::string& variable2)
const override
164 using namespace numeric;
169 const std::string& variable2)
const
171 const auto key = std::make_pair (variable1, variable2);
virtual bool isInitialized() const override
Sets the computeLikelihoods_ to true.
double getFirstOrderDerivative(const std::string &variable) const override
std::unordered_map< std::pair< std::string, std::string >, ValueRef< DataLik >, StringPairHash > secondOrderDerivativeNodes_
bool enableSecondOrderDerivatives() const override
virtual void enableSecondOrderDerivatives(bool yn) override
double getSecondOrderDerivative(const std::string &variable1, const std::string &variable2) const override
DataLik minusLogLik_
the value
Context & context() override
bool enableFirstOrderDerivatives() const override
const Context & context() const override
ValueRef< DataLik > firstOrderDerivativeNode(const std::string &variable) const
virtual ~AbstractPhyloLikelihood()
ValueRef< DataLik > secondOrderDerivativeNode(const std::string &variable1, const std::string &variable2) const
virtual void enableFirstOrderDerivatives(bool yn) override
Tell if derivatives must be computed: for Function inheritance.
ValueRef< DataLik > getLikelihoodNode() const override
void shareParameters(const ParameterList &variableNodes)
Share Parameters, that are DF_parameters.
double getValue() const override
AbstractPhyloLikelihood(const AbstractPhyloLikelihood &apl)
Node_DF & accessVariableNode(const std::string &name) const
AbstractPhyloLikelihood & operator=(const AbstractPhyloLikelihood &apl)
void setParameters(const ParameterList ¶meters) override
AbstractPhyloLikelihood(Context &context)
double getSecondOrderDerivative(const std::string &variable) const override
std::unordered_map< std::string, ValueRef< DataLik > > firstOrderDerivativeNodes_
For Dataflow computing.
static Node_DF & accessVariableNode(const Parameter ¶m)
Context for dataflow node construction.
Base dataflow Node class.
virtual void shareParameters(const ParameterList ¶ms)
virtual const ParameterList & getParameters() const=0
virtual const Parameter & parameter(const std::string &name) const=0
virtual ParameterList & getParameters_()=0
virtual void setParametersValues(const ParameterList ¶meters)=0
The PhyloLikelihood interface, for phylogenetic likelihood.
virtual std::shared_ptr< LikelihoodCalculation > getLikelihoodCalculation() const =0
Defines the basic types of data flow nodes.
std::shared_ptr< Value< T > > ValueRef
Shared pointer alias for Value<T>.
double convert(const bpp::ExtendedFloat &ef)
std::size_t operator()(const std::pair< std::string, std::string > &p) const