bpp-phyl  2.2.0
bpp::AbstractTreeParsimonyScore Class Referenceabstract

Partial implementation of the TreeParsimonyScore interface. More...

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

+ Inheritance diagram for bpp::AbstractTreeParsimonyScore:
+ Collaboration diagram for bpp::AbstractTreeParsimonyScore:

Public Member Functions

 AbstractTreeParsimonyScore (const Tree &tree, const SiteContainer &data, bool verbose, bool includeGaps) throw (Exception)
 
 AbstractTreeParsimonyScore (const Tree &tree, const SiteContainer &data, const StateMap *statesMap, bool verbose) throw (Exception)
 
 AbstractTreeParsimonyScore (const AbstractTreeParsimonyScore &tp)
 
AbstractTreeParsimonyScoreoperator= (const AbstractTreeParsimonyScore &tp)
 
virtual ~AbstractTreeParsimonyScore ()
 
virtual const TreegetTree () const
 Get the tree for wich scores are computed. More...
 
virtual std::vector< unsigned int > getScoreForEachSite () const
 Get the score for each site for the current tree, i.e. the total minimum number of changes in the tree for each site. More...
 
virtual const StateMapgetStateMap () const
 
TreeParsimonyScoreclone () const =0
 
virtual unsigned int getScore () const =0
 Get the score for the current tree, i.e. the total minimum number of changes in the tree. More...
 
virtual unsigned int getScoreForSite (size_t site) const =0
 Get the score for a given site for the current tree, i.e. the total minimum number of changes in the tree for this site. More...
 

Protected Member Functions

const TreeTemplate< Node > * getTreeP_ () const
 
TreeTemplate< Node > * getTreeP_ ()
 

Private Member Functions

void init_ (const SiteContainer &data, bool verbose) throw (Exception)
 

Private Attributes

TreeTemplate< Node > * tree_
 
const SiteContainer * data_
 
const Alphabet * alphabet_
 
const StateMapstatesMap_
 
size_t nbStates_
 

Detailed Description

Partial implementation of the TreeParsimonyScore interface.

Definition at line 54 of file AbstractTreeParsimonyScore.h.

Constructor & Destructor Documentation

◆ AbstractTreeParsimonyScore() [1/3]

AbstractTreeParsimonyScore::AbstractTreeParsimonyScore ( const Tree tree,
const SiteContainer &  data,
bool  verbose,
bool  includeGaps 
)
throw (Exception
)

Definition at line 49 of file AbstractTreeParsimonyScore.cpp.

◆ AbstractTreeParsimonyScore() [2/3]

AbstractTreeParsimonyScore::AbstractTreeParsimonyScore ( const Tree tree,
const SiteContainer &  data,
const StateMap statesMap,
bool  verbose 
)
throw (Exception
)

Definition at line 67 of file AbstractTreeParsimonyScore.cpp.

◆ AbstractTreeParsimonyScore() [3/3]

bpp::AbstractTreeParsimonyScore::AbstractTreeParsimonyScore ( const AbstractTreeParsimonyScore tp)
inline

Definition at line 79 of file AbstractTreeParsimonyScore.h.

References bpp::StateMap::clone(), data_, statesMap_, and tree_.

◆ ~AbstractTreeParsimonyScore()

virtual bpp::AbstractTreeParsimonyScore::~AbstractTreeParsimonyScore ( )
inlinevirtual

Definition at line 101 of file AbstractTreeParsimonyScore.h.

References data_, and tree_.

Member Function Documentation

◆ clone()

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

Implemented in bpp::DRTreeParsimonyScore.

◆ getScore()

virtual unsigned int bpp::TreeParsimonyScore::getScore ( ) const
pure virtualinherited

Get the score for the current tree, i.e. the total minimum number of changes in the tree.

Returns
The minimum total number of changes in the tree.

Implemented in bpp::DRTreeParsimonyScore.

◆ getScoreForEachSite()

std::vector< unsigned int > AbstractTreeParsimonyScore::getScoreForEachSite ( ) const
virtual

Get the score for each site for the current tree, i.e. the total minimum number of changes in the tree for each site.

Returns
The minimum total number of changes in the tree for each site.

Implements bpp::TreeParsimonyScore.

Definition at line 99 of file AbstractTreeParsimonyScore.cpp.

◆ getScoreForSite()

virtual unsigned int bpp::TreeParsimonyScore::getScoreForSite ( size_t  site) const
pure virtualinherited

Get the score for a given site for the current tree, i.e. the total minimum number of changes in the tree for this site.

Parameters
siteThe corresponding site.
Returns
The minimum total number of changes in the tree for site 'site'.

Implemented in bpp::DRTreeParsimonyScore.

◆ getStateMap()

virtual const StateMap& bpp::AbstractTreeParsimonyScore::getStateMap ( ) const
inlinevirtual

Definition at line 113 of file AbstractTreeParsimonyScore.h.

References statesMap_.

◆ getTree()

virtual const Tree& bpp::AbstractTreeParsimonyScore::getTree ( ) const
inlinevirtual

Get the tree for wich scores are computed.

Returns
The tree associated to this object.

Implements bpp::TreeParsimonyScore.

Definition at line 111 of file AbstractTreeParsimonyScore.h.

References tree_.

Referenced by bpp::DRTreeParsimonyScore::computeScores(), and bpp::DRTreeParsimonyScore::getTopology().

◆ getTreeP_() [1/2]

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

◆ getTreeP_() [2/2]

TreeTemplate<Node>* bpp::AbstractTreeParsimonyScore::getTreeP_ ( )
inlineprotected

Definition at line 117 of file AbstractTreeParsimonyScore.h.

References tree_.

◆ init_()

void AbstractTreeParsimonyScore::init_ ( const SiteContainer &  data,
bool  verbose 
)
throw (Exception
)
private

◆ operator=()

AbstractTreeParsimonyScore& bpp::AbstractTreeParsimonyScore::operator= ( const AbstractTreeParsimonyScore tp)
inline

Member Data Documentation

◆ alphabet_

const Alphabet* bpp::AbstractTreeParsimonyScore::alphabet_
private

Definition at line 60 of file AbstractTreeParsimonyScore.h.

Referenced by operator=().

◆ data_

const SiteContainer* bpp::AbstractTreeParsimonyScore::data_
private

◆ nbStates_

size_t bpp::AbstractTreeParsimonyScore::nbStates_
private

Definition at line 62 of file AbstractTreeParsimonyScore.h.

Referenced by operator=().

◆ statesMap_

const StateMap* bpp::AbstractTreeParsimonyScore::statesMap_
private

Definition at line 61 of file AbstractTreeParsimonyScore.h.

Referenced by AbstractTreeParsimonyScore(), getStateMap(), and operator=().

◆ tree_

TreeTemplate<Node>* bpp::AbstractTreeParsimonyScore::tree_
private

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