bpp-phyl3  3.0.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 (std::shared_ptr< TreeTemplate< Node >> tree, std::shared_ptr< const SiteContainerInterface > data, bool verbose, bool includeGaps)
 
 AbstractTreeParsimonyScore (std::shared_ptr< TreeTemplate< Node >> tree, std::shared_ptr< const SiteContainerInterface > data, std::shared_ptr< const StateMapInterface > statesMap, bool verbose)
 
virtual ~AbstractTreeParsimonyScore ()
 
const Treetree () const override
 Get the tree for which scores are computed. More...
 
virtual const TreeTemplate< Node > & treeTemplate () const
 
virtual std::shared_ptr< const TreeTemplate< Node > > getTreeTemplate () const
 
std::vector< unsigned int > getScorePerSite () const override
 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...
 
const StateMapInterfacestateMap () const override
 Get the state map associated to this instance. More...
 
std::shared_ptr< const StateMapInterfacegetStateMap () const override
 Get the state map associated to this instance. More...
 
TreeParsimonyScoreInterfaceclone () 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

virtual Treetree_ ()
 
virtual TreeTemplate< Node > & treeTemplate_ ()
 
virtual std::shared_ptr< TreeTemplate< Node > > getTreeTemplate_ ()
 

Private Member Functions

void init_ (std::shared_ptr< const SiteContainerInterface > data, bool verbose)
 

Private Attributes

std::shared_ptr< TreeTemplate< Node > > treePtr_
 
std::shared_ptr< const SiteContainerInterfacedata_
 
std::shared_ptr< const Alphabetalphabet_
 
std::shared_ptr< const StateMapInterfacestatesMap_
 
size_t nbStates_
 

Detailed Description

Partial implementation of the TreeParsimonyScore interface.

Definition at line 20 of file AbstractTreeParsimonyScore.h.

Constructor & Destructor Documentation

◆ AbstractTreeParsimonyScore() [1/2]

AbstractTreeParsimonyScore::AbstractTreeParsimonyScore ( std::shared_ptr< TreeTemplate< Node >>  tree,
std::shared_ptr< const SiteContainerInterface data,
bool  verbose,
bool  includeGaps 
)

Definition at line 14 of file AbstractTreeParsimonyScore.cpp.

References alphabet_, init_(), nbStates_, and statesMap_.

◆ AbstractTreeParsimonyScore() [2/2]

AbstractTreeParsimonyScore::AbstractTreeParsimonyScore ( std::shared_ptr< TreeTemplate< Node >>  tree,
std::shared_ptr< const SiteContainerInterface data,
std::shared_ptr< const StateMapInterface statesMap,
bool  verbose 
)

Definition at line 31 of file AbstractTreeParsimonyScore.cpp.

References init_().

◆ ~AbstractTreeParsimonyScore()

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

Definition at line 43 of file AbstractTreeParsimonyScore.h.

Member Function Documentation

◆ clone()

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

Implements bpp::Clonable.

Implemented in bpp::DRTreeParsimonyScore.

◆ getScore()

virtual unsigned int bpp::TreeParsimonyScoreInterface::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.

◆ getScoreForSite()

virtual unsigned int bpp::TreeParsimonyScoreInterface::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.

Referenced by getScorePerSite().

◆ getScorePerSite()

std::vector< unsigned int > AbstractTreeParsimonyScore::getScorePerSite ( ) const
overridevirtual

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

Definition at line 69 of file AbstractTreeParsimonyScore.cpp.

References data_, and bpp::TreeParsimonyScoreInterface::getScoreForSite().

◆ getStateMap()

std::shared_ptr<const StateMapInterface> bpp::AbstractTreeParsimonyScore::getStateMap ( ) const
inlineoverridevirtual

Get the state map associated to this instance.

Returns
A shared pointer toward the underlying state map.

Implements bpp::TreeParsimonyScoreInterface.

Definition at line 54 of file AbstractTreeParsimonyScore.h.

References statesMap_.

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

◆ getTreeTemplate()

virtual std::shared_ptr<const TreeTemplate<Node> > bpp::AbstractTreeParsimonyScore::getTreeTemplate ( ) const
inlinevirtual

◆ getTreeTemplate_()

virtual std::shared_ptr<TreeTemplate<Node> > bpp::AbstractTreeParsimonyScore::getTreeTemplate_ ( )
inlineprotectedvirtual

Definition at line 59 of file AbstractTreeParsimonyScore.h.

References treePtr_.

◆ init_()

void AbstractTreeParsimonyScore::init_ ( std::shared_ptr< const SiteContainerInterface data,
bool  verbose 
)
private

◆ stateMap()

const StateMapInterface& bpp::AbstractTreeParsimonyScore::stateMap ( ) const
inlineoverridevirtual

Get the state map associated to this instance.

Returns
The underlying state map.

Implements bpp::TreeParsimonyScoreInterface.

Definition at line 53 of file AbstractTreeParsimonyScore.h.

References statesMap_.

◆ tree()

const Tree& bpp::AbstractTreeParsimonyScore::tree ( ) const
inlineoverridevirtual

Get the tree for which scores are computed.

Returns
The tree associated to this object.

Implements bpp::TreeParsimonyScoreInterface.

Definition at line 49 of file AbstractTreeParsimonyScore.h.

References treePtr_.

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

◆ tree_()

virtual Tree& bpp::AbstractTreeParsimonyScore::tree_ ( )
inlineprotectedvirtual

Definition at line 57 of file AbstractTreeParsimonyScore.h.

References treePtr_.

◆ treeTemplate()

virtual const TreeTemplate<Node>& bpp::AbstractTreeParsimonyScore::treeTemplate ( ) const
inlinevirtual

◆ treeTemplate_()

virtual TreeTemplate<Node>& bpp::AbstractTreeParsimonyScore::treeTemplate_ ( )
inlineprotectedvirtual

Definition at line 58 of file AbstractTreeParsimonyScore.h.

References treePtr_.

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

Member Data Documentation

◆ alphabet_

std::shared_ptr<const Alphabet> bpp::AbstractTreeParsimonyScore::alphabet_
private

Definition at line 26 of file AbstractTreeParsimonyScore.h.

Referenced by AbstractTreeParsimonyScore().

◆ data_

std::shared_ptr<const SiteContainerInterface> bpp::AbstractTreeParsimonyScore::data_
private

Definition at line 25 of file AbstractTreeParsimonyScore.h.

Referenced by getScorePerSite(), and init_().

◆ nbStates_

size_t bpp::AbstractTreeParsimonyScore::nbStates_
private

Definition at line 28 of file AbstractTreeParsimonyScore.h.

Referenced by AbstractTreeParsimonyScore().

◆ statesMap_

std::shared_ptr<const StateMapInterface> bpp::AbstractTreeParsimonyScore::statesMap_
private

Definition at line 27 of file AbstractTreeParsimonyScore.h.

Referenced by AbstractTreeParsimonyScore(), getStateMap(), and stateMap().

◆ treePtr_

std::shared_ptr<TreeTemplate<Node> > bpp::AbstractTreeParsimonyScore::treePtr_
private

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