40 #ifndef _NNIHOMOGENEOUSTREELIKELIHOOD_H_ 41 #define _NNIHOMOGENEOUSTREELIKELIHOOD_H_ 44 #include "../NNISearchable.h" 46 #include <Bpp/Numeric/VectorTools.h> 47 #include <Bpp/Numeric/Parametrizable.h> 48 #include <Bpp/Numeric/Prob/DiscreteDistribution.h> 49 #include <Bpp/Numeric/Function/BrentOneDimension.h> 64 public AbstractParametrizable
77 AbstractParametrizable(
""),
88 addParameter_(
new Parameter(
"BrLen", 1, 0));
92 AbstractParametrizable(bl),
106 AbstractParametrizable::operator=(bl);
143 throw (ParameterNotFoundException, ConstraintException)
145 setParametersValues(parameters);
198 DiscreteDistribution* rDist,
199 bool checkRooted =
true,
217 const SiteContainer& data,
219 DiscreteDistribution* rDist,
220 bool checkRooted = true,
233 #ifndef NO_VIRTUAL_COV 241 void setData(
const SiteContainer& sites)
throw (Exception)
283 #endif // _NNIHOMOGENEOUSTREELIKELIHOOD_H_ void topologyChangeTested(const TopologyChangeEvent &event)
Notify a topology change event.
Interface for all substitution models.
BranchLikelihood(const BranchLikelihood &bl)
void fireParameterChanged(const ParameterList ¶meters)
BranchLikelihood & operator=(const BranchLikelihood &bl)
Interface for Nearest Neighbor Interchanges algorithms.
const Tree & getTopology() const
Get the tree associated to this NNISearchable object.
void topologyChangeSuccessful(const TopologyChangeEvent &event)
Tell that a topology change is definitive.
void initModel(const SubstitutionModel *model, const DiscreteDistribution *rDist)
This class adds support for NNI topology estimation to the DRHomogeneousTreeLikelihood class...
Interface for phylogenetic tree objects.
DRASDRTreeLikelihoodData * getLikelihoodData()
BrentOneDimension * brentOptimizer_
Optimizer used for testing NNI.
void setData(const SiteContainer &sites)
Set the dataset for which the likelihood must be evaluated.
BranchLikelihood * clone() const
double getValue() const
Function and NNISearchable interface.
NNIHomogeneousTreeLikelihood(const Tree &tree, SubstitutionModel *model, DiscreteDistribution *rDist, bool checkRooted=true, bool verbose=true)
Build a new NNIHomogeneousTreeLikelihood object.
void initLikelihoods(const VVVdouble *array1, const VVVdouble *array2)
void reInit()
Rebuild likelihood arrays at inner nodes.
void setData(const SiteContainer &sites)
Set the dataset for which the likelihood must be evaluated.
const VVVdouble * array2_
std::map< int, double > brLenNNIValues_
Hash used for backing up branch lengths when testing NNIs.
std::vector< unsigned int > weights_
virtual void fireParameterChanged(const ParameterList ¶ms)
This class implements the likelihood computation for a tree using the double-recursive algorithm...
BranchLikelihood(const std::vector< unsigned int > &weights)
ParameterList brLenNNIParams_
void computeLogLikelihood()
Class for notifying new toplogy change events.
BranchLikelihood * brLikFunction_
const Tree & getTree() const
Get the tree (topology and branch lengths).
const SubstitutionModel * model_
Compute likelihood for a 4-tree.
NNIHomogeneousTreeLikelihood * clone() const
double getTopologyValue() const
Get the current score of this NNISearchable object.
virtual ~BranchLikelihood()
void doNNI(int nodeId)
Perform a NNI movement.
const DiscreteDistribution * rDist_
void setParameters(const ParameterList ¶meters)
General exception thrown when something is wrong with a particular node.
double testNNI(int nodeId) const
Send the score of a NNI movement, without performing it.
const VVVdouble * array1_
void computeAllTransitionProbabilities()