bpp-phyl3  3.0.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 (std::shared_ptr< const TreeTemplate< Node >> tree)
 
 AbstractTreeParsimonyData (const AbstractTreeParsimonyData &atpd)
 
AbstractTreeParsimonyDataoperator= (const AbstractTreeParsimonyData &atpd)
 
virtual ~AbstractTreeParsimonyData ()
 
size_t getRootArrayPosition (size_t site) const override
 
unsigned int getWeight (size_t pos) const
 
const TreeTemplate< Node > & tree () const override
 
std::shared_ptr< const TreeTemplate< Node > > getTree () const override
 
TreeParsimonyDataInterfaceclone () const override=0
 
virtual size_t getArrayPosition (int parentId, int sonId, size_t currentPosition) const =0
 
virtual TreeParsimonyNodeDataInterfacenodeData (int nodeId)=0
 
virtual const TreeParsimonyNodeDataInterfacenodeData (int nodeId) const =0
 

Protected Member Functions

void setTree (std::shared_ptr< const TreeTemplate< Node >> tree)
 

Protected Attributes

std::vector< size_t > rootPatternLinks_
 
std::vector< unsigned int > rootWeights_
 
std::shared_ptr< 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 correspondence 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 31 of file AbstractTreeParsimonyData.h.

Constructor & Destructor Documentation

◆ AbstractTreeParsimonyData() [1/2]

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

Definition at line 40 of file AbstractTreeParsimonyData.h.

◆ AbstractTreeParsimonyData() [2/2]

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

Definition at line 46 of file AbstractTreeParsimonyData.h.

◆ ~AbstractTreeParsimonyData()

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

Definition at line 61 of file AbstractTreeParsimonyData.h.

Member Function Documentation

◆ clone()

TreeParsimonyDataInterface* bpp::TreeParsimonyDataInterface::clone ( ) const
overridepure virtualinherited

Implements bpp::Clonable.

Implemented in bpp::DRTreeParsimonyData.

◆ getArrayPosition()

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

Implemented in bpp::DRTreeParsimonyData.

◆ getRootArrayPosition()

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

Implements bpp::TreeParsimonyDataInterface.

Definition at line 64 of file AbstractTreeParsimonyData.h.

References rootPatternLinks_.

◆ getTree()

std::shared_ptr<const TreeTemplate<Node> > bpp::AbstractTreeParsimonyData::getTree ( ) const
inlineoverridevirtual

Implements bpp::TreeParsimonyDataInterface.

Definition at line 76 of file AbstractTreeParsimonyData.h.

References tree_.

◆ getWeight()

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

Definition at line 69 of file AbstractTreeParsimonyData.h.

References rootWeights_.

◆ nodeData() [1/2]

virtual const TreeParsimonyNodeDataInterface& bpp::TreeParsimonyDataInterface::nodeData ( int  nodeId) const
pure virtualinherited

Implemented in bpp::DRTreeParsimonyData.

◆ nodeData() [2/2]

virtual TreeParsimonyNodeDataInterface& bpp::TreeParsimonyDataInterface::nodeData ( int  nodeId)
pure virtualinherited

Implemented in bpp::DRTreeParsimonyData.

◆ operator=()

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

Definition at line 52 of file AbstractTreeParsimonyData.h.

References rootPatternLinks_, rootWeights_, and tree_.

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

◆ setTree()

void bpp::AbstractTreeParsimonyData::setTree ( std::shared_ptr< const TreeTemplate< Node >>  tree)
inlineprotected

Definition at line 79 of file AbstractTreeParsimonyData.h.

References tree(), and tree_.

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

◆ tree()

const TreeTemplate<Node>& bpp::AbstractTreeParsimonyData::tree ( ) const
inlineoverridevirtual

Member Data Documentation

◆ rootPatternLinks_

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

◆ rootWeights_

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

◆ tree_

std::shared_ptr<const TreeTemplate<Node> > bpp::AbstractTreeParsimonyData::tree_
protected

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