bpp-phyl3  3.0.0
bpp::AbstractWeightedSubstitutionCount Class Referenceabstract

Partial implementation of the WeightedSubstitutionCount interface. More...

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

+ Inheritance diagram for bpp::AbstractWeightedSubstitutionCount:
+ Collaboration diagram for bpp::AbstractWeightedSubstitutionCount:

Public Member Functions

 AbstractWeightedSubstitutionCount (std::shared_ptr< const AlphabetIndex2 > weights)
 
 AbstractWeightedSubstitutionCount (const AbstractWeightedSubstitutionCount &index)
 
AbstractWeightedSubstitutionCountoperator= (const AbstractWeightedSubstitutionCount &index)
 
virtual ~AbstractWeightedSubstitutionCount ()
 
void setWeights (std::shared_ptr< const AlphabetIndex2 > weights)
 
bool hasWeights () const
 
std::shared_ptr< const AlphabetIndex2getWeights () const
 
virtual SubstitutionCountInterfaceclone () const =0
 
virtual bool hasSubstitutionRegister () const =0
 
virtual std::shared_ptr< const SubstitutionRegisterInterfacegetSubstitutionRegister () const =0
 
virtual void setSubstitutionRegister (std::shared_ptr< const SubstitutionRegisterInterface > reg)=0
 
virtual size_t getNumberOfSubstitutionTypes () const
 Short cut function, equivalent to getSubstitutionRegister().getNumberOfSubstitutionTypes(). More...
 
virtual std::shared_ptr< const AlphabetgetAlphabet () const
 Short cut function, equivalent to getSubstitutionRegister()->getAlphabet(). More...
 
virtual size_t getNumberOfStates () const
 Short cut function, equivalent to getSubstitutionRegister()->getAlphabet()->getSize(). More...
 
virtual double getNumberOfSubstitutions (size_t initialState, size_t finalState, double length, size_t type) const =0
 Get the number of susbstitutions on a branch, given the initial and final states, and the branch length. More...
 
virtual std::unique_ptr< Matrix< double > > getAllNumbersOfSubstitutions (double length, size_t type) const =0
 Get the numbers of susbstitutions on a branch, for each initial and final states, and given the branch length. More...
 
virtual void storeAllNumbersOfSubstitutions (double length, size_t type, Eigen::MatrixXd &mat) const =0
 Stores the numbers of susbstitutions on a branch, for each initial and final states, and given the branch length. More...
 
virtual std::vector< double > getNumberOfSubstitutionsPerType (size_t initialState, size_t finalState, double length) const =0
 Get the numbers of susbstitutions on a branch for all types, for an initial and final states, given the branch length. More...
 
virtual void setSubstitutionModel (std::shared_ptr< const SubstitutionModelInterface > model)=0
 Set the substitution model associated with this count, if relevant. More...
 

Protected Member Functions

virtual void weightsHaveChanged ()=0
 

Protected Attributes

std::shared_ptr< const AlphabetIndex2weights_
 

Detailed Description

Partial implementation of the WeightedSubstitutionCount interface.

Definition at line 38 of file WeightedSubstitutionCount.h.

Constructor & Destructor Documentation

◆ AbstractWeightedSubstitutionCount() [1/2]

bpp::AbstractWeightedSubstitutionCount::AbstractWeightedSubstitutionCount ( std::shared_ptr< const AlphabetIndex2 weights)
inline

Definition at line 45 of file WeightedSubstitutionCount.h.

◆ AbstractWeightedSubstitutionCount() [2/2]

bpp::AbstractWeightedSubstitutionCount::AbstractWeightedSubstitutionCount ( const AbstractWeightedSubstitutionCount index)
inline

Definition at line 49 of file WeightedSubstitutionCount.h.

◆ ~AbstractWeightedSubstitutionCount()

virtual bpp::AbstractWeightedSubstitutionCount::~AbstractWeightedSubstitutionCount ( )
inlinevirtual

Definition at line 60 of file WeightedSubstitutionCount.h.

Member Function Documentation

◆ clone()

◆ getAllNumbersOfSubstitutions()

virtual std::unique_ptr< Matrix<double> > bpp::SubstitutionCountInterface::getAllNumbersOfSubstitutions ( double  length,
size_t  type 
) const
pure virtualinherited

Get the numbers of susbstitutions on a branch, for each initial and final states, and given the branch length.

Parameters
lengthThe length of the branch.
typeThe type of susbstitution to count.
Returns
A matrix with all numbers of substitutions for each initial and final states.

Implemented in bpp::UniformizationSubstitutionCount, bpp::OneJumpSubstitutionCount, bpp::LabelSubstitutionCount, bpp::NaiveSubstitutionCount, bpp::LaplaceSubstitutionCount, and bpp::DecompositionSubstitutionCount.

◆ getAlphabet()

virtual std::shared_ptr<const Alphabet> bpp::SubstitutionCountInterface::getAlphabet ( ) const
inlinevirtualinherited

Short cut function, equivalent to getSubstitutionRegister()->getAlphabet().

Returns
The alphabet associated to this substitution count.

Definition at line 78 of file SubstitutionCount.h.

References bpp::SubstitutionCountInterface::getSubstitutionRegister().

◆ getNumberOfStates()

virtual size_t bpp::SubstitutionCountInterface::getNumberOfStates ( ) const
inlinevirtualinherited

Short cut function, equivalent to getSubstitutionRegister()->getAlphabet()->getSize().

Returns
The number of states in the model/alphabet.

Definition at line 85 of file SubstitutionCount.h.

References bpp::SubstitutionCountInterface::getSubstitutionRegister().

◆ getNumberOfSubstitutions()

virtual double bpp::SubstitutionCountInterface::getNumberOfSubstitutions ( size_t  initialState,
size_t  finalState,
double  length,
size_t  type 
) const
pure virtualinherited

Get the number of susbstitutions on a branch, given the initial and final states, and the branch length.

Parameters
initialStateThe initial state.
finalStateThe final state.
lengthThe length of the branch.
typeThe type of substitution to count.
Returns
The number of substitutions on a branch of specified length and according to initial and final states.

Implemented in bpp::UniformizationSubstitutionCount, bpp::OneJumpSubstitutionCount, bpp::LabelSubstitutionCount, bpp::NaiveSubstitutionCount, bpp::LaplaceSubstitutionCount, and bpp::DecompositionSubstitutionCount.

◆ getNumberOfSubstitutionsPerType()

virtual std::vector<double> bpp::SubstitutionCountInterface::getNumberOfSubstitutionsPerType ( size_t  initialState,
size_t  finalState,
double  length 
) const
pure virtualinherited

Get the numbers of susbstitutions on a branch for all types, for an initial and final states, given the branch length.

Parameters
initialStateThe initial state.
finalStateThe final state.
lengthThe length of the branch.
Returns
A matrix with all numbers of substitutions for each initial and final states.

Implemented in bpp::UniformizationSubstitutionCount, bpp::OneJumpSubstitutionCount, bpp::LabelSubstitutionCount, bpp::NaiveSubstitutionCount, bpp::LaplaceSubstitutionCount, and bpp::DecompositionSubstitutionCount.

◆ getNumberOfSubstitutionTypes()

virtual size_t bpp::SubstitutionCountInterface::getNumberOfSubstitutionTypes ( ) const
inlinevirtualinherited

◆ getSubstitutionRegister()

virtual std::shared_ptr<const SubstitutionRegisterInterface> bpp::SubstitutionCountInterface::getSubstitutionRegister ( ) const
pure virtualinherited
Returns
The SubstitutionRegister object associated to this instance. The register contains the description of the various substitutions types that are mapped.

Implemented in bpp::AbstractSubstitutionCount.

Referenced by bpp::SubstitutionCountInterface::getAlphabet(), bpp::SubstitutionCountInterface::getNumberOfStates(), and bpp::SubstitutionCountInterface::getNumberOfSubstitutionTypes().

◆ getWeights()

std::shared_ptr<const AlphabetIndex2> bpp::AbstractWeightedSubstitutionCount::getWeights ( ) const
inlinevirtual

Implements bpp::WeightedSubstitutionCount.

Definition at line 66 of file WeightedSubstitutionCount.h.

References weights_.

◆ hasSubstitutionRegister()

virtual bool bpp::SubstitutionCountInterface::hasSubstitutionRegister ( ) const
pure virtualinherited
Returns
Tell if a substitution register has been attached to this class.

Implemented in bpp::AbstractSubstitutionCount.

◆ hasWeights()

bool bpp::AbstractWeightedSubstitutionCount::hasWeights ( ) const
inlinevirtual

Implements bpp::WeightedSubstitutionCount.

Definition at line 65 of file WeightedSubstitutionCount.h.

References weights_.

◆ operator=()

AbstractWeightedSubstitutionCount& bpp::AbstractWeightedSubstitutionCount::operator= ( const AbstractWeightedSubstitutionCount index)
inline

◆ setSubstitutionModel()

virtual void bpp::SubstitutionCountInterface::setSubstitutionModel ( std::shared_ptr< const SubstitutionModelInterface model)
pure virtualinherited

Set the substitution model associated with this count, if relevant.

Parameters
modelThe substitution model to use with this count.

Implemented in bpp::UniformizationSubstitutionCount, bpp::OneJumpSubstitutionCount, bpp::LabelSubstitutionCount, bpp::NaiveSubstitutionCount, bpp::LaplaceSubstitutionCount, and bpp::DecompositionSubstitutionCount.

◆ setSubstitutionRegister()

virtual void bpp::SubstitutionCountInterface::setSubstitutionRegister ( std::shared_ptr< const SubstitutionRegisterInterface reg)
pure virtualinherited
Parameters
regThe new SubstitutionRegister object to be associated to this instance. The register contains the description of the various substitutions types that are mapped.

Implemented in bpp::OneJumpSubstitutionCount, bpp::LabelSubstitutionCount, bpp::LaplaceSubstitutionCount, and bpp::AbstractSubstitutionCount.

◆ setWeights()

void AbstractWeightedSubstitutionCount::setWeights ( std::shared_ptr< const AlphabetIndex2 weights)
virtual

Implements bpp::WeightedSubstitutionCount.

Definition at line 9 of file WeightedSubstitutionCount.cpp.

References weights_, and weightsHaveChanged().

◆ storeAllNumbersOfSubstitutions()

virtual void bpp::SubstitutionCountInterface::storeAllNumbersOfSubstitutions ( double  length,
size_t  type,
Eigen::MatrixXd &  mat 
) const
pure virtualinherited

Stores the numbers of susbstitutions on a branch, for each initial and final states, and given the branch length.

Parameters
lengthThe length of the branch.
typeThe type of susbstitution to count.
matThe matrix filled with all numbers of substitutions for each initial and final states.

Implemented in bpp::UniformizationSubstitutionCount, bpp::OneJumpSubstitutionCount, bpp::LabelSubstitutionCount, bpp::NaiveSubstitutionCount, bpp::LaplaceSubstitutionCount, and bpp::DecompositionSubstitutionCount.

◆ weightsHaveChanged()

virtual void bpp::AbstractWeightedSubstitutionCount::weightsHaveChanged ( )
protectedpure virtual

Member Data Documentation

◆ weights_


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