bpp-phyl  2.1.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:

List of all members.

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.
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

Definition at line 209 of file DRTreeParsimonyData.h.

Referenced by clone().

virtual bpp::DRTreeParsimonyData::~DRTreeParsimonyData ( ) [inline, virtual]

Definition at line 225 of file DRTreeParsimonyData.h.

References shrunkData_.


Member Function Documentation

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 [inline, virtual]

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_.

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

Definition at line 267 of file DRTreeParsimonyData.h.

References leafData_.

const DRTreeParsimonyNodeData& bpp::DRTreeParsimonyData::getNodeData ( int  nodeId) const [inline, virtual]

Implements bpp::TreeParsimonyData.

Definition at line 258 of file DRTreeParsimonyData.h.

References nodeData_.

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_.

Definition at line 305 of file DRTreeParsimonyData.h.

References nbStates_.

size_t bpp::AbstractTreeParsimonyData::getRootArrayPosition ( size_t  site) const [inline, virtual, inherited]
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 [inline, virtual, inherited]
const TreeTemplate<Node>* bpp::AbstractTreeParsimonyData::getTreeP_ ( ) const [inline, protected, inherited]

Definition at line 113 of file AbstractTreeParsimonyData.h.

References bpp::AbstractTreeParsimonyData::tree_.

Referenced by reInit().

unsigned int bpp::AbstractTreeParsimonyData::getWeight ( size_t  pos) const [inline, inherited]
DRTreeParsimonyData & DRTreeParsimonyData::operator= ( const DRTreeParsimonyData data)
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 bpp::TreeTemplate< N >::getNode(), 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) [inline, protected, inherited]

Definition at line 112 of file AbstractTreeParsimonyData.h.

References bpp::AbstractTreeParsimonyData::tree_.

Referenced by setTree().


Member Data Documentation

Definition at line 200 of file DRTreeParsimonyData.h.

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

Definition at line 206 of file DRTreeParsimonyData.h.

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

Definition at line 204 of file DRTreeParsimonyData.h.

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

Definition at line 205 of file DRTreeParsimonyData.h.

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

std::vector<Bitset> bpp::DRTreeParsimonyData::rootBitsets_ [mutable, private]

Definition at line 201 of file DRTreeParsimonyData.h.

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

std::vector<unsigned int> bpp::DRTreeParsimonyData::rootScores_ [mutable, private]

Definition at line 202 of file DRTreeParsimonyData.h.

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


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Friends