bpp-phyl  2.4.0
bpp::SubstitutionMapping Class Referenceabstract

General interface for storing mapping data. More...

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

+ Inheritance diagram for bpp::SubstitutionMapping:
+ Collaboration diagram for bpp::SubstitutionMapping:

Public Member Functions

 SubstitutionMapping ()
 
virtual ~SubstitutionMapping ()
 
SubstitutionMappingclone () const =0
 
virtual size_t getNumberOfSubstitutionTypes () const =0
 
virtual double & operator() (size_t nodeIndex, size_t siteIndex, size_t type)=0
 
virtual const double & operator() (size_t nodeIndex, size_t siteIndex, size_t type) const =0
 
virtual const TreegetTree () const =0
 
virtual bool isEmpty () const =0
 
virtual size_t getNumberOfSites () const =0
 
virtual size_t getNumberOfBranches () const =0
 
virtual int getSitePosition (size_t index) const =0
 
virtual std::vector< double > getBranchLengths () const =0
 
virtual size_t getNodeIndex (int nodeId) const =0
 
virtual void setSitePosition (size_t index, int position)=0
 Set the position of a given site. More...
 

Detailed Description

General interface for storing mapping data.

There are several kinds of mapping:

  • Exact mapping, storing the positions of each substitution onto each branch,
  • Probabilistic mapping, storing the number of substitutions onto each branch.

Since only probabilistic substitution mapping is implemented for now, the basal interface only contains a few methods. More methods are expected to be added later.

Definition at line 65 of file SubstitutionMapping.h.

Constructor & Destructor Documentation

bpp::SubstitutionMapping::SubstitutionMapping ( )
inline

Definition at line 70 of file SubstitutionMapping.h.

virtual bpp::SubstitutionMapping::~SubstitutionMapping ( )
inlinevirtual

Definition at line 71 of file SubstitutionMapping.h.

References clone(), getNumberOfSubstitutionTypes(), and operator()().

Member Function Documentation

virtual std::vector<double> bpp::Mapping::getBranchLengths ( ) const
pure virtualinherited
Returns
A vector with all tree branch lengths.

Implemented in bpp::AbstractMapping.

Referenced by bpp::Mapping::~Mapping().

virtual size_t bpp::Mapping::getNodeIndex ( int  nodeId) const
pure virtualinherited
Parameters
nodeIdAn id of the node to look for in the map.
Returns
The mapping index for the specified node id.

Implemented in bpp::AbstractMapping.

Referenced by bpp::Mapping::~Mapping().

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

Implemented in bpp::AbstractMapping.

Referenced by bpp::Mapping::~Mapping().

virtual const Tree& bpp::Mapping::getTree ( ) const
pure virtualinherited
Returns
Get the phylogenetic tree associated to this mapping.

Implemented in bpp::AbstractMapping.

Referenced by bpp::Mapping::~Mapping().

virtual bool bpp::Mapping::isEmpty ( ) const
pure virtualinherited
Returns
True is the map is empty, that is, if no tree is associated to the map yet.

Implemented in bpp::AbstractMapping.

Referenced by bpp::AbstractMapping::getSitePosition(), bpp::AbstractMapping::getTree(), bpp::AbstractMapping::setSitePosition(), and bpp::Mapping::~Mapping().

virtual double& bpp::SubstitutionMapping::operator() ( size_t  nodeIndex,
size_t  siteIndex,
size_t  type 
)
pure virtual
virtual const double& bpp::SubstitutionMapping::operator() ( size_t  nodeIndex,
size_t  siteIndex,
size_t  type 
) const
pure virtual
virtual void bpp::Mapping::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.

Referenced by bpp::Mapping::~Mapping().


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