bpp-phyl  2.2.0
bpp::AbstractTreeParsimonyData Class Referenceabstract

Partial implementation of the TreeParsimonyData interface. More...

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

+ Inheritance diagram for bpp::AbstractTreeParsimonyData:
+ Collaboration diagram for bpp::AbstractTreeParsimonyData:

Public Member Functions

 AbstractTreeParsimonyData (const TreeTemplate< Node > *tree)
 
 AbstractTreeParsimonyData (const AbstractTreeParsimonyData &atpd)
 
AbstractTreeParsimonyDataoperator= (const AbstractTreeParsimonyData &atpd)
 
virtual ~AbstractTreeParsimonyData ()
 
size_t getRootArrayPosition (size_t site) const
 
unsigned int getWeight (size_t pos) const
 
const TreeTemplate< Node > * getTree () const
 
TreeParsimonyDataclone () const =0
 
virtual size_t getArrayPosition (int parentId, int sonId, size_t currentPosition) const =0
 
virtual TreeParsimonyNodeDatagetNodeData (int nodeId)=0
 
virtual const TreeParsimonyNodeDatagetNodeData (int nodeId) const =0
 

Protected Member Functions

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_
 

Detailed Description

Partial implementation of the TreeParsimonyData interface.

This data structure provides a simple compression, by performing and storing computations only one time per identical sites.

The compression is achieved by the TreeParsimonyScore object. The correspondance between sites in the dataset and the arrays in the structures is given by the rootPatternLinks_ array: the array indice for site $i$ if given by:

Finally, the rootWeights_ array gives for each array position, the number of sites with this pattern. The global parsimony score is then given by the sum of all scores for each array position, weighted by the corresponding number of sites.

Definition at line 66 of file AbstractTreeParsimonyData.h.

Constructor & Destructor Documentation

◆ AbstractTreeParsimonyData() [1/2]

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

Definition at line 75 of file AbstractTreeParsimonyData.h.

◆ AbstractTreeParsimonyData() [2/2]

bpp::AbstractTreeParsimonyData::AbstractTreeParsimonyData ( const AbstractTreeParsimonyData atpd)
inline

Definition at line 81 of file AbstractTreeParsimonyData.h.

◆ ~AbstractTreeParsimonyData()

virtual bpp::AbstractTreeParsimonyData::~AbstractTreeParsimonyData ( )
inlinevirtual

Definition at line 96 of file AbstractTreeParsimonyData.h.

Member Function Documentation

◆ clone()

TreeParsimonyData* bpp::TreeParsimonyData::clone ( ) const
pure virtualinherited

Implemented in bpp::DRTreeParsimonyData.

◆ getArrayPosition()

virtual size_t bpp::TreeParsimonyData::getArrayPosition ( int  parentId,
int  sonId,
size_t  currentPosition 
) const
pure virtualinherited

Implemented in bpp::DRTreeParsimonyData.

◆ getNodeData() [1/2]

virtual TreeParsimonyNodeData& bpp::TreeParsimonyData::getNodeData ( int  nodeId)
pure virtualinherited

Implemented in bpp::DRTreeParsimonyData.

◆ getNodeData() [2/2]

virtual const TreeParsimonyNodeData& bpp::TreeParsimonyData::getNodeData ( int  nodeId) const
pure virtualinherited

Implemented in bpp::DRTreeParsimonyData.

◆ getRootArrayPosition()

size_t bpp::AbstractTreeParsimonyData::getRootArrayPosition ( size_t  site) const
inlinevirtual

◆ getTree()

const TreeTemplate<Node>* bpp::AbstractTreeParsimonyData::getTree ( ) const
inlinevirtual

Implements bpp::TreeParsimonyData.

Definition at line 109 of file AbstractTreeParsimonyData.h.

References tree_.

◆ getTreeP_()

const TreeTemplate<Node>* bpp::AbstractTreeParsimonyData::getTreeP_ ( ) const
inlineprotected

Definition at line 113 of file AbstractTreeParsimonyData.h.

References tree_.

Referenced by bpp::DRTreeParsimonyData::reInit().

◆ getWeight()

unsigned int bpp::AbstractTreeParsimonyData::getWeight ( size_t  pos) const
inline

Definition at line 104 of file AbstractTreeParsimonyData.h.

References rootWeights_.

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

◆ operator=()

AbstractTreeParsimonyData& bpp::AbstractTreeParsimonyData::operator= ( const AbstractTreeParsimonyData atpd)
inline

Definition at line 87 of file AbstractTreeParsimonyData.h.

References rootPatternLinks_, rootWeights_, and tree_.

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

◆ setTreeP_()

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

Definition at line 112 of file AbstractTreeParsimonyData.h.

References tree_.

Referenced by bpp::DRTreeParsimonyData::setTree().

Member Data Documentation

◆ rootPatternLinks_

std::vector<size_t> bpp::AbstractTreeParsimonyData::rootPatternLinks_
protected

Definition at line 70 of file AbstractTreeParsimonyData.h.

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

◆ rootWeights_

std::vector<unsigned int> bpp::AbstractTreeParsimonyData::rootWeights_
protected

Definition at line 71 of file AbstractTreeParsimonyData.h.

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

◆ tree_

const TreeTemplate<Node>* bpp::AbstractTreeParsimonyData::tree_
protected

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