41 #ifndef _DRTREEPARSIMONYDATA_H_ 42 #define _DRTREEPARSIMONYDATA_H_ 45 #include "../Model/StateMap.h" 48 #include <Bpp/Seq/Container/SiteContainer.h> 73 mutable std::map<int, std::vector<unsigned int> >
nodeScores_;
199 mutable std::map<int, DRTreeParsimonyNodeData>
nodeData_;
200 mutable std::map<int, DRTreeParsimonyLeafData>
leafData_;
242 for (std::map<int, DRTreeParsimonyNodeData>::iterator it =
nodeData_.begin(); it !=
nodeData_.end(); it++)
244 int id = it->second.getNode()->getId();
245 it->second.setNode(
tree_->getNode(
id));
247 for (std::map<int, DRTreeParsimonyLeafData>::iterator it =
leafData_.begin(); it !=
leafData_.end(); it++)
249 int id = it->second.getNode()->getId();
250 it->second.setNode(
tree_->getNode(
id));
274 return nodeData_[nodeId].getBitsetsArrayForNeighbor(neighborId);
278 return nodeData_[nodeId].getBitsetsArrayForNeighbor(neighborId);
283 return nodeData_[nodeId].getScoresArrayForNeighbor(neighborId);
285 const std::vector<unsigned int>&
getScoresArray(
int nodeId,
int neighborId)
const 287 return nodeData_[nodeId].getScoresArrayForNeighbor(neighborId);
292 return currentPosition;
307 void init(
const SiteContainer& sites,
const StateMap& stateMap)
throw (Exception);
308 void reInit() throw (Exception);
311 void init(const
Node* node, const SiteContainer& sites, const
StateMap& stateMap) throw (Exception);
312 void reInit(const
Node* node) throw (Exception);
316 #endif // _DRTREEPARSIMONYDATA_H_ Parsimony data structure for a node.
unsigned int getRootScore(size_t i) const
virtual ~DRTreeParsimonyData()
std::map< int, std::vector< Bitset > > nodeBitsets_
std::vector< Bitset > & getBitsetsArrayForNeighbor(int neighborId)
void setTree(const TreeTemplate< Node > *tree)
Set the tree associated to the data.
DRTreeParsimonyNodeData(const DRTreeParsimonyNodeData &tpnd)
std::vector< Bitset > leafBitsets_
DRTreeParsimonyNodeData & operator=(const DRTreeParsimonyNodeData &tpnd)
DRTreeParsimonyNodeData()
const std::vector< Bitset > & getBitsetsArrayForNeighbor(int neighborId) const
TreeParsimonyScore node data structure.
const std::vector< Bitset > & getRootBitsets() const
std::map< int, std::vector< unsigned int > > nodeScores_
std::vector< unsigned int > & getScoresArray(int nodeId, int neighborId)
const DRTreeParsimonyLeafData & getLeafData(int nodeId) const
The phylogenetic tree class.
DRTreeParsimonyLeafData * clone() const
const Bitset & getRootBitset(size_t i) const
std::vector< Bitset > & getBitsetsArray(int nodeId, int neighborId)
bool isNeighbor(int neighborId) const
const TreeTemplate< Node > * tree_
DRTreeParsimonyNodeData & getNodeData(int nodeId)
void setNode(const Node *node)
Set the node associated to this data.
std::vector< unsigned int > & getRootScores()
std::vector< unsigned int > & getScoresArrayForNeighbor(int neighborId)
Parsimony data structure for a leaf.
SiteContainer * shrunkData_
void setTreeP_(const TreeTemplate< Node > *tree)
std::map< int, DRTreeParsimonyLeafData > leafData_
const Node * getNode() const
Get the node associated to this data structure.
const Node * getNode() const
Get the node associated to this data structure.
const DRTreeParsimonyNodeData & getNodeData(int nodeId) const
void init(const SiteContainer &sites, const StateMap &stateMap)
const std::vector< unsigned int > & getScoresArrayForNeighbor(int neighborId) const
std::vector< Bitset > & getRootBitsets()
const std::vector< Bitset > & getBitsetsArray(int nodeId, int neighborId) const
DRTreeParsimonyLeafData(const DRTreeParsimonyLeafData &tpld)
std::vector< unsigned int > rootScores_
size_t getNumberOfDistinctSites() const
DRTreeParsimonyData * clone() const
The phylogenetic node class.
size_t getNumberOfSites() const
DRTreeParsimonyData & operator=(const DRTreeParsimonyData &data)
const std::vector< Bitset > & getBitsetsArray() const
const std::vector< unsigned int > & getRootScores() const
std::map< int, DRTreeParsimonyNodeData > nodeData_
Parsimony data structure for double-recursive (DR) algorithm.
DRTreeParsimonyData(const TreeTemplate< Node > *tree)
const std::vector< unsigned int > & getScoresArray(int nodeId, int neighborId) const
Partial implementation of the TreeParsimonyData interface.
size_t getArrayPosition(int parentId, int sonId, size_t currentPosition) const
size_t getNumberOfStates() const
std::vector< Bitset > & getBitsetsArray()
std::vector< Bitset > rootBitsets_
DRTreeParsimonyLeafData()
DRTreeParsimonyNodeData * clone() const
void eraseNeighborArrays()
Map the states of a given alphabet which have a model state.
void setNode(const Node *node)
Set the node associated to this data.
DRTreeParsimonyLeafData & operator=(const DRTreeParsimonyLeafData &tpld)
DRTreeParsimonyLeafData & getLeafData(int nodeId)