bpp-phyl3  3.0.0
bpp::StateMapInterface Class Referenceabstract

Map the states of a given alphabet which have a model state. More...

#include <Bpp/Phyl/Model/StateMap.h>

+ Inheritance diagram for bpp::StateMapInterface:
+ Collaboration diagram for bpp::StateMapInterface:

Public Member Functions

virtual ~StateMapInterface ()
 
virtual StateMapInterfaceclone () const override=0
 
virtual const Alphabetalphabet () const =0
 
virtual std::shared_ptr< const AlphabetgetAlphabet () const =0
 
virtual size_t getNumberOfModelStates () const =0
 
virtual std::string getStateDescription (size_t index) const =0
 
virtual const std::vector< int > & getAlphabetStates () const =0
 
virtual std::string getAlphabetStateAsChar (size_t index) const =0
 
virtual int getAlphabetStateAsInt (size_t index) const =0
 
virtual std::vector< size_t > getModelStates (const std::string &code) const =0
 
virtual std::vector< size_t > getModelStates (int code) const =0
 
virtual bool operator== (const StateMapInterface &sm) const =0
 Comparison operator==. More...
 
virtual bool operator!= (const StateMapInterface &sm) const =0
 Comparison operator!=. More...
 

Detailed Description

Map the states of a given alphabet which have a model state.

Definition at line 23 of file StateMap.h.

Constructor & Destructor Documentation

◆ ~StateMapInterface()

virtual bpp::StateMapInterface::~StateMapInterface ( )
inlinevirtual

Definition at line 27 of file StateMap.h.

Member Function Documentation

◆ alphabet()

◆ clone()

virtual StateMapInterface* bpp::StateMapInterface::clone ( ) const
overridepure virtual

◆ getAlphabet()

virtual std::shared_ptr<const Alphabet> bpp::StateMapInterface::getAlphabet ( ) const
pure virtual

◆ getAlphabetStateAsChar()

virtual std::string bpp::StateMapInterface::getAlphabetStateAsChar ( size_t  index) const
pure virtual
Parameters
indexThe model state.
Returns
The corresponding alphabet state as character code.

Implemented in bpp::AbstractStateMap.

◆ getAlphabetStateAsInt()

◆ getAlphabetStates()

virtual const std::vector<int>& bpp::StateMapInterface::getAlphabetStates ( ) const
pure virtual
Returns
A vector with the corresponding alphabet states for each model state. the size of the vector is the number of model states, not the number of supported alphabet states, as distinct model states can correspond to a single alphabet state.

Implemented in bpp::AbstractStateMap.

Referenced by bpp::AbstractStateMap::operator!=(), and bpp::AbstractStateMap::operator==().

◆ getModelStates() [1/2]

virtual std::vector<size_t> bpp::StateMapInterface::getModelStates ( const std::string &  code) const
pure virtual
Parameters
codeThe character code of the alphabet state to check.
Returns
The corresponding model states, is any.

Implemented in bpp::AbstractStateMap.

Referenced by bpp::CategorySubstitutionRegister::setAlphabetCategories().

◆ getModelStates() [2/2]

virtual std::vector<size_t> bpp::StateMapInterface::getModelStates ( int  code) const
pure virtual
Parameters
codeThe int code of the alphabet state to check.
Returns
The corresponding model states, is any.

Implemented in bpp::AbstractStateMap.

◆ getNumberOfModelStates()

◆ getStateDescription()

virtual std::string bpp::StateMapInterface::getStateDescription ( size_t  index) const
pure virtual
Returns
A string describing the model state.
Parameters
indexThe state index.

Implemented in bpp::MarkovModulatedStateMap, and bpp::CanonicalStateMap.

Referenced by bpp::CategorySubstitutionRegister::setModelCategories().

◆ operator!=()

virtual bool bpp::StateMapInterface::operator!= ( const StateMapInterface sm) const
pure virtual

Comparison operator!=.

Two StateMaps are not identical if they do not share the same alphabet or states.

Implemented in bpp::AbstractStateMap.

◆ operator==()

virtual bool bpp::StateMapInterface::operator== ( const StateMapInterface sm) const
pure virtual

Comparison operator==.

Two StateMaps are identical if they share the same alphabet and states.

Implemented in bpp::AbstractStateMap.


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