5 #ifndef BPP_PHYL_PARSIMONY_DRTREEPARSIMONYDATA_H
6 #define BPP_PHYL_PARSIMONY_DRTREEPARSIMONYDATA_H
9 #include "../Model/StateMap.h"
164 mutable std::map<int, DRTreeParsimonyNodeData>
nodeData_;
165 mutable std::map<int, DRTreeParsimonyLeafData>
leafData_;
209 int id = it.second.getNode()->getId();
210 it.second.setNode(
tree_->getNode(
id));
214 int id = it.second.getNode()->getId();
215 it.second.setNode(
tree_->getNode(
id));
239 return nodeData_[nodeId].getBitsetsArrayForNeighbor(neighborId);
243 return nodeData_[nodeId].getBitsetsArrayForNeighbor(neighborId);
248 return nodeData_[nodeId].getScoresArrayForNeighbor(neighborId);
250 const std::vector<unsigned int>&
getScoresArray(
int nodeId,
int neighborId)
const
252 return nodeData_[nodeId].getScoresArrayForNeighbor(neighborId);
257 return currentPosition;
272 void init(std::shared_ptr<const SiteContainerInterface> sites,
273 std::shared_ptr<const StateMapInterface> stateMap);
278 std::shared_ptr<const SiteContainerInterface> sites,
279 std::shared_ptr<const StateMapInterface> stateMap);
Partial implementation of the TreeParsimonyData interface.
const TreeTemplate< Node > & tree() const override
void setTree(std::shared_ptr< const TreeTemplate< Node >> tree)
std::shared_ptr< const TreeTemplate< Node > > tree_
Parsimony data structure for double-recursive (DR) algorithm.
const std::vector< unsigned int > & getRootScores() const
DRTreeParsimonyNodeData & nodeData(int nodeId) override
std::unique_ptr< SiteContainerInterface > shrunkData_
std::vector< unsigned int > & getScoresArray(int nodeId, int neighborId)
void reInit_(const Node *node)
const DRTreeParsimonyNodeData & nodeData(int nodeId) const override
size_t getNumberOfDistinctSites() const
std::vector< Bitset > rootBitsets_
unsigned int getRootScore(size_t i) const
const std::vector< Bitset > & getRootBitsets() const
void init(std::shared_ptr< const SiteContainerInterface > sites, std::shared_ptr< const StateMapInterface > stateMap)
DRTreeParsimonyData * clone() const override
void setTree(std::shared_ptr< const TreeTemplate< Node >> tree)
Set the tree associated to the data.
const std::vector< unsigned int > & getScoresArray(int nodeId, int neighborId) const
size_t getArrayPosition(int parentId, int sonId, size_t currentPosition) const override
void init_(const Node *node, std::shared_ptr< const SiteContainerInterface > sites, std::shared_ptr< const StateMapInterface > stateMap)
std::map< int, DRTreeParsimonyLeafData > leafData_
DRTreeParsimonyData & operator=(const DRTreeParsimonyData &data)
DRTreeParsimonyData(std::shared_ptr< const TreeTemplate< Node >> tree)
std::vector< Bitset > & getBitsetsArray(int nodeId, int neighborId)
std::vector< Bitset > & getRootBitsets()
size_t getNumberOfStates() const
const Bitset & getRootBitset(size_t i) const
virtual ~DRTreeParsimonyData()
DRTreeParsimonyLeafData & leafData(int nodeId)
const std::vector< Bitset > & getBitsetsArray(int nodeId, int neighborId) const
std::vector< unsigned int > & getRootScores()
std::vector< unsigned int > rootScores_
const DRTreeParsimonyLeafData & leafData(int nodeId) const
size_t getNumberOfSites() const
std::map< int, DRTreeParsimonyNodeData > nodeData_
Parsimony data structure for a leaf.
DRTreeParsimonyLeafData * clone() const
std::vector< Bitset > & getBitsetsArray()
const Node * getNode() const
Get the node associated to this data structure.
void setNode(const Node *node)
Set the node associated to this data.
DRTreeParsimonyLeafData & operator=(const DRTreeParsimonyLeafData &tpld)
const std::vector< Bitset > & getBitsetsArray() const
DRTreeParsimonyLeafData()
std::vector< Bitset > leafBitsets_
DRTreeParsimonyLeafData(const DRTreeParsimonyLeafData &tpld)
Parsimony data structure for a node.
DRTreeParsimonyNodeData(const DRTreeParsimonyNodeData &tpnd)
std::vector< Bitset > & getBitsetsArrayForNeighbor(int neighborId)
DRTreeParsimonyNodeData & operator=(const DRTreeParsimonyNodeData &tpnd)
const std::vector< Bitset > & getBitsetsArrayForNeighbor(int neighborId) const
const Node * getNode() const
Get the node associated to this data structure.
DRTreeParsimonyNodeData()
const std::vector< unsigned int > & getScoresArrayForNeighbor(int neighborId) const
bool isNeighbor(int neighborId) const
std::map< int, std::vector< Bitset > > nodeBitsets_
std::vector< unsigned int > & getScoresArrayForNeighbor(int neighborId)
DRTreeParsimonyNodeData * clone() const
void setNode(const Node *node)
Set the node associated to this data.
std::map< int, std::vector< unsigned int > > nodeScores_
void eraseNeighborArrays()
The phylogenetic node class.
TreeParsimonyScore node data structure.
The phylogenetic tree class.
Defines the basic types of data flow nodes.