5 #ifndef BPP_PHYL_MAPPING_LAPLACESUBSTITUTIONCOUNT_H
6 #define BPP_PHYL_MAPPING_LAPLACESUBSTITUTIONCOUNT_H
9 #include "../Model/SubstitutionModel.h"
30 std::shared_ptr<const SubstitutionModelInterface>
model_;
37 std::shared_ptr<const SubstitutionModelInterface> model,
51 m_ (stateMap->getNumberOfModelStates(), stateMap->getNumberOfModelStates())
64 AbstractSubstitutionCount::operator=(asc);
77 double getNumberOfSubstitutions(
size_t initialState,
size_t finalState,
double length,
size_t type = 1)
const override;
85 std::vector<double> v(0);
98 throw Exception(
"LaplaceSubstitutionCount::setSubstitutionRegister. This SubstitutionsCount only works with a TotalSubstitutionRegister.");
Partial implementation of the SubstitutionCount interface.
Laplace estimate of the substitution count.
virtual ~LaplaceSubstitutionCount()
std::shared_ptr< const SubstitutionModelInterface > model_
std::vector< double > getNumberOfSubstitutionsPerType(size_t initialState, size_t finalState, double length) const override
Get the numbers of susbstitutions on a branch for all types, for an initial and final states,...
void setSubstitutionRegister(std::shared_ptr< const SubstitutionRegisterInterface > reg) override
void storeAllNumbersOfSubstitutions(double length, size_t type, Eigen::MatrixXd &mat) const override
Stores the numbers of susbstitutions on a branch, for each initial and final states,...
void substitutionRegisterHasChanged() override
void setSubstitutionModel(std::shared_ptr< const SubstitutionModelInterface > model) override
Set the substitution model associated with this count, if relevant.
void computeCounts(double length) const
double getNumberOfSubstitutions(size_t initialState, size_t finalState, double length, size_t type=1) const override
Get the number of susbstitutions on a branch, given the initial and final states, and the branch leng...
LaplaceSubstitutionCount(const LaplaceSubstitutionCount &asc)
std::unique_ptr< Matrix< double > > getAllNumbersOfSubstitutions(double length, size_t type=1) const override
Get the numbers of susbstitutions on a branch, for each initial and final states, and given the branc...
LaplaceSubstitutionCount & operator=(const LaplaceSubstitutionCount &asc)
LaplaceSubstitutionCount(std::shared_ptr< const StateMapInterface > stateMap, size_t cutOff)
LaplaceSubstitutionCount(std::shared_ptr< const SubstitutionModelInterface > model, size_t cutOff)
LaplaceSubstitutionCount * clone() const override
virtual size_t getNumberOfStates() const
Short cut function, equivalent to getSubstitutionRegister()->getAlphabet()->getSize().
Defines the basic types of data flow nodes.