5 #ifndef BPP_PHYL_PARSIMONY_DRTREEPARSIMONYSCORE_H
6 #define BPP_PHYL_PARSIMONY_DRTREEPARSIMONYSCORE_H
9 #include "../Tree/NNISearchable.h"
10 #include "../Tree/TreeTools.h"
32 std::shared_ptr<const SiteContainerInterface> data,
34 bool includeGaps =
false);
38 std::shared_ptr<const SiteContainerInterface> data,
39 std::shared_ptr<const StateMapInterface> statesMap,
51 void init_(std::shared_ptr<const SiteContainerInterface> data,
bool verbose);
70 unsigned int getScore()
const override;
82 std::vector<Bitset>& rBitsets,
83 std::vector<unsigned int>& rScores);
96 std::vector<Bitset>& rBitsets,
97 std::vector<unsigned int>& rScores);
108 std::vector<unsigned int>& rScores);
123 const std::vector<
const std::vector<Bitset>*>& iBitsets,
124 const std::vector<
const std::vector<unsigned int>*>& iScores,
125 std::vector<Bitset>& oBitsets,
126 std::vector<unsigned int>& oScores);
135 double testNNI(
int nodeId)
const override;
137 void doNNI(
int nodeId)
override;
Partial implementation of the TreeParsimonyScore interface.
const Tree & tree() const override
Get the tree for which scores are computed.
Parsimony data structure for a node.
Double recursive implementation of interface TreeParsimonyScore.
static void computeScoresPostorderForNode(const DRTreeParsimonyNodeData &pData, std::vector< Bitset > &rBitsets, std::vector< unsigned int > &rScores)
Compute bitsets and scores for each site for a node, in postorder.
void init_(std::shared_ptr< const SiteContainerInterface > data, bool verbose)
static void computeScoresFromArrays(const std::vector< const std::vector< Bitset > * > &iBitsets, const std::vector< const std::vector< unsigned int > * > &iScores, std::vector< Bitset > &oBitsets, std::vector< unsigned int > &oScores)
Compute bitsets and scores from an array of arrays.
unsigned int getScoreForSite(size_t site) const override
Get the score for a given site for the current tree, i.e. the total minimum number of changes in the ...
void topologyChangeSuccessful(const TopologyChangeEvent &event) override
Tell that a topology change is definitive.
void topologyChangeTested(const TopologyChangeEvent &event) override
Notify a topology change event.
virtual void computeScoresPreorder(const Node *)
Compute scores (preorder algorithm).
DRTreeParsimonyScore(std::shared_ptr< TreeTemplate< Node >> tree, std::shared_ptr< const SiteContainerInterface > data, bool verbose=true, bool includeGaps=false)
std::unique_ptr< DRTreeParsimonyData > parsimonyData_
DRTreeParsimonyScore & operator=(const DRTreeParsimonyScore &tp)
unsigned int getScore() const override
Get the score for the current tree, i.e. the total minimum number of changes in the tree.
const Tree & topology() const override
Get the tree associated to this NNISearchable object.
DRTreeParsimonyScore * clone() const override
virtual void computeScores()
Compute all scores.
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.
static void computeScoresForNode(const DRTreeParsimonyNodeData &pData, std::vector< Bitset > &rBitsets, std::vector< unsigned int > &rScores)
Compute bitsets and scores for each site for a node, in all directions.
virtual void computeScoresPostorder(const Node *)
Compute scores (postorder algorithm).
virtual ~DRTreeParsimonyScore()
void doNNI(int nodeId) override
Perform a NNI movement.
static void computeScoresPreorderForNode(const DRTreeParsimonyNodeData &pData, const Node *source, std::vector< Bitset > &rBitsets, std::vector< unsigned int > &rScores)
Compute bitsets and scores for each site for a node, in preorder.
Interface for Nearest Neighbor Interchanges algorithms.
The phylogenetic node class.
Class for notifying new toplogy change events.
The phylogenetic tree class.
Interface for phylogenetic tree objects.
Defines the basic types of data flow nodes.