5 #ifndef BPP_PHYL_MAPPING_ONEJUMPSUBSTITUTIONCOUNT_H
6 #define BPP_PHYL_MAPPING_ONEJUMPSUBSTITUTIONCOUNT_H
9 #include "../Model/SubstitutionModel.h"
28 std::shared_ptr<const SubstitutionModelInterface>
model_;
46 AbstractSubstitutionCount::operator=(ojsc);
60 throw Exception(
"OneJumpSubstitutionCount::getNumberOfSubstitutions: model not defined.");
62 if (finalState != initialState)
return 1.;
63 else return 1. -
model_->Pij_t(initialState, finalState, length);
72 std::vector<double> v(0);
85 throw Exception(
"OneJumpSubstitutionCount::setSubstitutionRegister. This SubstitutionsCount only works with a TotalSubstitutionRegister.");
Partial implementation of the SubstitutionCount interface.
Computes the probability that at least one jump occurred on a branch, given the initial and final sta...
OneJumpSubstitutionCount(const OneJumpSubstitutionCount &ojsc)
void setSubstitutionRegister(std::shared_ptr< const SubstitutionRegisterInterface > reg) override
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...
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,...
OneJumpSubstitutionCount(std::shared_ptr< const SubstitutionModelInterface > model)
virtual ~OneJumpSubstitutionCount()
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...
virtual OneJumpSubstitutionCount * clone() const override
std::shared_ptr< const SubstitutionModelInterface > model_
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.
OneJumpSubstitutionCount & operator=(const OneJumpSubstitutionCount &ojsc)
OneJumpSubstitutionCount(std::shared_ptr< const StateMapInterface > statemap)
Defines the basic types of data flow nodes.