bpp-phyl3  3.0.0
bpp::AbstractSubstitutionMapping Class Referenceabstract

Partial implementation of the substitution mapping interface. More...

#include <Bpp/Phyl/Mapping/SubstitutionMapping.h>

+ Inheritance diagram for bpp::AbstractSubstitutionMapping:
+ Collaboration diagram for bpp::AbstractSubstitutionMapping:

Public Member Functions

 AbstractSubstitutionMapping ()
 
 AbstractSubstitutionMapping (const AbstractSubstitutionMapping &absm)
 
AbstractSubstitutionMappingclone () const =0
 
AbstractSubstitutionMappingoperator= (const AbstractSubstitutionMapping &absm)
 
virtual ~AbstractSubstitutionMapping ()
 
size_t getNumberOfSubstitutionTypes () const
 
virtual void setNumberOfSubstitutionTypes (size_t numberOfTypes)
 
virtual double & operator() (unsigned int branchId, size_t siteIndex, size_t type)=0
 
virtual const double & operator() (unsigned int branchId, size_t siteIndex, size_t type) const =0
 
virtual size_t getNumberOfSites () const =0
 
virtual const PhyloBranchgetBranch (unsigned int branchId) const =0
 
virtual PhyloBranchgetBranch (unsigned int branchId)=0
 
virtual size_t getNumberOfBranches () const =0
 
virtual int getSitePosition (size_t index) const =0
 
virtual void setSitePosition (size_t index, int position)=0
 Set the position of a given site. More...
 
int getSitePosition (size_t index) const
 
void setSitePosition (size_t index, int position)
 Set the position of a given site. More...
 
size_t getNumberOfSites () const
 
virtual void setNumberOfSites (size_t numberOfSites)
 

Protected Attributes

std::vector< int > sitesPositions_
 
size_t nbSites_
 

Private Attributes

size_t numberOfTypes_
 

Detailed Description

Partial implementation of the substitution mapping interface.

This implementation copies the input tree in a TreeTemplate<Node> object.

Definition at line 55 of file SubstitutionMapping.h.

Constructor & Destructor Documentation

◆ AbstractSubstitutionMapping() [1/2]

bpp::AbstractSubstitutionMapping::AbstractSubstitutionMapping ( )
inline

Definition at line 63 of file SubstitutionMapping.h.

◆ AbstractSubstitutionMapping() [2/2]

bpp::AbstractSubstitutionMapping::AbstractSubstitutionMapping ( const AbstractSubstitutionMapping absm)
inline

Definition at line 65 of file SubstitutionMapping.h.

◆ ~AbstractSubstitutionMapping()

virtual bpp::AbstractSubstitutionMapping::~AbstractSubstitutionMapping ( )
inlinevirtual

Definition at line 78 of file SubstitutionMapping.h.

Member Function Documentation

◆ clone()

AbstractSubstitutionMapping* bpp::AbstractSubstitutionMapping::clone ( ) const
pure virtual

◆ getBranch() [1/2]

virtual const PhyloBranch& bpp::MappingInterface::getBranch ( unsigned int  branchId) const
pure virtualinherited

◆ getBranch() [2/2]

virtual PhyloBranch& bpp::MappingInterface::getBranch ( unsigned int  branchId)
pure virtualinherited

◆ getNumberOfBranches()

virtual size_t bpp::MappingInterface::getNumberOfBranches ( ) const
pure virtualinherited
Returns
The number of branches mapped.

Implemented in bpp::ProbabilisticSubstitutionMapping, and bpp::ProbabilisticRewardMapping.

◆ getNumberOfSites() [1/2]

◆ getNumberOfSites() [2/2]

virtual size_t bpp::MappingInterface::getNumberOfSites ( ) const
pure virtualinherited
Returns
The number of sites mapped.

Implemented in bpp::AbstractMapping.

◆ getNumberOfSubstitutionTypes()

◆ getSitePosition() [1/2]

int bpp::AbstractMapping::getSitePosition ( size_t  index) const
inlinevirtualinherited
Parameters
indexThe site index.
Returns
The site position corresponding to the index.

Implements bpp::MappingInterface.

Definition at line 98 of file Mapping.h.

References bpp::AbstractMapping::sitesPositions_.

◆ getSitePosition() [2/2]

virtual int bpp::MappingInterface::getSitePosition ( size_t  index) const
pure virtualinherited
Parameters
indexThe site index.
Returns
The site position corresponding to the index.

Implemented in bpp::AbstractMapping.

◆ operator()() [1/2]

virtual const double& bpp::SubstitutionMapping::operator() ( unsigned int  branchId,
size_t  siteIndex,
size_t  type 
) const
pure virtualinherited

◆ operator()() [2/2]

virtual double& bpp::SubstitutionMapping::operator() ( unsigned int  branchId,
size_t  siteIndex,
size_t  type 
)
pure virtualinherited

◆ operator=()

AbstractSubstitutionMapping& bpp::AbstractSubstitutionMapping::operator= ( const AbstractSubstitutionMapping absm)
inline

◆ setNumberOfSites()

◆ setNumberOfSubstitutionTypes()

virtual void bpp::AbstractSubstitutionMapping::setNumberOfSubstitutionTypes ( size_t  numberOfTypes)
inlinevirtual

◆ setSitePosition() [1/2]

void bpp::AbstractMapping::setSitePosition ( size_t  index,
int  position 
)
inlinevirtualinherited

Set the position of a given site.

Warning
No index checking is performed, use with care!
Parameters
indexThe site index.
positionThe position of the site.

Implements bpp::MappingInterface.

Definition at line 103 of file Mapping.h.

References bpp::AbstractMapping::nbSites_, and bpp::AbstractMapping::sitesPositions_.

Referenced by bpp::RewardMappingTools::readFromStream(), and bpp::SubstitutionMappingTools::readFromStream().

◆ setSitePosition() [2/2]

virtual void bpp::MappingInterface::setSitePosition ( size_t  index,
int  position 
)
pure virtualinherited

Set the position of a given site.

Warning
No index checking is performed, use with care!
Parameters
indexThe site index.
positionThe position of the site.

Implemented in bpp::AbstractMapping.

Member Data Documentation

◆ nbSites_

size_t bpp::AbstractMapping::nbSites_
protectedinherited

◆ numberOfTypes_

size_t bpp::AbstractSubstitutionMapping::numberOfTypes_
private

◆ sitesPositions_

std::vector<int> bpp::AbstractMapping::sitesPositions_
protectedinherited

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