5 #ifndef BPP_PHYL_LEGACY_LIKELIHOOD_NNIHOMOGENEOUSTREELIKELIHOOD_H
6 #define BPP_PHYL_LEGACY_LIKELIHOOD_NNIHOMOGENEOUSTREELIKELIHOOD_H
13 #include "../../Tree/NNISearchable.h"
33 std::shared_ptr<const TransitionModelInterface>
model_;
34 std::shared_ptr<const DiscreteDistributionInterface>
rDist_;
71 AbstractParametrizable::operator=(bl);
90 std::shared_ptr<const TransitionModelInterface> model,
91 std::shared_ptr<const DiscreteDistributionInterface> rDist);
164 std::shared_ptr<TransitionModelInterface> model,
165 std::shared_ptr<DiscreteDistributionInterface> rDist,
166 bool checkRooted =
true,
167 bool verbose =
true);
184 std::shared_ptr<TransitionModelInterface> model,
185 std::shared_ptr<DiscreteDistributionInterface> rDist,
186 bool checkRooted =
true,
187 bool verbose =
true);
222 double testNNI(
int nodeId)
const override;
224 void doNNI(
int nodeId)
override;
virtual void addParameter_(Parameter *parameter)
void setParametersValues(const ParameterList ¶meters) override
const AlignmentDataInterface & data() const
Get the dataset for which the likelihood must be evaluated.
const Tree & tree() const
Get the tree (topology and branch lengths).
Compute likelihood for a 4-tree.
void setParameters(const ParameterList ¶meters)
const VVVdouble * array2_
void fireParameterChanged(const ParameterList ¶meters)
virtual ~BranchLikelihood()
BranchLikelihood(const std::vector< unsigned int > &weights)
std::vector< unsigned int > weights_
BranchLikelihood & operator=(const BranchLikelihood &bl)
const VVVdouble * array1_
std::shared_ptr< const DiscreteDistributionInterface > rDist_
BranchLikelihood * clone() const
std::shared_ptr< const TransitionModelInterface > model_
void initModel(std::shared_ptr< const TransitionModelInterface > model, std::shared_ptr< const DiscreteDistributionInterface > rDist)
void computeLogLikelihood()
void computeAllTransitionProbabilities()
void initLikelihoods(const VVVdouble *array1, const VVVdouble *array2)
BranchLikelihood(const BranchLikelihood &bl)
void reInit()
Rebuild likelihood arrays at inner nodes.
This class implements the likelihood computation for a tree using the double-recursive algorithm.
virtual void fireParameterChanged(const ParameterList ¶ms) override
double getValue() const override
Function and NNISearchable interface.
void setData(const AlignmentDataInterface &sites) override
Set the dataset for which the likelihood must be evaluated.
DRASDRTreeLikelihoodData & likelihoodData() override
This class adds support for NNI topology estimation to the DRHomogeneousTreeLikelihood class.
NNIHomogeneousTreeLikelihood(const Tree &tree, std::shared_ptr< TransitionModelInterface > model, std::shared_ptr< DiscreteDistributionInterface > rDist, bool checkRooted=true, bool verbose=true)
Build a new NNIHomogeneousTreeLikelihood object.
void topologyChangeTested(const TopologyChangeEvent &event) override
Notify a topology change event.
void setData(const AlignmentDataInterface &sites) override
Set the dataset for which the likelihood must be evaluated.
NNIHomogeneousTreeLikelihood & operator=(const NNIHomogeneousTreeLikelihood &lik)
std::shared_ptr< BranchLikelihood > brLikFunction_
std::map< int, double > brLenNNIValues_
Hash used for backing up branch lengths when testing NNIs.
virtual ~NNIHomogeneousTreeLikelihood()
void topologyChangeSuccessful(const TopologyChangeEvent &event) override
Tell that a topology change is definitive.
const Tree & topology() const override
Get the tree associated to this NNISearchable object.
std::unique_ptr< BrentOneDimension > brentOptimizer_
Optimizer used for testing NNI.
NNIHomogeneousTreeLikelihood * clone() const override
void doNNI(int nodeId) override
Perform a NNI movement.
double getTopologyValue() const override
Get the current score of this NNISearchable object.
double testNNI(int nodeId) const override
Send the score of a NNI movement, without performing it.
ParameterList brLenNNIParams_
Interface for Nearest Neighbor Interchanges algorithms.
Class for notifying new toplogy change events.
Interface for phylogenetic tree objects.
Defines the basic types of data flow nodes.
double log(const ExtendedFloat &ef)
std::vector< VVdouble > VVVdouble