bpp-phyl  2.2.0
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 BitsetgetRootBitset (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, DRTreeParsimonyNodeDatanodeData_
 
std::map< int, DRTreeParsimonyLeafDataleafData_
 
std::vector< BitsetrootBitsets_
 
std::vector< unsigned int > rootScores_
 
SiteContainer * shrunkData_
 
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

◆ DRTreeParsimonyData() [1/2]

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

Definition at line 209 of file DRTreeParsimonyData.h.

Referenced by clone().

◆ DRTreeParsimonyData() [2/2]

DRTreeParsimonyData::DRTreeParsimonyData ( const DRTreeParsimonyData data)

Definition at line 52 of file DRTreeParsimonyData.cpp.

References shrunkData_.

◆ ~DRTreeParsimonyData()

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

Definition at line 225 of file DRTreeParsimonyData.h.

References shrunkData_.

Member Function Documentation

◆ clone()

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

Implements bpp::TreeParsimonyData.

Definition at line 227 of file DRTreeParsimonyData.h.

References DRTreeParsimonyData().

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

◆ getArrayPosition()

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.

◆ getBitsetsArray() [1/2]

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

Definition at line 272 of file DRTreeParsimonyData.h.

References nodeData_.

◆ getBitsetsArray() [2/2]

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

Definition at line 276 of file DRTreeParsimonyData.h.

References nodeData_.

◆ getLeafData() [1/2]

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

◆ getLeafData() [2/2]

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

Definition at line 267 of file DRTreeParsimonyData.h.

References leafData_.

◆ getNodeData() [1/2]

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

◆ getNodeData() [2/2]

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

Implements bpp::TreeParsimonyData.

Definition at line 258 of file DRTreeParsimonyData.h.

References nodeData_.

◆ getNumberOfDistinctSites()

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

Definition at line 303 of file DRTreeParsimonyData.h.

References nbDistinctSites_.

◆ getNumberOfSites()

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

Definition at line 304 of file DRTreeParsimonyData.h.

References nbSites_.

◆ getNumberOfStates()

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

Definition at line 305 of file DRTreeParsimonyData.h.

References nbStates_.

◆ getRootArrayPosition()

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

◆ getRootBitset()

const Bitset& bpp::DRTreeParsimonyData::getRootBitset ( size_t  i) const
inline

Definition at line 297 of file DRTreeParsimonyData.h.

References rootBitsets_.

◆ getRootBitsets() [1/2]

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

Definition at line 295 of file DRTreeParsimonyData.h.

References rootBitsets_.

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

◆ getRootBitsets() [2/2]

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

Definition at line 296 of file DRTreeParsimonyData.h.

References rootBitsets_.

◆ getRootScore()

unsigned int bpp::DRTreeParsimonyData::getRootScore ( size_t  i) const
inline

◆ getRootScores() [1/2]

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

Definition at line 299 of file DRTreeParsimonyData.h.

References rootScores_.

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

◆ getRootScores() [2/2]

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

Definition at line 300 of file DRTreeParsimonyData.h.

References rootScores_.

◆ getScoresArray() [1/2]

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

Definition at line 281 of file DRTreeParsimonyData.h.

References nodeData_.

◆ getScoresArray() [2/2]

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

Definition at line 285 of file DRTreeParsimonyData.h.

References nodeData_.

◆ getTree()

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

◆ getTreeP_()

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

Definition at line 113 of file AbstractTreeParsimonyData.h.

References bpp::AbstractTreeParsimonyData::tree_.

Referenced by reInit().

◆ getWeight()

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

◆ init() [1/2]

void DRTreeParsimonyData::init ( const SiteContainer &  sites,
const StateMap stateMap 
)
throw (Exception
)

◆ init() [2/2]

◆ operator=()

◆ reInit() [1/2]

void DRTreeParsimonyData::reInit ( )
throw (Exception
)

◆ reInit() [2/2]

◆ setTree()

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=().

◆ setTreeP_()

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

◆ leafData_

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

Definition at line 200 of file DRTreeParsimonyData.h.

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

◆ nbDistinctSites_

size_t bpp::DRTreeParsimonyData::nbDistinctSites_
private

Definition at line 206 of file DRTreeParsimonyData.h.

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

◆ nbSites_

size_t bpp::DRTreeParsimonyData::nbSites_
private

Definition at line 204 of file DRTreeParsimonyData.h.

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

◆ nbStates_

size_t bpp::DRTreeParsimonyData::nbStates_
private

Definition at line 205 of file DRTreeParsimonyData.h.

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

◆ nodeData_

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

◆ rootBitsets_

std::vector<Bitset> bpp::DRTreeParsimonyData::rootBitsets_
mutableprivate

Definition at line 201 of file DRTreeParsimonyData.h.

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

◆ rootPatternLinks_

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

◆ rootScores_

std::vector<unsigned int> bpp::DRTreeParsimonyData::rootScores_
mutableprivate

Definition at line 202 of file DRTreeParsimonyData.h.

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

◆ rootWeights_

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

◆ shrunkData_

SiteContainer* bpp::DRTreeParsimonyData::shrunkData_
private

Definition at line 203 of file DRTreeParsimonyData.h.

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

◆ tree_


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