bpp-phyl3  3.0.0
bpp::TotalSubstitutionRegister Class Reference

Count all substitutions. More...

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

+ Inheritance diagram for bpp::TotalSubstitutionRegister:
+ Collaboration diagram for bpp::TotalSubstitutionRegister:

Public Member Functions

 TotalSubstitutionRegister (std::shared_ptr< const StateMapInterface > stateMap)
 
TotalSubstitutionRegisterclone () const override
 
size_t getNumberOfSubstitutionTypes () const override
 
size_t getType (size_t fromState, size_t toState) const override
 Get the substitution type far a given pair of model states. More...
 
std::string getTypeName (size_t type) const override
 Get the name of a given substitution type. More...
 
const StateMapInterfacestateMap () const override
 
std::shared_ptr< const StateMapInterfacegetStateMap () const override
 
const Alphabetalphabet () const override
 
std::shared_ptr< const AlphabetgetAlphabet () const override
 
const std::string & getName () const override
 Get the name of the register. More...
 

Protected Attributes

std::shared_ptr< const StateMapInterfacestateMap_
 
std::string name_
 

Detailed Description

Count all substitutions.

This register has only 1 substitution type, mapped as:

  • 0 not a substitution
  • 1 a substitution

Definition at line 150 of file SubstitutionRegister.h.

Constructor & Destructor Documentation

◆ TotalSubstitutionRegister()

bpp::TotalSubstitutionRegister::TotalSubstitutionRegister ( std::shared_ptr< const StateMapInterface stateMap)
inline

Definition at line 154 of file SubstitutionRegister.h.

Referenced by clone().

Member Function Documentation

◆ alphabet()

const Alphabet& bpp::AbstractSubstitutionRegister::alphabet ( ) const
inlineoverridevirtualinherited
Returns
The alphabet associated to this instance.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 133 of file SubstitutionRegister.h.

References bpp::AbstractSubstitutionRegister::stateMap_.

◆ clone()

TotalSubstitutionRegister* bpp::TotalSubstitutionRegister::clone ( ) const
inlineoverridevirtual

◆ getAlphabet()

std::shared_ptr<const Alphabet> bpp::AbstractSubstitutionRegister::getAlphabet ( ) const
inlineoverridevirtualinherited
Returns
A shared_ptr toward the alphabet associated to this instance.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 135 of file SubstitutionRegister.h.

References bpp::AbstractSubstitutionRegister::stateMap_.

◆ getName()

const std::string& bpp::AbstractSubstitutionRegister::getName ( ) const
inlineoverridevirtualinherited

Get the name of the register.

Returns
A string describing the register.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 137 of file SubstitutionRegister.h.

References bpp::AbstractSubstitutionRegister::name_.

◆ getNumberOfSubstitutionTypes()

size_t bpp::TotalSubstitutionRegister::getNumberOfSubstitutionTypes ( ) const
inlineoverridevirtual
Returns
The number of substitution types supported by this class.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 161 of file SubstitutionRegister.h.

◆ getStateMap()

std::shared_ptr<const StateMapInterface> bpp::AbstractSubstitutionRegister::getStateMap ( ) const
inlineoverridevirtualinherited
Returns
A shared_ptr toward the state map associated to this instance.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 131 of file SubstitutionRegister.h.

References bpp::AbstractSubstitutionRegister::stateMap_.

◆ getType()

size_t bpp::TotalSubstitutionRegister::getType ( size_t  fromState,
size_t  toState 
) const
inlineoverridevirtual

Get the substitution type far a given pair of model states.

Parameters
fromStateInitial state (should be a state supported by the specified alphabet).
toStateFinal state (should be a state supported by the specified alphabet).
Returns
The index of the corresponding substitution type, ranging from 0 to 'getNumberOfSubstitutionTypes' + 1, as non-substitution (that is when fromState == toState) will always return 0.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 163 of file SubstitutionRegister.h.

◆ getTypeName()

std::string bpp::TotalSubstitutionRegister::getTypeName ( size_t  type) const
inlineoverridevirtual

Get the name of a given substitution type.

This method is only used for user-friendlyness purposes, not computational goal. I can therefore be left unimplemented in some cases.

Parameters
typeIndex of the substitution (should be an size_t contained in the register).
Returns
A string describing the substitution type.

Implements bpp::SubstitutionRegisterInterface.

Definition at line 168 of file SubstitutionRegister.h.

◆ stateMap()

Member Data Documentation

◆ name_

std::string bpp::AbstractSubstitutionRegister::name_
protectedinherited

◆ stateMap_


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