bpp-phyl  2.2.0
bpp::GeneralSubstitutionRegister Class Reference

Sets a Register based on a matrix of integers. If M is the matrix, M[i,j] is the number of the substitution type from i to j, or 0 if there is no substitution type from i to j. More...

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

+ Inheritance diagram for bpp::GeneralSubstitutionRegister:
+ Collaboration diagram for bpp::GeneralSubstitutionRegister:

Public Member Functions

 GeneralSubstitutionRegister (const SubstitutionModel *model)
 
 GeneralSubstitutionRegister (const SubstitutionModel *model, const RowMatrix< size_t > &matrix)
 
 GeneralSubstitutionRegister (const GeneralSubstitutionRegister &gsr)
 
GeneralSubstitutionRegisteroperator= (const GeneralSubstitutionRegister &gsr)
 
GeneralSubstitutionRegisterclone () const
 
virtual ~GeneralSubstitutionRegister ()
 
size_t getType (size_t i, size_t j) const
 Get the substitution type far a given pair of model states. More...
 
size_t getNumberOfSubstitutionTypes () const
 
std::string getTypeName (size_t type) const
 names of the types are their number. More...
 
const SubstitutionModelgetSubstitutionModel () const
 
const Alphabet * getAlphabet () const
 

Protected Member Functions

void updateTypes_ ()
 

Protected Attributes

size_t size_
 The size of the matrix, i.e. the number of states. More...
 
RowMatrix< size_t > matrix_
 The matrix of the substitution register. More...
 
std::map< size_t, std::map< size_t, std::vector< size_t > > > types_
 The map from substitution types to the map of from states to the vector of target states. More...
 
const SubstitutionModelmodel_
 

Detailed Description

Sets a Register based on a matrix of integers. If M is the matrix, M[i,j] is the number of the substitution type from i to j, or 0 if there is no substitution type from i to j.

Author
Laurent Guéguen

Definition at line 473 of file SubstitutionRegister.h.

Constructor & Destructor Documentation

◆ GeneralSubstitutionRegister() [1/3]

bpp::GeneralSubstitutionRegister::GeneralSubstitutionRegister ( const SubstitutionModel model)
inline

Definition at line 499 of file SubstitutionRegister.h.

Referenced by clone().

◆ GeneralSubstitutionRegister() [2/3]

bpp::GeneralSubstitutionRegister::GeneralSubstitutionRegister ( const SubstitutionModel model,
const RowMatrix< size_t > &  matrix 
)
inline

Definition at line 506 of file SubstitutionRegister.h.

References matrix_, size_, and updateTypes_().

◆ GeneralSubstitutionRegister() [3/3]

bpp::GeneralSubstitutionRegister::GeneralSubstitutionRegister ( const GeneralSubstitutionRegister gsr)
inline

Definition at line 519 of file SubstitutionRegister.h.

◆ ~GeneralSubstitutionRegister()

virtual bpp::GeneralSubstitutionRegister::~GeneralSubstitutionRegister ( )
inlinevirtual

Definition at line 537 of file SubstitutionRegister.h.

Member Function Documentation

◆ clone()

GeneralSubstitutionRegister* bpp::GeneralSubstitutionRegister::clone ( ) const
inlinevirtual

◆ getAlphabet()

const Alphabet* bpp::AbstractSubstitutionRegister::getAlphabet ( ) const
inlinevirtualinherited
Returns
The alphabet associated to this instance.

Implements bpp::SubstitutionRegister.

Definition at line 147 of file SubstitutionRegister.h.

References bpp::SubstitutionModel::getAlphabet(), and bpp::AbstractSubstitutionRegister::model_.

◆ getNumberOfSubstitutionTypes()

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

Implements bpp::SubstitutionRegister.

Definition at line 544 of file SubstitutionRegister.h.

References types_.

◆ getSubstitutionModel()

const SubstitutionModel* bpp::AbstractSubstitutionRegister::getSubstitutionModel ( ) const
inlinevirtualinherited
Returns
The substitution model associated to this instance.

Implements bpp::SubstitutionRegister.

Definition at line 145 of file SubstitutionRegister.h.

References bpp::AbstractSubstitutionRegister::model_.

◆ getType()

size_t bpp::GeneralSubstitutionRegister::getType ( size_t  fromState,
size_t  toState 
) const
inlinevirtual

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

Definition at line 539 of file SubstitutionRegister.h.

References matrix_.

◆ getTypeName()

std::string bpp::GeneralSubstitutionRegister::getTypeName ( size_t  type) const
inlinevirtual

names of the types are their number.

Implements bpp::SubstitutionRegister.

Reimplemented in bpp::AAExteriorSubstitutionRegister, bpp::AAInteriorSubstitutionRegister, and bpp::SelectedSubstitutionRegister.

Definition at line 552 of file SubstitutionRegister.h.

References types_.

◆ operator=()

GeneralSubstitutionRegister& bpp::GeneralSubstitutionRegister::operator= ( const GeneralSubstitutionRegister gsr)
inline

◆ updateTypes_()

Member Data Documentation

◆ matrix_

◆ model_

◆ size_

size_t bpp::GeneralSubstitutionRegister::size_
protected

The size of the matrix, i.e. the number of states.

Definition at line 480 of file SubstitutionRegister.h.

Referenced by GeneralSubstitutionRegister(), and operator=().

◆ types_

std::map<size_t, std::map<size_t, std::vector<size_t> > > bpp::GeneralSubstitutionRegister::types_
protected

The map from substitution types to the map of from states to the vector of target states.

This is the reverse information of matrix_

Definition at line 496 of file SubstitutionRegister.h.

Referenced by getNumberOfSubstitutionTypes(), getTypeName(), bpp::SelectedSubstitutionRegister::getTypeName(), bpp::AAInteriorSubstitutionRegister::getTypeName(), bpp::AAExteriorSubstitutionRegister::getTypeName(), and operator=().


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