40 #ifndef _DRTREEPARSIMONYSCORE_H_ 41 #define _DRTREEPARSIMONYSCORE_H_ 45 #include "../NNISearchable.h" 46 #include "../TreeTools.h" 66 const SiteContainer& data,
68 bool includeGaps =
false)
73 const SiteContainer& data,
84 #ifndef NO_VIRTUAL_COV 92 void init_(
const SiteContainer& data,
bool verbose);
123 std::vector<Bitset>& rBitsets,
124 std::vector<unsigned int>& rScores);
137 std::vector<Bitset>& rBitsets,
138 std::vector<unsigned int>& rScores);
149 std::vector<unsigned int>& rScores);
164 const std::vector<
const std::vector<Bitset>*>& iBitsets,
165 const std::vector<
const std::vector<unsigned int>*>& iScores,
166 std::vector<Bitset>& oBitsets,
167 std::vector<unsigned int>& oScores);
194 #endif // _DRTREEPARSIMONYSCORE_H_ Parsimony data structure for a node.
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.
double testNNI(int nodeId) const
Send the score of a NNI movement, without performing it.
Double recursive implementation of interface TreeParsimonyScore.
Interface for Nearest Neighbor Interchanges algorithms.
Interface for phylogenetic tree objects.
virtual void computeScoresPreorder(const Node *)
Compute scores (preorder algorithm).
void init_(const SiteContainer &data, bool verbose)
void doNNI(int nodeId)
Perform a NNI movement.
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.
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 topologyChangeSuccessful(const TopologyChangeEvent &event)
Tell that a topology change is definitive.
virtual void computeScoresPostorder(const Node *)
Compute scores (postorder algorithm).
void topologyChangeTested(const TopologyChangeEvent &event)
Notify a topology change event.
Class for notifying new toplogy change events.
The phylogenetic node class.
Partial implementation of the TreeParsimonyScore interface.
virtual void computeScores()
Compute all scores.
Parsimony data structure for double-recursive (DR) algorithm.
DRTreeParsimonyData * parsimonyData_
DRTreeParsimonyScore * clone() const
unsigned int getScore() const
Get the score for the current tree, i.e. the total minimum number of changes in the tree...
const Tree & getTopology() const
Get the tree associated to this NNISearchable object.
Map the states of a given alphabet which have a model state.
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.
unsigned int getScoreForSite(size_t site) const
Get the score for a given site for the current tree, i.e. the total minimum number of changes in the ...
General exception thrown when something is wrong with a particular node.
DRTreeParsimonyScore(const Tree &tree, const SiteContainer &data, bool verbose=true, bool includeGaps=false)
double getTopologyValue() const
Get the current score of this NNISearchable object.
virtual const Tree & getTree() const
Get the tree for wich scores are computed.