bpp-phyl  2.2.0
 All Classes Namespaces Files Functions Variables Typedefs Friends Pages
bpp::DRTreeParsimonyData Class Reference

Parsimony data structure for double-recursive (DR) algorithm. More...

#include <Bpp/Phyl/Parsimony/DRTreeParsimonyData.h>

+ Inheritance diagram for bpp::DRTreeParsimonyData:
+ Collaboration diagram for bpp::DRTreeParsimonyData:

Public Member Functions

 DRTreeParsimonyData (const TreeTemplate< Node > *tree)
 
 DRTreeParsimonyData (const DRTreeParsimonyData &data)
 
DRTreeParsimonyDataoperator= (const DRTreeParsimonyData &data)
 
virtual ~DRTreeParsimonyData ()
 
DRTreeParsimonyDataclone () const
 
void setTree (const TreeTemplate< Node > *tree)
 Set the tree associated to the data. More...
 
DRTreeParsimonyNodeDatagetNodeData (int nodeId)
 
const DRTreeParsimonyNodeDatagetNodeData (int nodeId) const
 
DRTreeParsimonyLeafDatagetLeafData (int nodeId)
 
const DRTreeParsimonyLeafDatagetLeafData (int nodeId) const
 
std::vector< Bitset > & getBitsetsArray (int nodeId, int neighborId)
 
const std::vector< Bitset > & getBitsetsArray (int nodeId, int neighborId) const
 
std::vector< unsigned int > & getScoresArray (int nodeId, int neighborId)
 
const std::vector< unsigned int > & getScoresArray (int nodeId, int neighborId) const
 
size_t getArrayPosition (int parentId, int sonId, size_t currentPosition) const
 
std::vector< Bitset > & getRootBitsets ()
 
const std::vector< Bitset > & getRootBitsets () const
 
const Bitset & getRootBitset (size_t i) const
 
std::vector< unsigned int > & getRootScores ()
 
const std::vector< unsigned int > & getRootScores () const
 
unsigned int getRootScore (size_t i) const
 
size_t getNumberOfDistinctSites () const
 
size_t getNumberOfSites () const
 
size_t getNumberOfStates () const
 
void init (const SiteContainer &sites, const StateMap &stateMap) throw (Exception)
 
void reInit () throw (Exception)
 
size_t getRootArrayPosition (size_t site) const
 
unsigned int getWeight (size_t pos) const
 
const TreeTemplate< Node > * getTree () const
 

Protected Member Functions

void init (const Node *node, const SiteContainer &sites, const StateMap &stateMap) throw (Exception)
 
void reInit (const Node *node) throw (Exception)
 
void setTreeP_ (const TreeTemplate< Node > *tree)
 
const TreeTemplate< Node > * getTreeP_ () const
 

Protected Attributes

std::vector< size_t > rootPatternLinks_
 
std::vector< unsigned int > rootWeights_
 
const TreeTemplate< Node > * tree_
 

Private Attributes

std::map< int,
DRTreeParsimonyNodeData
nodeData_
 
std::map< int,
DRTreeParsimonyLeafData
leafData_
 
std::vector< Bitset > rootBitsets_
 
std::vector< unsigned int > rootScores_
 
SiteContainershrunkData_
 
size_t nbSites_
 
size_t nbStates_
 
size_t nbDistinctSites_
 

Detailed Description

Parsimony data structure for double-recursive (DR) algorithm.

States are coded using bitsets for faster computing (

See Also
AbstractTreeParsimonyData). For each inner node in the tree, we store a DRTreeParsimonyNodeData object in nodeData_. For each leaf node in the tree, we store a DRTreeParsimonyLeafData object in leafData_.

The dataset is first compressed, removing all identical sites. The resulting dataset is stored in shrunkData_. The corresponding positions are stored in rootPatternLinks_, inherited from AbstractTreeParsimonyData.

Definition at line 195 of file DRTreeParsimonyData.h.

Constructor & Destructor Documentation

bpp::DRTreeParsimonyData::DRTreeParsimonyData ( const TreeTemplate< Node > *  tree)
inline

Definition at line 209 of file DRTreeParsimonyData.h.

Referenced by clone().

DRTreeParsimonyData::DRTreeParsimonyData ( const DRTreeParsimonyData data)

Definition at line 52 of file DRTreeParsimonyData.cpp.

References bpp::SiteContainer::clone(), and shrunkData_.

virtual bpp::DRTreeParsimonyData::~DRTreeParsimonyData ( )
inlinevirtual

Definition at line 225 of file DRTreeParsimonyData.h.

References shrunkData_.

Member Function Documentation

DRTreeParsimonyData* bpp::DRTreeParsimonyData::clone ( ) const
inlinevirtual

Implements bpp::TreeParsimonyData.

Definition at line 227 of file DRTreeParsimonyData.h.

References DRTreeParsimonyData().

Referenced by bpp::DRTreeParsimonyScore::operator=().

size_t bpp::DRTreeParsimonyData::getArrayPosition ( int  parentId,
int  sonId,
size_t  currentPosition 
) const
inlinevirtual

Implements bpp::TreeParsimonyData.

Definition at line 290 of file DRTreeParsimonyData.h.

std::vector<Bitset>& bpp::DRTreeParsimonyData::getBitsetsArray ( int  nodeId,
int  neighborId 
)
inline

Definition at line 272 of file DRTreeParsimonyData.h.

References nodeData_.

const std::vector<Bitset>& bpp::DRTreeParsimonyData::getBitsetsArray ( int  nodeId,
int  neighborId 
) const
inline

Definition at line 276 of file DRTreeParsimonyData.h.

References nodeData_.

DRTreeParsimonyLeafData& bpp::DRTreeParsimonyData::getLeafData ( int  nodeId)
inline
const DRTreeParsimonyLeafData& bpp::DRTreeParsimonyData::getLeafData ( int  nodeId) const
inline

Definition at line 267 of file DRTreeParsimonyData.h.

References leafData_.

DRTreeParsimonyNodeData& bpp::DRTreeParsimonyData::getNodeData ( int  nodeId)
inlinevirtual
const DRTreeParsimonyNodeData& bpp::DRTreeParsimonyData::getNodeData ( int  nodeId) const
inlinevirtual

Implements bpp::TreeParsimonyData.

Definition at line 258 of file DRTreeParsimonyData.h.

References nodeData_.

size_t bpp::DRTreeParsimonyData::getNumberOfDistinctSites ( ) const
inline

Definition at line 303 of file DRTreeParsimonyData.h.

References nbDistinctSites_.

size_t bpp::DRTreeParsimonyData::getNumberOfSites ( ) const
inline

Definition at line 304 of file DRTreeParsimonyData.h.

References nbSites_.

size_t bpp::DRTreeParsimonyData::getNumberOfStates ( ) const
inline

Definition at line 305 of file DRTreeParsimonyData.h.

References nbStates_.

size_t bpp::AbstractTreeParsimonyData::getRootArrayPosition ( size_t  site) const
inlinevirtualinherited
const Bitset& bpp::DRTreeParsimonyData::getRootBitset ( size_t  i) const
inline

Definition at line 297 of file DRTreeParsimonyData.h.

References rootBitsets_.

std::vector<Bitset>& bpp::DRTreeParsimonyData::getRootBitsets ( )
inline

Definition at line 295 of file DRTreeParsimonyData.h.

References rootBitsets_.

Referenced by bpp::DRTreeParsimonyScore::computeScores().

const std::vector<Bitset>& bpp::DRTreeParsimonyData::getRootBitsets ( ) const
inline

Definition at line 296 of file DRTreeParsimonyData.h.

References rootBitsets_.

unsigned int bpp::DRTreeParsimonyData::getRootScore ( size_t  i) const
inline
std::vector<unsigned int>& bpp::DRTreeParsimonyData::getRootScores ( )
inline

Definition at line 299 of file DRTreeParsimonyData.h.

References rootScores_.

Referenced by bpp::DRTreeParsimonyScore::computeScores().

const std::vector<unsigned int>& bpp::DRTreeParsimonyData::getRootScores ( ) const
inline

Definition at line 300 of file DRTreeParsimonyData.h.

References rootScores_.

std::vector<unsigned int>& bpp::DRTreeParsimonyData::getScoresArray ( int  nodeId,
int  neighborId 
)
inline

Definition at line 281 of file DRTreeParsimonyData.h.

References nodeData_.

const std::vector<unsigned int>& bpp::DRTreeParsimonyData::getScoresArray ( int  nodeId,
int  neighborId 
) const
inline

Definition at line 285 of file DRTreeParsimonyData.h.

References nodeData_.

const TreeTemplate<Node>* bpp::AbstractTreeParsimonyData::getTree ( ) const
inlinevirtualinherited
const TreeTemplate<Node>* bpp::AbstractTreeParsimonyData::getTreeP_ ( ) const
inlineprotectedinherited

Definition at line 113 of file AbstractTreeParsimonyData.h.

References bpp::AbstractTreeParsimonyData::tree_.

Referenced by reInit().

unsigned int bpp::AbstractTreeParsimonyData::getWeight ( size_t  pos) const
inlineinherited
void DRTreeParsimonyData::init ( const SiteContainer sites,
const StateMap stateMap 
)
throw (Exception
)
void DRTreeParsimonyData::reInit ( )
throw (Exception
)
void bpp::DRTreeParsimonyData::setTree ( const TreeTemplate< Node > *  tree)
inline

Set the tree associated to the data.

All node data will be actualized accordingly by calling the setNode() method on the corresponding nodes.

Warning
: the old tree and the new tree must be two clones! And particularly, they have to share the same topology and nodes id.
Parameters
treeThe tree to be associated to this data.

Definition at line 239 of file DRTreeParsimonyData.h.

References leafData_, nodeData_, bpp::AbstractTreeParsimonyData::setTreeP_(), and bpp::AbstractTreeParsimonyData::tree_.

Referenced by bpp::DRTreeParsimonyScore::DRTreeParsimonyScore(), and bpp::DRTreeParsimonyScore::operator=().

void bpp::AbstractTreeParsimonyData::setTreeP_ ( const TreeTemplate< Node > *  tree)
inlineprotectedinherited

Definition at line 112 of file AbstractTreeParsimonyData.h.

References bpp::AbstractTreeParsimonyData::tree_.

Referenced by setTree().

Member Data Documentation

std::map<int, DRTreeParsimonyLeafData> bpp::DRTreeParsimonyData::leafData_
mutableprivate

Definition at line 200 of file DRTreeParsimonyData.h.

Referenced by getLeafData(), operator=(), and setTree().

size_t bpp::DRTreeParsimonyData::nbDistinctSites_
private

Definition at line 206 of file DRTreeParsimonyData.h.

Referenced by getNumberOfDistinctSites(), and operator=().

size_t bpp::DRTreeParsimonyData::nbSites_
private

Definition at line 204 of file DRTreeParsimonyData.h.

Referenced by getNumberOfSites(), and operator=().

size_t bpp::DRTreeParsimonyData::nbStates_
private

Definition at line 205 of file DRTreeParsimonyData.h.

Referenced by getNumberOfStates(), and operator=().

std::map<int, DRTreeParsimonyNodeData> bpp::DRTreeParsimonyData::nodeData_
mutableprivate
std::vector<Bitset> bpp::DRTreeParsimonyData::rootBitsets_
mutableprivate

Definition at line 201 of file DRTreeParsimonyData.h.

Referenced by getRootBitset(), getRootBitsets(), and operator=().

std::vector<size_t> bpp::AbstractTreeParsimonyData::rootPatternLinks_
protectedinherited
std::vector<unsigned int> bpp::DRTreeParsimonyData::rootScores_
mutableprivate

Definition at line 202 of file DRTreeParsimonyData.h.

Referenced by getRootScore(), getRootScores(), and operator=().

std::vector<unsigned int> bpp::AbstractTreeParsimonyData::rootWeights_
protectedinherited
SiteContainer* bpp::DRTreeParsimonyData::shrunkData_
private

Definition at line 203 of file DRTreeParsimonyData.h.

Referenced by DRTreeParsimonyData(), operator=(), and ~DRTreeParsimonyData().


The documentation for this class was generated from the following files: