bpp-phyl3  3.0.0
AbstractSubstitutionProcess.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: The Bio++ Development Group
2 //
3 // SPDX-License-Identifier: CECILL-2.1
4 
5 #ifndef BPP_PHYL_LIKELIHOOD_ABSTRACTSUBSTITUTIONPROCESS_H
6 #define BPP_PHYL_LIKELIHOOD_ABSTRACTSUBSTITUTIONPROCESS_H
7 
8 
9 #include "SubstitutionProcess.h"
10 
11 // From the STL:
12 #include <memory>
13 
14 // From bpp-core:
16 
17 namespace bpp
18 {
26  public virtual SubstitutionProcessInterface,
27  public virtual AbstractParameterAliasable
28 {
29 public:
32  {}
33 
34  size_t getNumberOfClasses() const
35  {
36  auto dist = getRateDistribution();
37  return dist ? dist->getNumberOfCategories() : 1;
38  }
39 
40  size_t getNumberOfStates() const
41  {
43  }
44 
45  std::shared_ptr<const Alphabet> getAlphabet() const
46  {
47  return stateMap().getAlphabet();
48  }
49 
50  bool isCompatibleWith(const AlignmentDataInterface& data) const
51  {
52  return data.getAlphabet()->getAlphabetType() == getAlphabet()->getAlphabetType();
53  }
54 
61 };
62 } // end namespace bpp
63 #endif // BPP_PHYL_LIKELIHOOD_ABSTRACTSUBSTITUTIONPROCESS_H
A partial implementation of the SubstitutionProcess interface.
bool isCompatibleWith(const AlignmentDataInterface &data) const
ParameterList getNonDerivableParameters() const
get NonDerivable parameters
std::shared_ptr< const Alphabet > getAlphabet() const
virtual std::shared_ptr< const Alphabet > getAlphabet() const =0
virtual size_t getNumberOfModelStates() const =0
This interface describes the substitution process along the tree and sites of the alignment.
virtual std::shared_ptr< const DiscreteDistributionInterface > getRateDistribution() const =0
Get a pointer to the rate distribution (or null if there is no rate distribution).
virtual const StateMapInterface & stateMap() const =0
virtual std::shared_ptr< const Alphabet > getAlphabet() const =0
Defines the basic types of data flow nodes.