5 #ifndef BPP_PHYL_LIKELIHOOD_SIMPLESUBSTITUTIONPROCESS_H
6 #define BPP_PHYL_LIKELIHOOD_SIMPLESUBSTITUTIONPROCESS_H
23 std::shared_ptr<BranchModelInterface>
model_;
27 std::shared_ptr<BranchModelInterface>
model,
28 std::shared_ptr<const PhyloTree> tree =
nullptr,
29 std::shared_ptr<FrequencySetInterface> rootFrequencies =
nullptr);
32 std::shared_ptr<BranchModelInterface>
model,
33 std::shared_ptr<ParametrizablePhyloTree> tree,
34 std::shared_ptr<FrequencySetInterface> rootFrequencies =
nullptr);
48 std::shared_ptr<const StateMapInterface>
getStateMap()
const override
50 return model_->getStateMap();
57 return std::vector<size_t>(1, 1);
65 std::shared_ptr<const BranchModelInterface>
getModel(
unsigned int nodeId,
size_t classIndex)
const override
75 std::shared_ptr<const BranchModelInterface>
getModel(
size_t n)
const override
82 throw Exception(
"SimpleSubstitutionProcess::getNodesWithModel not finished. Ask developers.");
91 virtual std::shared_ptr<const BranchModelInterface>
getModelForNode(
unsigned int nodeId)
const override
108 throw NullPointerException(
"SimpleSubstitutionProcess::rateDistribution. This process does not model a rate distribution.");
113 throw NullPointerException(
"SimpleSubstitutionProcess::rateDistribution. This process does not model a rate distribution.");
118 return independent ?
model_->getIndependentParameters() :
model_->getParameters();
138 if (std::dynamic_pointer_cast<const TransitionModelInterface>(
model_))
139 return std::dynamic_pointer_cast<const TransitionModelInterface>(
model_)->getFrequencies();
141 throw Exception(
"SimpleSubstitutionProcess::getRootFrequencies not possible with a non Transition Model.");
A partial implementation of the SubstitutionProcess interface.
bool hasRootFrequencySet() const
std::shared_ptr< const FrequencySetInterface > getRootFrequencySet() const
std::shared_ptr< const ParametrizablePhyloTree > getParametrizablePhyloTree() const
Interface for all Branch models.
Space and time homogeneous substitution process, without mixture.
const StateMapInterface & stateMap() const override
DiscreteDistributionInterface & rateDistribution() override
Get the rate distribution.
std::shared_ptr< BranchModelInterface > model_
const BranchModelInterface & model(unsigned int nodeId, size_t classIndex) const override
Get the substitution model corresponding to a certain branch, site pattern, and model class.
double getProbabilityForModel(size_t classIndex) const override
double getRateForModel(size_t classIndex) const override
const BranchModelInterface & model(size_t n) const override
void fireParameterChanged(const ParameterList &pl) override
AbsractParametrizable interface.
std::vector< size_t > getModelNumbers() const override
SimpleSubstitutionProcess * clone() const override
virtual std::shared_ptr< const BranchModelInterface > getModelForNode(unsigned int nodeId) const override
Get the model associated to a particular node id.
std::shared_ptr< DiscreteDistributionInterface > getRateDistribution() override
Get a pointer to the rate distribution (or null if there is no rate distribution).
const DiscreteDistributionInterface & rateDistribution() const override
Get the rate distribution.
void setModelScenario(std::shared_ptr< ModelScenario > modelpath) override
Set the modelPath, after checking it is valid (ie modelpath has only the model of the process).
ParameterList getBranchLengthParameters(bool independent) const override
size_t getModelNumberForNode(unsigned int nodeId) const override
Get the number of the model associated to a particular node id.
SimpleSubstitutionProcess & operator=(const SimpleSubstitutionProcess &ssp)
std::shared_ptr< const BranchModelInterface > getModel(size_t n) const override
const std::vector< unsigned int > getNodesWithModel(size_t i) const override
Get a list of nodes id for which the given model is associated.
Vdouble getClassProbabilities() const override
const std::vector< double > & getRootFrequencies() const override
Get the values of the frequencies for each state in the alphabet at the root node.
SimpleSubstitutionProcess(std::shared_ptr< BranchModelInterface > model, std::shared_ptr< const PhyloTree > tree=nullptr, std::shared_ptr< FrequencySetInterface > rootFrequencies=nullptr)
ParameterList getRateDistributionParameters(bool independent) const override
size_t getNumberOfModels() const override
std::shared_ptr< const DiscreteDistributionInterface > getRateDistribution() const override
Get a pointer to the rate distribution (or null if there is no rate distribution).
std::shared_ptr< const BranchModelInterface > getModel(unsigned int nodeId, size_t classIndex) const override
Get the substitution model corresponding to a certain branch, site pattern, and model class.
ParameterList getSubstitutionModelParameters(bool independent) const override
Methods to retrieve the parameters of specific objects.
std::shared_ptr< const StateMapInterface > getStateMap() const override
Map the states of a given alphabet which have a model state.
Defines the basic types of data flow nodes.
std::vector< double > Vdouble
std::vector< unsigned int > Vuint