5 #ifndef BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_ONABRANCHPHYLOLIKELIHOOD_H
6 #define BPP_PHYL_LIKELIHOOD_PHYLOLIKELIHOODS_ONABRANCHPHYLOLIKELIHOOD_H
12 #include <unordered_map>
14 #include "../DataFlow/DataFlowNumeric.h"
15 #include "../DataFlow/LikelihoodCalculationOnABranch.h"
16 #include "../DataFlow/Parameter.h"
35 mutable std::shared_ptr<LikelihoodCalculationOnABranch>
likCal_;
42 mutable std::unordered_map<std::pair<std::string, std::string>,
ValueRef<RowLik>,
48 std::shared_ptr<LikelihoodCalculationSingleProcess> likCal,
60 std::shared_ptr<LikelihoodCalculationSingleProcess> likCal,
70 std::shared_ptr<LikelihoodCalculationOnABranch> likCal,
84 std::shared_ptr<LikelihoodCalculationOnABranch> likCal) :
91 std::cerr <<
"OnABranchPhyloLikelihood(context, OnABranchPhyloLikelihood)" << std::endl;
95 std::cerr <<
"OnABranchPhyloLikelihood(context, OnABranchPhyloLikelihood)" << std::endl;
102 throw Exception(
"OnABranchPhyloLikelihood::clone should not be called.");
137 void setModel(std::shared_ptr<ConfiguredModel> model)
260 const std::string& variable2)
const
266 const std::string& variable2)
const
268 const auto key = std::make_pair (variable1, variable2);
virtual void shareParameters_(const ParameterList ¶meters)
const Context & context() const override
static Node_DF & accessVariableNode(const Parameter ¶m)
Context for dataflow node construction.
size_t getNumberOfDistinctSites() const
size_t getNumberOfSites() const
virtual bool isInitialized() const
Wraps a dataflow graph as a function: resultNode = f(variableNodes).
OnABranchPhyloLikelihood * clone() const override
bool isInitialized() const override
Get the number of model classes.
std::shared_ptr< LikelihoodCalculation > getLikelihoodCalculation() const override
ValueRef< RowLik > getSecondOrderDerivativeVector(const std::string &variable1, const std::string &variable2) const
std::unordered_map< std::pair< std::string, std::string >, ValueRef< RowLik >, StringPairHash > secondOrderDerivativeVectors_
size_t getNumberOfDistinctSites() const
OnABranchPhyloLikelihood(Context &context, std::shared_ptr< LikelihoodCalculationSingleProcess > likCal, uint edgeId, const ParameterList &variableNodes)
std::unordered_map< std::string, ValueRef< RowLik > > firstOrderDerivativeVectors_
For Dataflow computing.
ValueRef< RowLik > secondOrderDerivativeVector(const std::string &variable1, const std::string &variable2) const
VVDataLik getLikelihoodPerSitePerClass() const
Get the posterior probabilities of each class, for each site.
std::vector< size_t > getClassWithMaxPostProbPerSite() const
LikelihoodCalculation & likelihoodCalculation() const override
ParameterList getRootFrequenciesParameters() const override
Get the independent parameters associated to the root frequencies(s).
LikelihoodCalculationOnABranch & likelihoodCalculationOnABranch() const
ParameterList getBranchLengthParameters() const override
Get the independent branch lengths parameters.
OnABranchPhyloLikelihood(Context &context, std::shared_ptr< LikelihoodCalculationOnABranch > likCal, const ParameterList &variableNodes)
OnABranchPhyloLikelihood(Context &context, std::shared_ptr< LikelihoodCalculationSingleProcess > likCal, uint edgeId)
void setModel(std::shared_ptr< ConfiguredModel > model)
ValueRef< RowLik > getSecondOrderDerivativeVector(const std::string &variable) const
ValueRef< RowLik > getFirstOrderDerivativeVector(const std::string &variable) const
ParameterList getSubstitutionModelParameters() const override
Get the independent parameters associated to substitution model(s).
std::shared_ptr< LikelihoodCalculationOnABranch > likCal_
std::shared_ptr< AlignedLikelihoodCalculation > getAlignedLikelihoodCalculation() const override
std::shared_ptr< LikelihoodCalculationOnABranch > getLikelihoodCalculationOnABranch() const
ParameterList getRateDistributionParameters() const override
Get the independent parameters associated to the rate distribution(s).
ParameterList getNonDerivableParameters() const override
size_t getNumberOfSites() const override
Get the number of sites in the dataset.
OnABranchPhyloLikelihood(Context &context, std::shared_ptr< LikelihoodCalculationOnABranch > likCal)
: the parameters the independent parameters of the LikelihoodCalculation
AlignedLikelihoodCalculation & alignedLikelihoodCalculation() const override
ParameterList getDerivableParameters() const override
ValueRef< RowLik > firstOrderDerivativeVector(const std::string &variable) const
Defines the basic types of data flow nodes.
std::shared_ptr< Value< T > > ValueRef
Shared pointer alias for Value<T>.
std::vector< VDataLik > VVDataLik